test_a_stated_preprocessor_section_reaches_tier_one¶
Tests › tests/test_buildoptions.py
What this test is for
Why it exists
`--declare`'s OWN HELP MAKES THE PROMISE THIS BREAKS: "It is applied at TIER 1 through exactly the same validated route as the `options` argument ... and is recorded and replayed by later builds of the same database." Measured on the live mbedtls index, built from a single declaration file carrying both sections: `locks.tier` is `explicit` and appears in `stated_options`, while `predefined.tier` is `declared`. Same file, same flag, two tiers — and only the tier-1 one survives a later plain refresh.
Verifies REQ-DDB-CONFIG-008
Given
macros = ["MBEDTLS_THREADING_C", "MBEDTLS_THREADING_PTHREAD"]
When
alias = argparse.Namespace(predefined=list(macros))_recorded_predefined(alias, Path("/nonexistent.db"))section = argparse.Namespace(predefined=None, preprocessor={"predefined": list(macros)})
3 more
_recorded_predefined(section, Path("/nonexistent.db"))silent = argparse.Namespace(predefined=None, preprocessor={})_recorded_predefined(silent, Path("/nonexistent.db"))
Then
- ✓ _recorded_predefined(alias, Path("/nonexistent.db")) equals macros
- ✓ _recorded_predefined(section, Path("/nonexistent.db")) equals macros
- ✓ _recorded_predefined(silent, Path("/nonexistent.db")) is None
tests/test_buildoptions.py:607 · its file's page
What it checks (3)
assert _recorded_predefined(alias, Path("/nonexistent.db")) == macros, ( "the documented alias must resolve at tier 1 — the control on the fix" )observes_recorded_predefinedassert _recorded_predefined(section, Path("/nonexistent.db")) == macros, ( "a stated `preprocessor: {predefined: [...]}` is the SAME statement in the section " "spelling and must reach tier 1 too; landing at tier 2 means it is not replayed and " "vanishes on the next refresh of a target that does not carry the file" )observes_recorded_predefinedassert _recorded_predefined(silent, Path("/nonexistent.db")) is None, ( "a stated section with no macros states nothing, and must not fabricate an empty " "tier-1 statement that would then be replayed" )observes_recorded_predefined
Where the product reaches it
dossier→subject_payload→_flatten_subject→list(flow)
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-CONFIG-008 | catalog | unknown |
Also reaches 2 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-006 inferred
- REQ-DDB-MCP-001 inferred