test_a_declared_doxyfile_is_reachable_and_a_missing_one_refuses

Tests › tests/test_declaration.py

passed Passed in the packaged run.

What this test is for

Why it exists

gh#420. `discover_doxyfile` matches the NAME `Doxyfile` in the repo root, `docs/` and `doc/` and refuses to guess further, because it was once caught selecting a test FIXTURE's Doxyfile to index a whole project. Mbed-TLS ships `doxygen/mbedtls.doxyfile` — wrong directory AND wrong filename — so it was unreachable from discovery, and until this section existed there was no way to state it either. `--doxyfile` could name it on one command line, which is the shape the mandate calls not-a-declaration: unrecorded, unreplayed, and unreachable from the MCP surface.

Verifies REQ-DDB-CONFIG-001

Given

  1. doxydir = tmp_path / "doxygen"
  2. doxydir.mkdir()
2 more
  1. (doxydir / "mbedtls.doxyfile").write_text( "INPUT = ../include\nFILE_PATTERNS = *.h\n", encoding="utf-8" )
  2. args = SimpleNamespace()
→

When

  1. applied = apply_options(args, {SECTION_DOXYFILE: "doxygen/mbedtls.doxyfile"}, tmp_path)
  2. apply_options(SimpleNamespace(), {SECTION_DOXYFILE: "doxygen/typo.doxyfile"}, tmp_path)
  3. ok = SimpleNamespace()
  4. apply_options(ok, {"requirements": "nope.yaml"}, tmp_path)
→

Then

  1. ✓ KNOWN_SECTIONS contains SECTION_DOXYFILE
  2. ✓ applied equals [SECTION_DOXYFILE]
  3. ✓ Path(args.doxyfile) equals doxydir / "mbedtls.doxyfile"
  4. ✓ raises BuildOptionError
  5. ✓ str(refusal.value) contains "typo.doxyfile"
  6. ✓ apply_options(ok, {"requirements": "nope.yaml"}, tmp_path) equals ["requirements"]

tests/test_declaration.py:378 · its file's page

What it checks (5)

  1. assert SECTION_DOXYFILE in KNOWN_SECTIONS, "declarable, or the document-level gate refuses it" not attributed
  2. assert applied == [SECTION_DOXYFILE] observes apply_options via applied
  3. assert Path(args.doxyfile) == doxydir / "mbedtls.doxyfile" not attributed
  4. assert "typo.doxyfile" in str(refusal.value) not attributed
  5. assert apply_options(ok, {"requirements": "nope.yaml"}, tmp_path) == ["requirements"] observes apply_options

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_doxyfile_is_reachable_and_a_missing_one_refuses→apply_options

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)

requirementlinked byimplementers exercised
REQ-DDB-CONFIG-001catalogunknown