Commit c3d4733a00

Andrew Kelley <andrew@ziglang.org>
2021-05-11 20:47:22
test runner: avoid an "out of memory" error return trace entry
The long term solution to this will be #1923
1 parent 65d279b
Changed files (1)
lib
std
lib/std/special/test_runner.zig
@@ -14,12 +14,15 @@ var log_err_count: usize = 0;
 var args_buffer: [std.fs.MAX_PATH_BYTES + std.mem.page_size]u8 = undefined;
 var args_allocator = std.heap.FixedBufferAllocator.init(&args_buffer);
 
-pub fn main() anyerror!void {
+fn processArgs() void {
     const args = std.process.argsAlloc(&args_allocator.allocator) catch {
         @panic("Too many bytes passed over the CLI to the test runner");
     };
     std.testing.zig_exe_path = args[1];
+}
 
+pub fn main() anyerror!void {
+    processArgs();
     const test_fn_list = builtin.test_functions;
     var ok_count: usize = 0;
     var skip_count: usize = 0;