test_auto_discovery_finds_one_conventional_header¶
Tests › tests/test_preprocessor.py
What this test is for
Why it exists
`auto` is OPT-IN, and this is the case it exists for: a Kconfig build has written `include/generated/autoconf.h` and the owner wants the index to represent it without restating the path.
Verifies REQ-DDB-PIPE-014
Given
root = tmp_path / "repo"(root / "include" / "generated").mkdir(parents=True)(root / "include" / "generated" / "autoconf.h").write_text( "#define CONFIG_FOO 1\n", encoding="utf-8" )
When
config = resolve_preprocessor( root, {SECTION_PREPROCESSOR: {"config_header": CONFIG_HEADER_AUTO}} )
Then
- ✓ config.macros equals ('"CONFIG_FOO=1"',)
- ✓ config.config_header equals "include/generated/autoconf.h"
- ✓ config.source equals SOURCE_CONFIG_HEADER
tests/test_preprocessor.py:506 · its file's page
What it checks (3)
assert config.macros == ('"CONFIG_FOO=1"',)observesresolve_preprocessorviaconfigassert config.config_header == "include/generated/autoconf.h"observesresolve_preprocessorviaconfigassert config.source == SOURCE_CONFIG_HEADERobservesresolve_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