commit 502cab9ae30b001a8da2f724711330a73e7e2e4f (tree)
parent 79e7b719a362959fd172bbe7f7d9abe3e2f6f0cc
Author: Alex Rønne Petersen <alex@alexrp.com>
Date: Mon, 9 Mar 2026 22:41:21 +0100
test_runner: actually print the error that caused a runner failure
part of the Stop Throwing Away Useful Information initiative
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/compiler/test_runner.zig b/lib/compiler/test_runner.zig
@@ -38,10 +38,10 @@ pub fn main(init: std.process.Init.Minimal) void {
}
if (need_simple) {
- return mainSimple() catch @panic("test failure");
+ return mainSimple() catch |err| std.debug.panic("test failure: {t}", .{err});
}
- const args = init.args.toSlice(fba.allocator()) catch @panic("unable to parse command line args");
+ const args = init.args.toSlice(fba.allocator()) catch |err| std.debug.panic("unable to parse command line args: {t}", .{err});
var listen = false;
var opt_cache_dir: ?[]const u8 = null;
@@ -55,7 +55,7 @@ pub fn main(init: std.process.Init.Minimal) void {
} else if (std.mem.startsWith(u8, arg, "--cache-dir")) {
opt_cache_dir = arg["--cache-dir=".len..];
} else {
- @panic("unrecognized command line argument");
+ std.debug.panic("unrecognized command line argument: {s}", .{arg});
}
}
@@ -65,7 +65,7 @@ pub fn main(init: std.process.Init.Minimal) void {
}
if (listen) {
- return mainServer(init) catch @panic("internal test runner failure");
+ return mainServer(init) catch |err| std.debug.panic("internal test runner failure: {t}", .{err});
} else {
return mainTerminal(init);
}