test_declared_predefined_cannot_inject_a_directive¶
Tests › tests/test_doxyfile_injection.py
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
doxyfile = tmp_path / "Doxyfile"doxyfile.write_text("PROJECT_NAME = probe\nINPUT = .\n", encoding="utf-8")hostile = "PREDEFINED += X=1\nINPUT_FILTER = /bin/sh -c 'pwn' #\n"
When
text = _build_doxyfile_content(doxyfile, None, None, False, tmp_path, hostile)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
- ✓ text does not contain "/bin/sh"
tests/test_doxyfile_injection.py:231 · its file's page
What it checks (2)
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 attributedassert "/bin/sh" not in text, "the injected command survived into the configuration"observes_build_doxyfile_contentviatext
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.
Requirements it verifies (1)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-PIPE-014 | catalog | unknown |
Also reaches 2 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-INDEX-001 measured
- REQ-DDB-PIPE-003 measured