test_declared_predefined_cannot_inject_a_directive

Tests › tests/test_doxyfile_injection.py

passed Passed in the packaged run.

What this test is for

Why it exists

THE THIRD CHANNEL, and the one the previous fix missed entirely. `predefined` is concatenated AFTER the forced block, so anything it smuggles wins — and it comes from the TARGET REPO's own `.clew.yaml`, parsed by `_declared_macros` with only `str(v).strip()`, so an interior newline survives and a trailing `#` defeats the quoting.

Verifies REQ-DDB-PIPE-014

Given

  1. doxyfile = tmp_path / "Doxyfile"
  2. doxyfile.write_text("PROJECT_NAME = probe\nINPUT = .\n", encoding="utf-8")
  3. hostile = "PREDEFINED += X=1\nINPUT_FILTER = /bin/sh -c 'pwn' #\n"
→

When

  1. text = _build_doxyfile_content(doxyfile, None, None, False, tmp_path, hostile)
  2. for value in _assignments(text, "INPUT_FILTER"): assert not value, ( f"a declared predefined macro injected INPUT_FILTER = {value!r}, which doxygen " f"runs as a command over every input file" )
→

Then

  1. ✓ text does not contain "/bin/sh"

tests/test_doxyfile_injection.py:231 · its file's page

What it checks (2)

  1. assert not value, ( f"a declared predefined macro injected INPUT_FILTER = {value!r}, which doxygen " f"runs as a command over every input file" ) not attributed
  2. assert "/bin/sh" not in text, "the injected command survived into the configuration" observes _build_doxyfile_content via text

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_declared_predefined_cannot_inject_a_directive→_build_doxyfile_content→_assignments

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_declared_predefined_cannot_inject_a_directive · 2 checks_build_doxyfile_contentREQ-DDB-INDEX-001 · measured_build_doxyfile_contentextra_input_clears_excludeREQ-DDB-PIPE-003 · measured

Requirements it verifies (1)

requirementlinked byimplementers exercised
REQ-DDB-PIPE-014catalogunknown
Also reaches 2 requirements

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