test_doxygen_pipes.py

tests/test_doxygen_pipes.py

The doxygen spawn must service both pipes at once, and must not wait forever.

test_the_generated_config_exceeds_a_pipe_buffer

None test_doxygen_pipes.test_the_generated_config_exceeds_a_pipe_buffer(Path tmp_path)

The generated config really is larger than a pipe buffer.

tests/test_doxygen_pipes.py:42

Checks

  • assert len(content) > 65536, (f"the generated config is only {len(content)} bytes, so this test no longer demonstrates " f"the condition the writer thread exists for. If INPUT stopped being written explicitly, " f"re-justify the thread rather than deleting this test." )

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-INDEX-001measuredtest_the_generated_config_exceeds_a_pipe_buffer → _build_doxyfile_content
REQ-DDB-PIPE-003measuredtest_the_generated_config_exceeds_a_pipe_buffer → _build_doxyfile_content → extra_input_clears_exclude
Source · 26 lines
def test_the_generated_config_exceeds_a_pipe_buffer(tmp_path: Path) -> None:
    """THE PREMISE OF THE WHOLE BUG, PINNED. If the config were always small the write-then-read
    ordering would have been harmless, and someone reading the fix later would reasonably ask why
    the extra thread exists. It exists because this number is bigger than 64 KiB.

    Asserted as an inequality against the buffer size rather than as an exact byte count, which
    would be a brittle restatement of the template.

    @brief A realistic INPUT list produces a config larger than 64 KiB.
    @return None.
    @version 1
    """
    doxyfile = tmp_path / "Doxyfile"
    doxyfile.write_text("PROJECT_NAME = t\nINPUT =\n", encoding="utf-8")
    ## Representative of a mid-size repo; clew lists every indexed file explicitly.
    files = [str(tmp_path / f"src/mod_{i}/file_{i}.c") for i in range(4000)]

    content = dox._build_doxyfile_content(doxyfile, files, [], True, tmp_path / "out", "")

    assert len(content) > 65536, (
        f"the generated config is only {len(content)} bytes, so this test no longer demonstrates "
        f"the condition the writer thread exists for. If INPUT stopped being written explicitly, "
        f"re-justify the thread rather than deleting this test."
    )

Activity · 5 steps
lines 54–54doxyfile = tmp_path / "Doxyfile"lines 55–55doxyfile.write_text("PROJECT_NAME = t\nINPUT =\n", encoding="utf-8")lines 57–57files = [str(tmp_path / f"src/mod_{i}/file_{i}.c") for i in range(4000)]lines 59–59content = dox._build_doxyfile_content(doxyfile, files, [], True, tmp_path / "out", "")lines 61–65assert len(content) > 65536, ( f"the generated config is only {len(content)} bytes, so this test no longer demonstrates " f"the condition the writer thread exists for. If INPUT stopped being written explicitly, " f"re-justify the thread rather than deleting this test." )