test_gate_counts_reach_the_symbol_rows

Tests › tests/test_kconfig.py

passed Passed in the packaged run.

What this test is for

Why it exists

A symbol that gates nothing must arrive as 0 rather than as an absence a caller has to interpret.

Given

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

When

  1. model = import_kconfig(db, repo, None)
  2. import_kconfig_gates(db, repo)
  3. write_build_signature(db, kconfig=model.as_meta())
  4. by_name = {s.name: s for s in kconfig_space(db).symbols}
→

Then

  1. ✓ by_name["WIDGET_MOTOR_BETA"].gate_count equals 1
  2. ✓ by_name["WIDGET_MOTOR_NAME"].gate_count equals 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.

clew — `main` (clew/cli.py) · 24 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:404 · its file's page

What it checks (2)

  1. assert by_name["WIDGET_MOTOR_BETA"].gate_count == 1 observes kconfig_space via by_name
  2. assert by_name["WIDGET_MOTOR_NAME"].gate_count == 0 observes kconfig_space via by_name

Where the product reaches it

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

Call flow

test_gate_counts_reach_the_symbol_rows→_db_with_paths→import_kconfig→import_kconfig_gates→write_build_signature→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_gate_counts_reach_the_symbol_rows · 2 checksimport_kconfig_gatesdeclared_macro_namesbare_macro_namesREQ-DDB-CONFIG-004 · measuredimport_kconfigREQ-DDB-CONFIG-005 · measuredwrite_build_signatureREQ-DDB-CONFIG-006 · measuredwrite_build_signatureREQ-DDB-CONFIG-007 · measuredimport_kconfig_gatesrun_harvestREQ-DDB-PIPE-003 · measuredwrite_build_signatureREQ-DDB-PIPE-005 · 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 · inferredimport_kconfigload_kconfig_served_parse_errorREQ-DDB-PIPE-014 · measuredkconfig_spaceconnectREQ-DDB-QUERY-001 · measuredkconfig_spacetable_existsREQ-DDB-QUERY-003 · measured

and 4 more requirement paths, listed below.

Also reaches 17 requirements

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