test_a_measured_zero_survives_the_build_signature

Tests › tests/test_kconfig.py

passed Passed in the packaged run.

What this test is for

Why it exists

`write_build_signature` DROPS falsy values, so every count is passed as a STRING: `"0"` is truthy where `0` is not. gh#6 and gh#17 both had to work around this, and forgetting it here would erase exactly the finding that matters — "we found a Kconfig and it declares nothing".

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

Given

  1. root = tmp_path / "empty_space"
  2. root.mkdir()
3 more
  1. (root / KCONFIG_NAME).write_text("# a comment and nothing else\n", encoding="utf-8")
  2. db = tmp_path / "clew.db"
  3. _db_with_paths(db, ())
→

When

  1. model = import_kconfig(db, root, None)
  2. write_build_signature(db, kconfig=model.as_meta())
  3. conn = sqlite3.connect(str(db))
2 more
  1. meta = dict(conn.execute("SELECT key, value FROM build_meta"))
  2. conn.close()
→

Then

  1. ✓ model.found is True
  2. ✓ model.symbols equals ()
  3. ✓ meta["kconfig.symbol_count"] equals "0"
  4. ✓ meta["kconfig.source"] equals SOURCE_ROOT

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

What it checks (4)

  1. assert model.found is True observes import_kconfig via model
  2. assert model.symbols == () observes import_kconfig via model
  3. assert meta["kconfig.symbol_count"] == "0", "the measured zero was dropped as falsy" not attributed
  4. assert meta["kconfig.source"] == SOURCE_ROOT 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_a_measured_zero_survives_the_build_signature→_db_with_paths→import_kconfig→write_build_signature

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_a_measured_zero_survives_the_build_signature · 4 checksimport_kconfigREQ-DDB-CONFIG-005 · measuredwrite_build_signatureREQ-DDB-CONFIG-006 · measuredwrite_build_signatureREQ-DDB-CONFIG-007 · measuredwrite_build_signatureREQ-DDB-PIPE-005 · measuredimport_kconfigload_kconfig_served_parse_errorREQ-DDB-PIPE-014 · measuredimport_kconfigstore_kconfigensure_kconfig_tablesREQ-DDB-SCHEMA-013 · measured

Requirements it verifies (2)

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

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