test_doxygen_crash_diagnostics.py

tests/test_doxygen_crash_diagnostics.py

A doxygen that crashes must leave the user something to act on.

test_a_doxygen_crash_is_not_reported_as_a_timeout

None test_doxygen_crash_diagnostics.test_a_doxygen_crash_is_not_reported_as_a_timeout(Path tmp_path, pytest.MonkeyPatch monkeypatch, pytest.LogCaptureFixture caplog)

A crash is not reported as a timeout, and vice versa.

tests/test_doxygen_crash_diagnostics.py:136

Show on the map →

Called by none

Calls _crash_log

Checks

  • assert "did not finish" not in errors, f"a crash was reported as a timeout: {errors!r}"
  • assert "134" in errors, f"the exit status was lost: {errors!r}"

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-CLI-002inferredtest_a_doxygen_crash_is_not_reported_as_a_timeout → _crash_log → run_doxygen → doxygen_supports_sqlite3
REQ-DDB-INDEX-001measuredtest_a_doxygen_crash_is_not_reported_as_a_timeout → _crash_log → run_doxygen
REQ-DDB-PIPE-003measuredtest_a_doxygen_crash_is_not_reported_as_a_timeout → _crash_log → run_doxygen → _build_doxyfile_content → extra_input_clears_exclude
REQ-DDB-PIPE-006measuredtest_a_doxygen_crash_is_not_reported_as_a_timeout → _crash_log → run_doxygen → clean_subprocess_env
Source · 10 lines
def test_a_doxygen_crash_is_not_reported_as_a_timeout(
    tmp_path: Path, monkeypatch: pytest.MonkeyPatch, caplog: pytest.LogCaptureFixture
) -> None:
    """@brief The crash branch keeps its own wording.
    @return None.
    @version 1
    """
    errors = _crash_log(tmp_path, monkeypatch, caplog)
    assert "did not finish" not in errors, f"a crash was reported as a timeout: {errors!r}"
    assert "134" in errors, f"the exit status was lost: {errors!r}"

1 more lines, not shown

Activity · 3 steps
lines 143–143errors = _crash_log(tmp_path, monkeypatch, caplog)lines 144–144assert "did not finish" not in errors, f"a crash was reported as a timeout: {errors!r}"lines 145–145assert "134" in errors, f"the exit status was lost: {errors!r}"

test_a_doxygen_crash_reports_how_many_files_it_parsed

None test_doxygen_crash_diagnostics.test_a_doxygen_crash_reports_how_many_files_it_parsed(Path tmp_path, pytest.MonkeyPatch monkeypatch, pytest.LogCaptureFixture caplog)

The crash report says how much doxygen was given.

tests/test_doxygen_crash_diagnostics.py:116

Show on the map →

Called by none

Calls _crash_log

Checks

  • assert f"{_PARSED} file" in errors, f"no input size in the crash report: {errors!r}"
  • assert f"{_PARSED * 2} file" not in errors, f"the file count was doubled: {errors!r}"

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-CLI-002inferredtest_a_doxygen_crash_reports_how_many_files_it_parsed → _crash_log → run_doxygen → doxygen_supports_sqlite3
REQ-DDB-INDEX-001measuredtest_a_doxygen_crash_reports_how_many_files_it_parsed → _crash_log → run_doxygen
REQ-DDB-PIPE-003measuredtest_a_doxygen_crash_reports_how_many_files_it_parsed → _crash_log → run_doxygen → _build_doxyfile_content → extra_input_clears_exclude
REQ-DDB-PIPE-006measuredtest_a_doxygen_crash_reports_how_many_files_it_parsed → _crash_log → run_doxygen → clean_subprocess_env
Source · 17 lines
def test_a_doxygen_crash_reports_how_many_files_it_parsed(
    tmp_path: Path, monkeypatch: pytest.MonkeyPatch, caplog: pytest.LogCaptureFixture
) -> None:
    """THE INPUT SIZE IS THE USUAL CAUSE. A doxygen that dies on a tree nobody meant to hand it
    is the common case, and "it got through N files" is what tells the reader to check scope
    rather than file a doxygen bug. Counted from `Parsing file` lines ONLY, because the binary
    prints two lines per file and a doubled count would point the reader at the wrong size.

    @brief The parsed-file count is in the error.
    @return None.
    @version 1
    """
    errors = _crash_log(tmp_path, monkeypatch, caplog)
    assert f"{_PARSED} file" in errors, f"no input size in the crash report: {errors!r}"
    assert f"{_PARSED * 2} file" not in errors, f"the file count was doubled: {errors!r}"

Activity · 3 steps
lines 128–128errors = _crash_log(tmp_path, monkeypatch, caplog)lines 129–129assert f"{_PARSED} file" in errors, f"no input size in the crash report: {errors!r}"lines 130–130assert f"{_PARSED * 2} file" not in errors, f"the file count was doubled: {errors!r}"

test_a_doxygen_crash_reports_what_doxygen_said

None test_doxygen_crash_diagnostics.test_a_doxygen_crash_reports_what_doxygen_said(Path tmp_path, pytest.MonkeyPatch monkeypatch, pytest.LogCaptureFixture caplog)

The crash message itself reaches the user.

tests/test_doxygen_crash_diagnostics.py:102

Show on the map →

Called by none

Calls _crash_log

Checks

  • assert _CRASH in errors, f"the crash message was discarded; the user saw only: {errors!r}"

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-CLI-002inferredtest_a_doxygen_crash_reports_what_doxygen_said → _crash_log → run_doxygen → doxygen_supports_sqlite3
REQ-DDB-INDEX-001measuredtest_a_doxygen_crash_reports_what_doxygen_said → _crash_log → run_doxygen
REQ-DDB-PIPE-003measuredtest_a_doxygen_crash_reports_what_doxygen_said → _crash_log → run_doxygen → _build_doxyfile_content → extra_input_clears_exclude
REQ-DDB-PIPE-006measuredtest_a_doxygen_crash_reports_what_doxygen_said → _crash_log → run_doxygen → clean_subprocess_env
Source · 11 lines
def test_a_doxygen_crash_reports_what_doxygen_said(
    tmp_path: Path, monkeypatch: pytest.MonkeyPatch, caplog: pytest.LogCaptureFixture
) -> None:
    """@brief The line saying what went wrong is not discarded.
    @return None.
    @version 1
    """
    errors = _crash_log(tmp_path, monkeypatch, caplog)
    assert _CRASH in errors, f"the crash message was discarded; the user saw only: {errors!r}"

Activity · 2 steps
lines 109–109errors = _crash_log(tmp_path, monkeypatch, caplog)lines 110–110assert _CRASH in errors, f"the crash message was discarded; the user saw only: {errors!r}"