test_the_gate_list_can_be_narrowed_to_one_symbol

Tests › tests/test_kconfig.py

passed Passed in the packaged run.

What this test is for

Why it exists

Accepts the name bare or `CONFIG_`-prefixed, because a caller reading a gate out of source has the prefixed form in front of them and requiring them to strip it produces a confident empty result — the failure gh#31 records for `search`.

Verifies REQ-DDB-CONFIG-005 REQ-DDB-PIPE-014

Given

  1. db = tmp_path / "clew.db"
  2. _db_with_paths(db, ("src/motor.c",))
→

When

  1. import_kconfig_gates(db, repo)
  2. bare = kconfig_space(db, "WIDGET_MOTOR_BETA").gates
  3. prefixed = kconfig_space(db, "CONFIG_WIDGET_MOTOR_BETA").gates
→

Then

  1. ✓ bare equals prefixed
  2. ✓ bare holds
  3. ✓ {g.symbol for g in bare} equals {"WIDGET_MOTOR_BETA"}

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.

clew — `main` (clew/cli.py) · 23 of 400 steps

… 70 earlier steps

command-line usercommand-line usercommand-line usercommand-line userother filesother filesother filesother filesloop (line 134)looploop (line 135)loopopt (line 385)optmain71–72. repo_source_files → _scandir71_scandir +1 more73. _ts_language_for → _grammar_available73_grammar_available74–75. _grammar_available → has_language74has_language +1 more76. _ts_language_for → _try_import_ts_module76_try_import_ts_module77–80. build_context → scope_membership77scope_membership +3 more81. _ast_parse_one_file → _ts_language_for81_ts_language_for▶ test enters82–85. _ast_parse_one_file → _cached_parser82_cached_parser +3 more86–87. _ast_parse_one_file → _disambiguate_header86_disambiguate_header +1 more

… 128 steps between

command-line usercommand-line usercommand-line usercommand-line userclew/query/symbols.pyclew/query/symbols.pyclew/query/symbols.pyclew/query/symbols.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyloop (line 1576)loopmain216. _memberdef_corpora → _expansion_sql216_expansion_sql217. _expansion_sql → has_columns217has_columns218. has_columns → table_exists218table_exists219. _memberdef_corpora → _memberdef_candidates219_memberdef_candidates220. _memberdef_candidates → table_exists220table_exists

… 158 steps between

command-line usercommand-line usercommand-line usercommand-line usercommand-line userclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyother filesother filesother filesother filesother filesloop (line 660)looploop ×2 (line 288)loop ×2main379. _config_found_on_the_wire → _compact_gate_panel379_compact_gate_panel380. corpus_payload → kconfig_space380kconfig_space381. kconfig_space → connect381connect▶ test enters382. kconfig_space → _meta382_meta383. _meta → table_exists383table_exists384. kconfig_space → _symbols384_symbols385. _symbols → table_exists385table_exists386. kconfig_space → table_exists386table_exists387. kconfig_space → _gate_layer_state387_gate_layer_state388. _gate_layer_state → table_exists388table_exists389. kconfig_space → _gate_symbol_names389_gate_symbol_names390. _gate_symbol_names → table_exists390table_exists391. kconfig_space → _gates391_gates392. _gates → table_exists392table_exists393. _gates → _gate_columns393_gate_columns394–395. _gate_columns → has_columns394has_columns ×2396. _gates → _with_defaults396_with_defaults397. _with_defaults → table_exists397table_exists398. _with_defaults → _defaults_for_macros398_defaults_for_macros399. _with_defaults → decided_default399decided_default

… 1 later step

2 more

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

What it checks (2)

  1. assert bare == prefixed observes kconfig_space via bare
  2. assert bare and {g.symbol for g in bare} == {"WIDGET_MOTOR_BETA"} observes kconfig_space via bare

Where the product reaches it

  • main → query_main → _payload → export_search → corpus_payload → kconfig_space (flow)

Call flow

test_the_gate_list_can_be_narrowed_to_one_symbol→_db_with_paths→import_kconfig_gates→kconfig_space

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_the_gate_list_can_be_narrowed_to_one_symbol · 2 checksimport_kconfig_gatesdeclared_macro_namesbare_macro_namesREQ-DDB-CONFIG-004 · measuredimport_kconfig_gatesrun_harvestREQ-DDB-PIPE-003 · measuredimport_kconfig_gatesREQ-DDB-PIPE-007 · measuredimport_kconfig_gatesrun_harvest_harvest_one_file_parseable_fileREQ-DDB-PIPE-011 · measuredimport_kconfig_gates… 4 calls …has_languageREQ-DDB-PIPE-012 · inferredkconfig_spaceconnectREQ-DDB-QUERY-001 · measuredkconfig_spacetable_existsREQ-DDB-QUERY-003 · measuredkconfig_space_gates_with_defaults_in_default_buildREQ-DDB-QUERY-004 · inferredkconfig_spaceREQ-DDB-QUERY-006 · measuredkconfig_space_gates_with_defaultsdecided_defaultREQ-DDB-QUERY-013 · inferredimport_kconfig_gatesensure_kconfig_gates_tableREQ-DDB-SCHEMA-013 · measured

Requirements it verifies (2)

requirementlinked byimplementers exercised
REQ-DDB-CONFIG-005catalogunknown
REQ-DDB-PIPE-014catalogunknown
Also reaches 12 requirements

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