test_variables_are_recorded_not_resolved

Tests › tests/test_cmake_generation.py

passed Passed in the packaged run.

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

  1. —
→

When

  1. rule = harvest_generation(_tree(GEN), GEN)["generated"][0]
  2. out = rule["outputs"][0]
  3. glob = next(d for d in rule["depends"] if "error_headers" in d["literal"])
→

Then

  1. ✓ out["literal"] equals "${CMAKE_CURRENT_BINARY_DIR}/error.c"
  2. ✓ out["name"] equals "error.c"
  3. ✓ glob["name"] equals ""
  4. ✓ glob["unresolved"] is True

tests/test_cmake_generation.py:145 · its file's page

What it checks (4)

  1. assert out["literal"] == "${CMAKE_CURRENT_BINARY_DIR}/error.c", out not attributed
  2. assert out["name"] == "error.c", out not attributed
  3. assert glob["name"] == "", f"a bare variable has no filename and must not be given one: {glob}" not attributed
  4. assert glob["unresolved"] is True, glob 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

test_variables_are_recorded_not_resolved→harvest_generation→_tree

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_variables_are_recorded_not_resolved · 4 checksharvest_generationREQ-DDB-PIPE-012 · measured
Also reaches 1 requirement

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