test_auto_discovery_ignores_a_mock_config_header

Tests › tests/test_preprocessor.py

passed Passed in the packaged run.

What this test is for

Why it exists

Many Kconfig projects ship a hand-written mock config header for unit tests. Discovering it would index a configuration NOBODY SHIPS, wearing the authority of a recorded declaration — so no conventional location lies under a test directory, and a `*_config.h` glob (which gh#17 floats) is deliberately absent for the same reason.

Given

  1. root = tmp_path / "repo"
  2. (root / "tests" / "include").mkdir(parents=True)
2 more
  1. mock = root / "tests" / "include" / "mock_config.h"
  2. mock.write_text("#define MOCK_ONLY 1\n", encoding="utf-8")
→

When

  1. discovered = resolve_preprocessor( root, {SECTION_PREPROCESSOR: {"config_header": CONFIG_HEADER_AUTO}} )
  2. named = resolve_preprocessor( root, {SECTION_PREPROCESSOR: {"config_header": "tests/include/mock_config.h"}} )
→

Then

  1. ✓ discovered.macros equals ()
  2. ✓ named.macros equals ('"MOCK_ONLY=1"',)

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

What it checks (2)

  1. assert discovered.macros == (), "discovery reached a mock config header" observes resolve_preprocessor via discovered
  2. assert named.macros == ('"MOCK_ONLY=1"',), "an explicitly named header must be honoured" observes resolve_preprocessor via named

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_auto_discovery_ignores_a_mock_config_header→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_auto_discovery_ignores_a_mock_config_header · 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.