test_a_custom_command_is_harvested

Tests › tests/test_cmake_generation.py

passed Passed in the packaged run.

What this test is for

Why it exists

The three keyword sections are a FLAT argument list in the grammar, so they are split on the keywords rather than read as structure.

Given

  1. —
→

When

  1. rules = harvest_generation(_tree(GEN), GEN)["generated"]
  2. rule = rules[0]
→

Then

  1. ✓ len(rules) equals 1
  2. ✓ rule["kind"] equals "custom_command"
  3. ✓ rule["line"] equals 4
  4. ✓ [o["name"] for o in rule["outputs"]] equals ["error.c"]
  5. ✓ [c["name"] for c in rule["command"]] contains "generate_errors.pl"
  6. ✓ [d["name"] for d in rule["depends"]] contains "error.fmt"

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

What it checks (6)

  1. assert len(rules) == 1, rules observes harvest_generation via rules
  2. assert rule["kind"] == "custom_command" not attributed
  3. assert rule["line"] == 4, f"the rule's own line, for a reader to go read it: {rule}" not attributed
  4. assert [o["name"] for o in rule["outputs"]] == ["error.c"], rule["outputs"] not attributed
  5. assert "generate_errors.pl" in [c["name"] for c in rule["command"]], rule["command"] not attributed
  6. assert "error.fmt" in [d["name"] for d in rule["depends"]], rule["depends"] 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_a_custom_command_is_harvested→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_custom_command_is_harvested · 6 checksharvest_generationREQ-DDB-PIPE-012 · measured
Also reaches 1 requirement

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