test_locations_are_repo_relative_and_point_at_the_declaring_file

Tests › tests/test_kconfig.py

passed Passed in the packaged run.

What this test is for

Why it exists

A symbol declared in a `source`d file must report THAT file, not the top-level one — otherwise `file:line` cannot be opened. And repo-relative, always.

Verifies REQ-DDB-PIPE-007 REQ-DDB-QUERY-006

Given

  1. —
→

When

  1. model = load_kconfig(discover_kconfig(repo), repo)
  2. beta = next(s for s in model.symbols if s.name == "WIDGET_MOTOR_BETA")
→

Then

  1. ✓ beta.file_path equals "Kconfig.motor"
  2. ✓ Path(beta.file_path).is_absolute() is false
  3. ✓ beta.line is greater than 0

tests/test_kconfig.py:232 · its file's page

What it checks (3)

  1. assert beta.file_path == "Kconfig.motor" not attributed
  2. assert not Path(beta.file_path).is_absolute() not attributed
  3. assert beta.line > 0 not attributed

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_locations_are_repo_relative_and_point_at_the_declaring_file→load_kconfig→discover_kconfig

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_locations_are_repo_relative_and_point_at_the_declaring_file · 3 checksdiscover_kconfigREQ-DDB-CONFIG-005 · measuredload_kconfig_served_parse_errorREQ-DDB-PIPE-014 · measured

Requirements it verifies (2)

requirementlinked byimplementers exercised
REQ-DDB-PIPE-007catalogunknown
REQ-DDB-QUERY-006catalogunknown
Also reaches 2 requirements

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