test_discover_doxyfile_refuses_to_guess_among_strays

Tests › tests/test_build_docs_db.py

passed Passed in the packaged run.

What this test is for

Why it exists

#55, found by dogfooding clew on itself. discover_doxyfile used to fall back to sorted(repo.glob("*/Doxyfile"))[0] — ANY subdirectory, picked alphabetically. On clew that selected sample/Doxyfile, the demobot TEST FIXTURE, to index the whole project, and ran doxygen with cwd=sample/.

Verifies REQ-DDB-PIPE-001 REQ-DDB-PIPE-010

Given

  1. repo = tmp_path / "repo"
  2. (repo / "sample").mkdir(parents=True)
  3. (repo / "sample" / "Doxyfile").write_text("PROJECT_NAME = fixture\n")
→

When

  1. discover_doxyfile(repo)
  2. (repo / "docs").mkdir()
  3. (repo / "docs" / "Doxyfile").write_text("PROJECT_NAME = real\n")
  4. (repo / "Doxyfile").write_text("PROJECT_NAME = root\n")
→

Then

  1. ✓ discover_doxyfile(repo) is None
  2. ✓ discover_doxyfile(repo) equals repo / "docs" / "Doxyfile"
  3. ✓ discover_doxyfile(repo) equals repo / "Doxyfile"

tests/test_build_docs_db.py:2047 · its file's page

What it checks (3)

  1. assert discover_doxyfile(repo) is None, "a fixture Doxyfile must not be adopted" observes discover_doxyfile
  2. assert discover_doxyfile(repo) == repo / "docs" / "Doxyfile" observes discover_doxyfile
  3. assert discover_doxyfile(repo) == repo / "Doxyfile" observes discover_doxyfile

Where the product reaches it

  • main → init_main → diagnose → _check_indexable → discover_doxyfile (flow)

Call flow

test_discover_doxyfile_refuses_to_guess_among_strays→discover_doxyfile

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_discover_doxyfile_refuses_to_guess_among_strays · 3 checksdiscover_doxyfileREQ-DDB-INDEX-001 · measured

Requirements it verifies (2)

requirementlinked byimplementers exercised
REQ-DDB-PIPE-001catalogunknown
REQ-DDB-PIPE-010catalogunknown
Also reaches 1 requirement

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