authorgravatar for spexguy070@gmail.comMartin Wickham <spexguy070@gmail.com> 2021-09-30 00:19:21-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-09-30 18:00:13-04:00
logc82c3585c8fdf02820747c118c78957e2eb5d072
treed2b708577d98cd1d4e980435be1a7be48a8fd3ce
parentf87156e33c688effcf00b8fa9c2542391423ee78

Add error message to test runner for bad arguments


1 files changed, 6 insertions(+), 0 deletions(-)

lib/std/special/test_runner.zig+6
......@@ -13,6 +13,12 @@ fn processArgs() void {
1313 const args = std.process.argsAlloc(&args_allocator.allocator) catch {
1414 @panic("Too many bytes passed over the CLI to the test runner");
1515 };
16 if (args.len != 2) {
17 const self_name = if (args.len >= 1) args[0] else if (builtin.os.tag == .windows) "test.exe" else "test";
18 const zig_ext = if (builtin.os.tag == .windows) ".exe" else "";
19 std.debug.print("Usage: {s} path/to/zig{s}\n", .{ self_name, zig_ext });
20 @panic("Wrong number of command line arguments");
21 }
1622 std.testing.zig_exe_path = args[1];
1723}
1824