test_guard_doxyfile.py¶
tests/guard/test_guard_doxyfile.py
Tests for Doxyfile fragment generation.
test_custom_configured_tags_are_included
test_guard_doxyfile.TestToolTagsFor.test_custom_configured_tags_are_included(self)
tests/guard/test_guard_doxyfile.py:25
Checks
assert "mytag" in tool_tags_for(config)
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-017 | measured | test_custom_configured_tags_are_included → tool_tags_for |
Source · 4 lines
def test_custom_configured_tags_are_included(self):
config = deep_merge(CONFIG_DEFAULTS, {"validate": {"tags": {"mytag": {"pattern": ".*"}}}})
assert "mytag" in tool_tags_for(config)
Activity · 2 steps
test_declares_an_alias_for_every_tool_tag
test_guard_doxyfile.TestBuildFragment.test_declares_an_alias_for_every_tool_tag(self)
tests/guard/test_guard_doxyfile.py:45
Checks
assert f'ALIASES += "{tag}' in fragment, tag
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-017 | measured | test_declares_an_alias_for_every_tool_tag → build_fragment |
Source · 5 lines
def test_declares_an_alias_for_every_tool_tag(self):
fragment = build_fragment(CONFIG_DEFAULTS)
for tag in tool_tags_for(CONFIG_DEFAULTS):
assert f'ALIASES += "{tag}' in fragment, tag
Activity · 3 steps
test_default_version_tag_is_not_aliased
test_guard_doxyfile.TestToolTagsFor.test_default_version_tag_is_not_aliased(self)
tests/guard/test_guard_doxyfile.py:40
Checks
assert "version" not in tool_tags_for(CONFIG_DEFAULTS)
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-017 | measured | test_default_version_tag_is_not_aliased → tool_tags_for |
Source · 4 lines
def test_default_version_tag_is_not_aliased(self):
assert "version" not in tool_tags_for(CONFIG_DEFAULTS)
Activity · 1 steps
test_enables_validity_checking
test_guard_doxyfile.TestBuildFragment.test_enables_validity_checking(self)
tests/guard/test_guard_doxyfile.py:61
Checks
assert "WARN_IF_DOC_ERROR = YES" in build_fragment(CONFIG_DEFAULTS)
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-017 | measured | test_enables_validity_checking → build_fragment |
Source · 3 lines
def test_enables_validity_checking(self):
assert "WARN_IF_DOC_ERROR = YES" in build_fragment(CONFIG_DEFAULTS)
Activity · 1 steps
test_every_tool_owned_tag_is_included
test_guard_doxyfile.TestToolTagsFor.test_every_tool_owned_tag_is_included(self)
tests/guard/test_guard_doxyfile.py:16
Checks
assert tags >= TOOL_OWNED_TAGS
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-017 | measured | test_every_tool_owned_tag_is_included → tool_tags_for |
Source · 4 lines
def test_every_tool_owned_tag_is_included(self):
tags = set(tool_tags_for(CONFIG_DEFAULTS))
assert tags >= TOOL_OWNED_TAGS
Activity · 2 steps
test_exemption_markers_map_to_nothing
test_guard_doxyfile.TestBuildFragment.test_exemption_markers_map_to_nothing(self)
Markers carry no payload, so they should render as empty rather than a section.
tests/guard/test_guard_doxyfile.py:50
Checks
assert f'ALIASES += "{tag}="' in fragment, tag
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-017 | measured | test_exemption_markers_map_to_nothing → build_fragment |
Source · 6 lines
def test_exemption_markers_map_to_nothing(self):
"""Markers carry no payload, so they should render as empty rather than a section."""
fragment = build_fragment(CONFIG_DEFAULTS)
for tag in sorted(EXEMPTION_TAGS):
assert f'ALIASES += "{tag}="' in fragment, tag
Activity · 3 steps
test_extra_tags_are_included
test_guard_doxyfile.TestToolTagsFor.test_extra_tags_are_included(self)
tests/guard/test_guard_doxyfile.py:29
Checks
assert "sends" in tagsassert "receives" in tags, "the leading at-sign should be stripped"
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-017 | measured | test_extra_tags_are_included → tool_tags_for |
Source · 6 lines
def test_extra_tags_are_included(self):
config = deep_merge(CONFIG_DEFAULTS, {"validate": {"extra_tags": ["sends", "@receives"]}})
tags = tool_tags_for(config)
assert "sends" in tags
assert "receives" in tags, "the leading at-sign should be stripped"
Activity · 4 steps
test_internal_docs_enabled_so_markers_hide_nothing
test_guard_doxyfile.TestBuildFragment.test_internal_docs_enabled_so_markers_hide_nothing(self)
\\internal-style suppression is exactly the bug the exemption rename avoided.
tests/guard/test_guard_doxyfile.py:75
Checks
assert "INTERNAL_DOCS = YES" in build_fragment(CONFIG_DEFAULTS)
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-017 | measured | test_internal_docs_enabled_so_markers_hide_nothing → build_fragment |
Source · 4 lines
def test_internal_docs_enabled_so_markers_hide_nothing(self):
"""\\internal-style suppression is exactly the bug the exemption rename avoided."""
assert "INTERNAL_DOCS = YES" in build_fragment(CONFIG_DEFAULTS)
Activity · 1 steps
test_is_include_ready
test_guard_doxyfile.TestBuildFragment.test_is_include_ready(self)
tests/guard/test_guard_doxyfile.py:79
Checks
assert fragment.endswith("\n")assert "@INCLUDE" in fragment, "should document how to include it"
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-017 | measured | test_is_include_ready → build_fragment |
Source · 5 lines
def test_is_include_ready(self):
fragment = build_fragment(CONFIG_DEFAULTS)
assert fragment.endswith("\n")
assert "@INCLUDE" in fragment, "should document how to include it"
Activity · 3 steps
test_needs_no_doxygen_installed
test_guard_doxyfile.TestBuildFragment.test_needs_no_doxygen_installed(self)
Pure text generation — doxygen is never a runtime dependency of the gate.
tests/guard/test_guard_doxyfile.py:84
Checks
assert isinstance(build_fragment(CONFIG_DEFAULTS), str)
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-017 | measured | test_needs_no_doxygen_installed → build_fragment |
Source · 3 lines
def test_needs_no_doxygen_installed(self):
"""Pure text generation — doxygen is never a runtime dependency of the gate."""
assert isinstance(build_fragment(CONFIG_DEFAULTS), str)1 more lines, not shown
Activity · 1 steps
test_non_default_version_tag_is_included
test_guard_doxyfile.TestToolTagsFor.test_non_default_version_tag_is_included(self)
Pointing the revision counter at a custom tag means doxygen needs that too.
tests/guard/test_guard_doxyfile.py:35
Checks
assert "revision" in tool_tags_for(config)
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-017 | measured | test_non_default_version_tag_is_included → tool_tags_for |
Source · 5 lines
def test_non_default_version_tag_is_included(self):
"""Pointing the revision counter at a custom tag means doxygen needs that too."""
config = deep_merge(CONFIG_DEFAULTS, {"validate": {"version": {"tag": "@revision"}}})
assert "revision" in tool_tags_for(config)
Activity · 2 steps
test_policy_warnings_are_opt_in_not_default
test_guard_doxyfile.TestBuildFragment.test_policy_warnings_are_opt_in_not_default(self)
Measured: enabling these produces 399 warnings against this repo, none of which are defects by doxygen-guard's standard — 309 are WARN_NO_PARAMDOC demanding
tests/guard/test_guard_doxyfile.py:64
Checks
assert f"# {key} = YES" in fragment, f"{key} should be a commented opt-in"assert f"\n{key} = YES" not in fragment, f"{key} must not be active"
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-017 | measured | test_policy_warnings_are_opt_in_not_default → build_fragment |
Source · 11 lines
def test_policy_warnings_are_opt_in_not_default(self):
"""Measured: enabling these produces 399 warnings against this repo, none of
which are defects by doxygen-guard's standard — 309 are WARN_NO_PARAMDOC
demanding @param for every parameter. Turning them on by default would impose
doxygen's policy on adopters, inverting the division of authority.
"""
fragment = build_fragment(CONFIG_DEFAULTS)
for key in ("WARN_IF_UNDOCUMENTED", "WARN_NO_PARAMDOC"):
assert f"# {key} = YES" in fragment, f"{key} should be a commented opt-in"
assert f"\n{key} = YES" not in fragment, f"{key} must not be active"
Activity · 4 steps
test_real_doxygen_commands_are_never_aliased
test_guard_doxyfile.TestToolTagsFor.test_real_doxygen_commands_are_never_aliased(self)
Aliasing a standard command would override doxygen's own definition.
tests/guard/test_guard_doxyfile.py:20
Checks
assert tags.isdisjoint({"brief", "version", "return", "returns", "file", "param"})
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-017 | measured | test_real_doxygen_commands_are_never_aliased → tool_tags_for |
Source · 5 lines
def test_real_doxygen_commands_are_never_aliased(self):
"""Aliasing a standard command would override doxygen's own definition."""
tags = set(tool_tags_for(CONFIG_DEFAULTS))
assert tags.isdisjoint({"brief", "version", "return", "returns", "file", "param"})
Activity · 2 steps
test_req_becomes_a_cross_referenced_section
test_guard_doxyfile.TestBuildFragment.test_req_becomes_a_cross_referenced_section(self)
tests/guard/test_guard_doxyfile.py:56
Checks
assert "xrefitem req" in fragmentassert "Requirement" in fragment
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-017 | measured | test_req_becomes_a_cross_referenced_section → build_fragment |
Source · 5 lines
def test_req_becomes_a_cross_referenced_section(self):
fragment = build_fragment(CONFIG_DEFAULTS)
assert "xrefitem req" in fragment
assert "Requirement" in fragment