test_gcov_json_gz_relativises_absolute_paths

Tests › tests/test_wiki_imports.py

passed Passed in the packaged run.

What this test is for

Why it exists

gcov --json-format output (gzipped) with an absolute file path.

Verifies REQ-DDB-WIKI-010 REQ-DDB-WIKI-016

Given

  1. doc = { "current_working_directory": str(tmp_path / "build"), "files": [ { "file": str(tmp_path / "src" / "a.c"), "lines": [{"line_number": 10, "count": 4}, {"line_number": 11, "count": 0}], } ], }
  2. report = tmp_path / "a.gcov.json.gz"
  3. report.write_bytes(gzip.compress(json.dumps(doc).encode()))
→

When

  1. parse_gcov([report], tmp_path)
→

Then

  1. ✓ parse_gcov([report], tmp_path) equals {"src/a.c": {10: 4, 11: 0}}

What it exercises

The parts of the system's flows this test ran, measured by per-test coverage: lit steps ran in this test, dimmed ones did not, and ▶ marks where the test called in. Each title opens the whole flow with these steps lit.

Build this wiki from the index · 1 of 400 steps

… 131 earlier steps

callercallercallercallerother filesother filesother filesother filesopt (line 200)optloop (line 259)loopelif (line 264)elifopt (line 202)optbuild_wiki132–133. parse_contexts → _contexts_from_lcov132_contexts_from_lcov +1 more134. _text → check_report_size134check_report_size▶ test enters135. _contexts_from_lcov → _relative135_relative136. parse_contexts → _contexts_from_data_file136_contexts_from_data_file

… 264 later steps

tests/test_wiki_imports.py:62 · its file's page

What it checks (1)

  1. assert parse_gcov([report], tmp_path) == {"src/a.c": {10: 4, 11: 0}} observes parse_gcov

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_gcov_json_gz_relativises_absolute_paths→parse_gcov

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_gcov_json_gz_relativises_absolute_paths · 1 checksparse_gcovREQ-DDB-WIKI-009 · measured

Requirements it verifies (2)

requirementlinked byimplementers exercised
REQ-DDB-WIKI-010catalogunknown
REQ-DDB-WIKI-016catalogunknown
Also reaches 1 requirement

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