test_variables_are_recorded_not_resolved¶
Tests › tests/test_cmake_generation.py
What this test is for
Why it exists
`${CMAKE_CURRENT_BINARY_DIR}/error.c` depends on the configure step this harvest never ran. Resolving it would publish a path that may not exist; dropping it would lose the only name the mark wants. So both are kept: the literal, and the basename.
Given
- —
When
rule = harvest_generation(_tree(GEN), GEN)["generated"][0]out = rule["outputs"][0]glob = next(d for d in rule["depends"] if "error_headers" in d["literal"])
Then
- ✓ out["literal"] equals "${CMAKE_CURRENT_BINARY_DIR}/error.c"
- ✓ out["name"] equals "error.c"
- ✓ glob["name"] equals ""
- ✓ glob["unresolved"] is True
tests/test_cmake_generation.py:145 · its file's page
What it checks (4)
assert out["literal"] == "${CMAKE_CURRENT_BINARY_DIR}/error.c", outnot attributedassert out["name"] == "error.c", outnot attributedassert glob["name"] == "", f"a bare variable has no filename and must not be given one: {glob}"not attributedassert glob["unresolved"] is True, globnot 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.
Also reaches 1 requirement
Its run touches their code; that is reach, not proof.
- REQ-DDB-PIPE-012 measured