test_auto_discovery_refuses_two_candidates¶
Tests › tests/test_preprocessor.py
What this test is for
Why it exists
Follows `discover_doxyfile`, and the stakes here are higher than there. Choosing the wrong config header does not merely index the wrong FILES — it indexes a different VARIANT of the right ones, and every count taken from the result still looks legitimate.
Verifies REQ-DDB-PIPE-014
Given
root = tmp_path / "repo"root.mkdir()
2 more
(root / "autoconf.h").write_text("#define FROM_AUTOCONF 1\n", encoding="utf-8")(root / "config.h").write_text("#define FROM_CONFIG 1\n", encoding="utf-8")
When
config = resolve_preprocessor( root, {SECTION_PREPROCESSOR: {"config_header": CONFIG_HEADER_AUTO}} )
Then
- ✓ config.macros equals ()
- ✓ config.declared holds
- ✓ config.searched holds
tests/test_preprocessor.py:528 · its file's page
What it checks (3)
assert config.macros == (), "discovery guessed among two candidates"observesresolve_preprocessorviaconfigassert config.declared, "a refusal must still record that a configuration was declared"observesresolve_preprocessorviaconfigassert config.searched, "a refusal must name where it looked"observesresolve_preprocessorviaconfig
Where the product reaches it
No product flow reaches this code: no product entry point's flow calls any of the functions this test calls.
Call flow
What it reaches
Each row runs from this test, through the calls it makes, to the code a requirement names. If that code breaks, the test's checks are what should catch it. Reaching is not proving: a check only proves what it observes. No mutation records were given, so these rows say what the test REACHES.
Requirements it verifies (1)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-PIPE-014 | catalog | 1 of 5: within_repo |
Also reaches 1 requirement
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-004 measured