upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/tools/cf_diff.py
diff options
context:
space:
mode:
authortedin7 <tommasoderosa94@gmail.com>2026-11-23 02:51:23 +0100
committertedin7 <tommasoderosa94@gmail.com>2026-11-23 02:51:23 +0100
commit50fe243d3e4eba57b65b99df1e7d5a0c7153de33 (patch)
tree39afe80531ee848ef14ff9fab69a41f171ae265a /tools/cf_diff.py
parent6caeae4ac6469f03f419f7623e4610fb1d69821d (diff)
fix: cf_diff --program exits 2 when the program was skipped, like the suite (review)
Diffstat (limited to 'tools/cf_diff.py')
-rw-r--r--tools/cf_diff.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/cf_diff.py b/tools/cf_diff.py
index 4c1207069..9d732ea36 100644
--- a/tools/cf_diff.py
+++ b/tools/cf_diff.py
@@ -630,10 +630,12 @@ def main(argv=None):
630 structured = not a.dispatch_loop 630 structured = not a.dispatch_loop
631 if a.program is not None: 631 if a.program is not None:
632 rc = 0 632 rc = 0
633 matched = 0
633 for wave in waves: 634 for wave in waves:
634 body = program_for(a.seed, a.program, wave, a.depth) 635 body = program_for(a.seed, a.program, wave, a.depth)
635 status, detail = run_case(f"ps_cf_{a.program:04d}_w{wave}", body, wave, structured) 636 status, detail = run_case(f"ps_cf_{a.program:04d}_w{wave}", body, wave, structured)
636 print(f"program {a.program} wave{wave}: {status} {detail}") 637 print(f"program {a.program} wave{wave}: {status} {detail}")
638 matched += status == "match"
637 if status == "mismatch": 639 if status == "mismatch":
638 rc = 1 640 rc = 1
639 if a.minimize: 641 if a.minimize:
@@ -641,6 +643,9 @@ def main(argv=None):
641 print("reduced:", run_case("ps_cf_min", body, wave, structured)[1]) 643 print("reduced:", run_case("ps_cf_min", body, wave, structured)[1])
642 if a.show or a.minimize: 644 if a.show or a.minimize:
643 print(listing_text(build(body, wave), f"ps_cf_{a.program:04d}_w{wave}")) 645 print(listing_text(build(body, wave), f"ps_cf_{a.program:04d}_w{wave}"))
646 if not rc and not matched: # same order as the suite: a mismatch (1) outranks "nothing was compared" (2)
647 print("no program ran: every one was skipped")
648 return 2
644 return rc 649 return rc
645 counts, failures = run_suite(a.programs, a.seed, waves, structured, a.depth) 650 counts, failures = run_suite(a.programs, a.seed, waves, structured, a.depth)
646 skips = sum(counts["skip"].values()) 651 skips = sum(counts["skip"].values())