test_the_stated_macro_split_reaches_the_served_reply¶
Tests › tests/test_kconfig.py
What this test is for
Why it exists
THREE DEFECTS IN ONE SENTENCE, AND THE SUITE COULD NOT SEE ANY OF THEM, because every existing test calls `macros_meaning` DIRECTLY. This one goes through `kconfig_space`, which is what a consumer reaches, and that is the whole point of it.
Verifies REQ-DDB-CONFIG-005 REQ-DDB-PIPE-007 REQ-DDB-PIPE-014
Given
db = tmp_path / "split.db"conn = sqlite3.connect(str(db))
4 more
conn.execute("CREATE TABLE build_meta (key TEXT PRIMARY KEY, value TEXT)")conn.executemany( "INSERT INTO build_meta(key, value) VALUES(?, ?)", [ ("preprocessor.source", "flag"), ("preprocessor.predefined", '"A_MACRO" "B_MACRO"'), ("preprocessor.config_header", "include/proj/config.h"), ("preprocessor.stated_only", "A_MACRO, B_MACRO"), ], )conn.commit()conn.close()
When
served = kconfig_space(db, include_gates=False).macros_meaning
Then
- ✓ served contains "A_MACRO, B_MACRO"
- ✓ served contains "OFF"
- ✓ served does not contain "A, _, M"
- ✓ served does not contain "A, _"
- ✓ served does not contain "did not record which came from which"
What it exercises
The parts of the system's flows this test ran, measured by per-test coverage: lit steps ran in this test, dimmed ones did not, and ▶ marks where the test called in. Each title opens the whole flow with these steps lit.
`main` (scripts/export_parity.py) · 12 of 203 steps
… 177 earlier steps
… 6 steps between
1 more
- clew — `main` (clew/cli.py) · 10 of 400 steps
tests/test_kconfig.py:1132 · its file's page
What it checks (4)
assert "A_MACRO, B_MACRO" in served, ( f"the served reply does not name the macros that ship OFF, so the split never reached a " f"consumer. Check that _PREPROCESSOR_STATED_ONLY is in _meta's fetch tuple. Got: {served}" )observeskconfig_spaceviaservedassert "OFF" in served, "the reply must say those macros ship OFF, not merely that they differ"observeskconfig_spaceviaservedassert "A, _, M" not in served and "A, _" not in served, ( f"the names are being re-joined character by character — `stated_only` arrives already " f"comma-joined from `as_meta`. Got: {served}" )observeskconfig_spaceviaservedassert "did not record which came from which" not in served, ( "the reply fell through to the unrecorded-split wording while the split was present" )observeskconfig_spaceviaserved
Where the product reaches it
main→query_main→_payload→export_search→corpus_payload→kconfig_space(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 (3)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-CONFIG-005 | catalog | unknown |
| REQ-DDB-PIPE-007 | catalog | unknown |
| REQ-DDB-PIPE-014 | catalog | unknown |
Also reaches 5 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-QUERY-001 measured
- REQ-DDB-QUERY-003 measured
- REQ-DDB-QUERY-004 inferred
- REQ-DDB-QUERY-006 measured
- REQ-DDB-QUERY-013 inferred