From ba9a45aa01dbb84fd8383750d7fed0d108c9aa09 Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Sun, 20 Jul 2025 10:22:22 -0500 Subject: [PATCH] runners: Don't include case-less suites in -Y/--summary Note --list-suite-paths was already skipping case-less suites! I think only -Y/--summary was an outlier. This is consistent with test.py's matching of suite ids when no cases are found (test_runner itself doesn't really care, it just reports no matching cases). Though we do still compile case-less suites and include them in the test_suites array, which may be confusing in the future. --- runners/bench_runner.c | 8 ++++++++ runners/test_runner.c | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/runners/bench_runner.c b/runners/bench_runner.c index d29e8538..a9da90a7 100644 --- a/runners/bench_runner.c +++ b/runners/bench_runner.c @@ -863,6 +863,8 @@ static void summary(void) { for (size_t i = 0; i < bench_suite_count; i++) { bench_define_suite(&bench_ids[t], bench_suites[i]); + size_t cases_ = 0; + for (size_t j = 0; j < bench_suites[i]->case_count; j++) { // does neither suite nor case name match? if (bench_ids[t].name && !( @@ -874,6 +876,7 @@ static void summary(void) { } cases += 1; + cases_ += 1; case_forperm( &bench_ids[t], bench_suites[i], @@ -882,6 +885,11 @@ static void summary(void) { &perms); } + // no benches found? + if (!cases_) { + continue; + } + suites += 1; flags |= bench_suites[i]->flags; } diff --git a/runners/test_runner.c b/runners/test_runner.c index 7b4c325c..3b948d2d 100644 --- a/runners/test_runner.c +++ b/runners/test_runner.c @@ -833,6 +833,8 @@ static void summary(void) { for (size_t i = 0; i < test_suite_count; i++) { test_define_suite(&test_ids[t], test_suites[i]); + size_t cases_ = 0; + for (size_t j = 0; j < test_suites[i]->case_count; j++) { // does neither suite nor case name match? if (test_ids[t].name && !( @@ -844,6 +846,7 @@ static void summary(void) { } cases += 1; + cases_ += 1; case_forperm( &test_ids[t], test_suites[i], @@ -852,6 +855,11 @@ static void summary(void) { &perms); } + // no tests found? + if (!cases_) { + continue; + } + suites += 1; flags |= test_suites[i]->flags; }