diff --git a/tests/__snapshots__/test_src_trace/test_build_html[sphinx_project4-source_code4].doctree.xml b/tests/__snapshots__/test_src_trace/test_build_html[sphinx_project4-source_code4].doctree.xml new file mode 100644 index 00000000..c3361fad --- /dev/null +++ b/tests/__snapshots__/test_src_trace/test_build_html[sphinx_project4-source_code4].doctree.xml @@ -0,0 +1,3 @@ + + + diff --git a/tests/doc_test/cs_basic/conf.py b/tests/doc_test/cs_basic/conf.py new file mode 100644 index 00000000..d67a5bb1 --- /dev/null +++ b/tests/doc_test/cs_basic/conf.py @@ -0,0 +1,27 @@ +# Configuration file for the Sphinx documentation builder. +# +# For the full list of built-in configuration values, see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information + +project = "source-tracing-demo" +copyright = "2025, useblocks" +author = "useblocks" + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = ["sphinx_needs", "sphinx_codelinks"] + +templates_path = ["_templates"] +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] + +src_trace_config_from_toml = "src_trace.toml" + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = "alabaster" +html_static_path = ["_static"] diff --git a/tests/doc_test/cs_basic/dummy_src.cs b/tests/doc_test/cs_basic/dummy_src.cs new file mode 100644 index 00000000..4e3d3a38 --- /dev/null +++ b/tests/doc_test/cs_basic/dummy_src.cs @@ -0,0 +1,7 @@ +using System; + +// @ title here, IMPL_1, impl +void SingleLineExample() +{ + Console.WriteLine("Single-line comment example"); +} diff --git a/tests/doc_test/cs_basic/index.rst b/tests/doc_test/cs_basic/index.rst new file mode 100644 index 00000000..1750ff79 --- /dev/null +++ b/tests/doc_test/cs_basic/index.rst @@ -0,0 +1,2 @@ +.. src-trace:: + :project: src diff --git a/tests/doc_test/cs_basic/src_trace.toml b/tests/doc_test/cs_basic/src_trace.toml new file mode 100644 index 00000000..fd2a0913 --- /dev/null +++ b/tests/doc_test/cs_basic/src_trace.toml @@ -0,0 +1,5 @@ +[codelinks.projects.src] +remote_url_pattern = "https://github.com/useblocks/sphinx-codelinks/blob/{commit}/{path}#L{line}" + +[codelinks.projects.src.source_discover] +comment_type = "cs" diff --git a/tests/test_src_trace.py b/tests/test_src_trace.py index 8e87a71e..94c509fc 100644 --- a/tests/test_src_trace.py +++ b/tests/test_src_trace.py @@ -192,6 +192,10 @@ def test_src_tracing_config_positive(make_app: Callable[..., SphinxTestApp], tmp Path("doc_test") / "id_required", Path("doc_test") / "id_required", ), + ( + Path("doc_test") / "cs_basic", + Path("doc_test") / "cs_basic", + ), ], ) def test_build_html(