Testing: parallel auto mode, aligned timings and slowest/failure summaries

This commit is contained in:
faumaray committed 2026-12-04 00:48:10 +03:00
1 parent af8757080f
commit 7f861fa78f
3 files changed
+43 -10

No files matched your search

+10 -5
View File
@@ -177,11 +177,16 @@ namespace Void::Testing
} else if (arg == "--parallel") {
std::string val;
if (need_val(arg, i, val)) {
unsigned parsed = 0;
if (!parse_unsigned_strict(val, parsed)) {
config.parse_error = std::format("Invalid --parallel value: {}", val);
if (val == "auto") {
const unsigned hw = std::thread::hardware_concurrency();
config.parallel_threads = hw == 0 ? 2U : std::min(hw, 64U);
} else {
config.parallel_threads = parsed;
unsigned parsed = 0;
if (!parse_unsigned_strict(val, parsed)) {
config.parse_error = std::format("Invalid --parallel value: {}", val);
} else {
config.parallel_threads = parsed;
}
}
}
} else if (arg == "--help") {
@@ -532,7 +537,7 @@ namespace Void::Testing
#ifdef VOID_HAS_ASYNC
<< " " << opt("--parallel <n>")
<< Void::Testing::Detail::Color::apply(dim,
"Run tests across n threads (no crash detection)")
"Run tests across n threads, or 'auto' for the CPU count (no crash detection)")
<< "\n"
#endif
<< " " << opt("--verbose")