test_a_gate_says_whether_this_build_satisfied_it¶
Tests › tests/integration/test_gate_coverage_integration.py
What this test is for
Why it exists
PLAN ITEM 2.8, AND THE ANSWER TURNED OUT TO BE A COMPOSITION RATHER THAN A NEW LAYER. The item asked to make `--predefined` ADDITIVE — to LABEL what is on and off instead of deciding what is indexed — and left open "whether doxygen alone can do this or the tree-sitter path must supply the excluded branches". The tree-sitter path ALREADY supplies them: gh#11 recovers a function doxygen never emitted, precisely BECAUSE the preprocessor skipped it. So what was missing was never the rows; it was the label, and three fields on one row now carry it:
Given
root = tmp_path / "twoflag"(root / "src").mkdir(parents=True)
5 more
(root / "src" / "twoflag.c").write_text(TWO_FLAG_SOURCE, encoding="utf-8")doxyfile = root / "Doxyfile"doxyfile.write_text(DOXYFILE, encoding="utf-8")db = tmp_path / "twoflag.db"build_index( output=db, repo_root=root, doxyfile=doxyfile, options={"predefined": ["FIXTURE_DECLARED"]}, )
When
doss = function_dossier(db, "fixture_two_flags")origins = {gate.macro: gate.origin for gate in doss.gated_by}
Then
- ✓ doss is not None
- ✓ origins.get("FIXTURE_DECLARED") equals GATE_ORIGIN_DECLARED
- ✓ origins.get("FIXTURE_ABSENT") equals GATE_ORIGIN_UNDECLARED
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.
clew — `main` (clew/cli.py) · 41 of 400 steps
… 10 earlier steps
… 26 steps between
… 4 steps between
… 23 steps between
… 57 steps between
… 27 steps between
… 5 steps between
… 125 steps between
… 8 steps between
… 21 steps between
8 more
- thread `clew-first-build-` — `_first_build_worker` (clew/mcp_server/server.py) · 27 of 142 steps
- Look up one name: everything the index holds about it · 26 of 226 steps
- Build, refresh and check the index · 21 of 153 steps
- Build this wiki from the index · 14 of 400 steps
- `main` (scripts/export_parity.py) · 10 of 203 steps
- `main` (clew/guard/main.py) · 3 of 357 steps
- clew-mcp — `main` (clew/mcp_server/server.py) · 1 of 17 steps
- `main` (scripts/incremental_probe.py) · 1 of 3 steps
tests/integration/test_gate_coverage_integration.py:165 · its file's page
What it checks (3)
assert doss is not None, ( "the function must be INDEXED even though the build does not satisfy its gates — that is " "gh#11's recovery, and it is what makes 'index the union, label the branches' possible " "without running the preprocessor twice" )observesfunction_dossierviadossassert origins.get("FIXTURE_DECLARED") == GATE_ORIGIN_DECLARED, ( f"the build declared this macro, so the gate must say so: {origins}" )not attributedassert origins.get("FIXTURE_ABSENT") == GATE_ORIGIN_UNDECLARED, ( f"the build did NOT declare this one, and that is the half that says the code is absent " f"from this variant: {origins}" )not attributed
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.
and 2 more requirement paths, listed below.
Also reaches 57 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CLI-001 measured
- REQ-DDB-CONFIG-001 measured
- REQ-DDB-CONFIG-004 measured
- REQ-DDB-CONFIG-005 measured
- REQ-DDB-CONFIG-006 measured
- REQ-DDB-CONFIG-007 measured
- REQ-DDB-CONFIG-009 measured
- REQ-DDB-INDEX-001 measured
- REQ-DDB-INDEX-002 measured
- REQ-DDB-INDEX-003 measured
- REQ-DDB-INDEX-004 measured
- REQ-DDB-INDEX-005 measured
- REQ-DDB-INDEX-006 measured
- REQ-DDB-INDEX-007 measured
- REQ-DDB-INDEX-008 measured
- REQ-DDB-INDEX-009 measured
- REQ-DDB-INDEX-010 measured
- REQ-DDB-INDEX-011 measured
- REQ-DDB-MCP-001 measured
- REQ-DDB-MCP-004 measured
- REQ-DDB-PIPE-001 measured
- REQ-DDB-PIPE-003 measured
- REQ-DDB-PIPE-004 measured
- REQ-DDB-PIPE-005 measured
- REQ-DDB-PIPE-006 measured
- REQ-DDB-PIPE-007 measured
- REQ-DDB-PIPE-008 measured
- REQ-DDB-PIPE-009 measured
- REQ-DDB-PIPE-010 measured
- REQ-DDB-PIPE-011 measured
- REQ-DDB-PIPE-012 measured
- REQ-DDB-PIPE-013 measured
- REQ-DDB-PIPE-014 measured
- REQ-DDB-PIPE-015 measured
- REQ-DDB-QUERY-001 measured
- REQ-DDB-QUERY-002 measured
- REQ-DDB-QUERY-003 measured
- REQ-DDB-QUERY-004 measured
- REQ-DDB-QUERY-006 measured
- REQ-DDB-QUERY-009 measured
- REQ-DDB-QUERY-010 measured
- REQ-DDB-QUERY-011 measured
- REQ-DDB-QUERY-012 measured
- REQ-DDB-QUERY-013 inferred
- REQ-DDB-SCHEMA-001 measured
- REQ-DDB-SCHEMA-002 measured
- REQ-DDB-SCHEMA-003 measured
- REQ-DDB-SCHEMA-004 measured
- REQ-DDB-SCHEMA-005 measured
- REQ-DDB-SCHEMA-006 measured
- REQ-DDB-SCHEMA-007 measured
- REQ-DDB-SCHEMA-009 measured
- REQ-DDB-SCHEMA-011 measured
- REQ-DDB-SCHEMA-012 measured
- REQ-DDB-SCHEMA-013 measured
- REQ-DDB-SCHEMA-014 measured
- REQ-DDB-SCHEMA-015 measured