Skip to content

Commit 031ec50

Browse files
committed
Auto merge of #103795 - thomcc:untest, r=Mark-Simulacrum
Include both benchmarks and tests in the numbers given to `TeFiltered{,Out}` Fixes #103794 `#[bench]` is broken on nightly without this, sadly. It apparently has no test coverage. In addition to manually testing, I've added a run-make smokecheck for this (which would have caught the issue), but it would be nice to have a better way to test, err, libtest. For now we should get this in ASAP IMO
2 parents 52c7d2f + 7f00630 commit 031ec50

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/src/lib.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,9 @@ impl FilteredTests {
246246
}));
247247
self.add_test(desc, testfn);
248248
}
249+
fn total_len(&self) -> usize {
250+
self.tests.len() + self.benchs.len()
251+
}
249252
}
250253

251254
pub fn run_tests<F>(
@@ -303,13 +306,13 @@ where
303306
};
304307
}
305308

306-
let filtered_out = tests_len - filtered.tests.len();
309+
let filtered_out = tests_len - filtered.total_len();
307310
let event = TestEvent::TeFilteredOut(filtered_out);
308311
notify_about_test_event(event)?;
309312

310313
let shuffle_seed = get_shuffle_seed(opts);
311314

312-
let event = TestEvent::TeFiltered(filtered.tests.len(), shuffle_seed);
315+
let event = TestEvent::TeFiltered(filtered.total_len(), shuffle_seed);
313316
notify_about_test_event(event)?;
314317

315318
let concurrency = opts.test_threads.unwrap_or_else(get_concurrency);

0 commit comments

Comments
 (0)