test_a_directory_reference_yields_no_filename¶
Tests › tests/test_cmake_generation.py
What this test is for
Why it exists
`${CMAKE_CURRENT_SOURCE_DIR}/..` has the basename `..`, which named a generated file in the first run over the real tree. `.` and `..` are directory references and a trailing slash means the argument is a directory, so none of them is a filename.
Given
src = b""" add_custom_command( OUTPUT ${BIN}/ok.c COMMAND tool ${SRC}/.. ${SRC}/. ${SRC}/dir/ DEPENDS ${SRC}/.. ) """
When
rule = harvest_generation(_tree(src), src)["generated"][0]
Then
- ✓ [c["name"] for c in rule["command"] if c["name"]] equals ["tool"]
- ✓ [d["name"] for d in rule["depends"] if d["name"]] equals []
tests/test_cmake_generation.py:267 · its file's page
What it checks (2)
assert [c["name"] for c in rule["command"] if c["name"]] == ["tool"], rule["command"]observesharvest_generationviaruleassert [d["name"] for d in rule["depends"] if d["name"]] == [], rule["depends"]observesharvest_generationviarule
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