test_a_directory_reference_yields_no_filename

Tests › tests/test_cmake_generation.py

passed Passed in the packaged run.

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

  1. src = b""" add_custom_command( OUTPUT ${BIN}/ok.c COMMAND tool ${SRC}/.. ${SRC}/. ${SRC}/dir/ DEPENDS ${SRC}/.. ) """
→

When

  1. rule = harvest_generation(_tree(src), src)["generated"][0]
→

Then

  1. ✓ [c["name"] for c in rule["command"] if c["name"]] equals ["tool"]
  2. ✓ [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)

  1. assert [c["name"] for c in rule["command"] if c["name"]] == ["tool"], rule["command"] observes harvest_generation via rule
  2. assert [d["name"] for d in rule["depends"] if d["name"]] == [], rule["depends"] observes harvest_generation via rule

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_a_directory_reference_yields_no_filename→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_a_directory_reference_yields_no_filename · 2 checksharvest_generationREQ-DDB-PIPE-012 · measured
Also reaches 1 requirement

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