test_a_declared_config_header_outside_the_repository_is_refused

Tests › tests/test_preprocessor.py

passed Passed in the packaged run.

What this test is for

Why it exists

H4's second site. `preprocessor.config_header` is repo-relative by contract and was resolved without containment, so a declared — or MCP-STATED — `/etc/hostname` or `../outside.h` was read and its `#define`s became this index's macro set. The macro values then reach the Doxyfile's PREDEFINED, which is how a read turns into content an agent is served as the repository's own configuration.

Given

  1. outside = tmp_path / "outside.h"
  2. outside.write_text("#define SENTINEL_LEAKED 1\n", encoding="utf-8")
2 more
  1. root = tmp_path / "repo"
  2. root.mkdir()
→

When

  1. for declared in (str(outside), "../outside.h"): config = resolve_preprocessor(root, {SECTION_PREPROCESSOR: {"config_header": declared}}) assert config.macros == (), ( f"{declared!r} escapes the repository; got macros {config.macros}" ) assert config.config_header is None, ( f"a refused header must not be recorded as honoured; got {config.config_header}" )
→

Then

  1. —

tests/test_preprocessor.py:865 · its file's page

What it checks (2)

  1. assert config.macros == (), ( f"{declared!r} escapes the repository; got macros {config.macros}" ) observes resolve_preprocessor via config
  2. assert config.config_header is None, ( f"a refused header must not be recorded as honoured; got {config.config_header}" ) observes resolve_preprocessor via config

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_declared_config_header_outside_the_repository_is_refused→resolve_preprocessor

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_declared_config_header_outside_the_repository_is_refused · 2 checksresolve_preprocessorREQ-DDB-CONFIG-004 · measuredresolve_preprocessor_resolve_config_header_named_config_headerwithin_repoREQ-DDB-PIPE-014 · measured
Also reaches 2 requirements

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