@@ -39,12 +39,27 @@ def save_map(path: Path, entries: dict, *, n_tests: int, git_sha: str, gfortran_
3939 json .dump (payload , f , indent = 2 , sort_keys = True )
4040
4141
42- ALWAYS_RUN_ALL_EXACT = frozenset (["CMakeLists.txt" ])
42+ # Test-definition file: changing it adds/modifies tests, but only the tests it touches
43+ # (their param_hash changes -> not in map -> rung 5 runs them). NOT in ALWAYS_RUN_ALL so a
44+ # test addition doesn't blanket-run the whole suite.
45+ CASES_PY = "toolchain/mfc/test/cases.py"
46+
47+ ALWAYS_RUN_ALL_EXACT = frozenset (
48+ [
49+ "CMakeLists.txt" ,
50+ # Toolchain infra that affects EVERY test's generation/execution -> run all.
51+ "toolchain/mfc/test/case.py" , # TestCase: how a case runs
52+ "toolchain/mfc/test/test.py" , # the test runner
53+ "toolchain/mfc/test/coverage.py" , # the selector itself
54+ "toolchain/mfc/test/coverage_build.py" , # the map collector
55+ ]
56+ )
4357ALWAYS_RUN_ALL_PREFIXES = (
4458 "src/common/include/" , # GPU/Fypp macro & include files (CPU map can't line-attribute)
4559 "toolchain/cmake/" , # build system
4660 "toolchain/mfc/params/" , # parameter codegen -> emits Fortran broadly
4761 "toolchain/bootstrap/" , # build/run scripts
62+ "toolchain/mfc/run/" , # .inp generation / case dicts -> affects every test's input
4863)
4964
5065
@@ -102,8 +117,11 @@ def select_tests(cases, coverage_map, changed_files):
102117 return list (cases ), [], "rung3: hand-written .f90/.f changed"
103118
104119 changed_fpp = {f for f in changed_files if f .endswith (".fpp" )}
105- if not changed_fpp :
106- return [], list (cases ), "rung7: no Fortran source changed"
120+ # Skip-all only when nothing test-relevant changed. If cases.py changed (no .fpp), fall
121+ # through to per-test: new/modified tests have a fresh param_hash absent from the map and
122+ # run via rung 5; unchanged tests have no .fpp overlap and are skipped.
123+ if not changed_fpp and CASES_PY not in changed_files :
124+ return [], list (cases ), "rung7: no Fortran or test-definition change"
107125
108126 # Rung 4: a changed .fpp that no test covers -> run all (GPU-only blind spot).
109127 covered = _covered_fpp (coverage_map )
0 commit comments