test_a_stated_preprocessor_section_reaches_tier_one

Tests › tests/test_buildoptions.py

passed Passed in the packaged run.

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

  1. macros = ["MBEDTLS_THREADING_C", "MBEDTLS_THREADING_PTHREAD"]
→

When

  1. alias = argparse.Namespace(predefined=list(macros))
  2. _recorded_predefined(alias, Path("/nonexistent.db"))
  3. section = argparse.Namespace(predefined=None, preprocessor={"predefined": list(macros)})
3 more
  1. _recorded_predefined(section, Path("/nonexistent.db"))
  2. silent = argparse.Namespace(predefined=None, preprocessor={})
  3. _recorded_predefined(silent, Path("/nonexistent.db"))
→

Then

  1. ✓ _recorded_predefined(alias, Path("/nonexistent.db")) equals macros
  2. ✓ _recorded_predefined(section, Path("/nonexistent.db")) equals macros
  3. ✓ _recorded_predefined(silent, Path("/nonexistent.db")) is None

tests/test_buildoptions.py:607 · its file's page

What it checks (3)

  1. assert _recorded_predefined(alias, Path("/nonexistent.db")) == macros, ( "the documented alias must resolve at tier 1 — the control on the fix" ) observes _recorded_predefined
  2. assert _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_predefined
  3. assert _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

test_a_stated_preprocessor_section_reaches_tier_one→list→_recorded_predefined

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.

test_a_stated_preprocessor_section_reaches_tier_one · 3 checks_recorded_predefinedrecorded_explicitREQ-DDB-CONFIG-006 · inferred_recorded_predefinedmeta_sectionREQ-DDB-MCP-001 · inferred

Requirements it verifies (1)

requirementlinked byimplementers exercised
REQ-DDB-CONFIG-008catalogunknown
Also reaches 2 requirements

Its run touches their code; that is reach, not proof.