| ... | ... | @@ -66,13 +66,13 @@ pub fn main() void { |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | if (listen) { |
| 69 | | return mainServer() catch @panic("internal test runner failure"); |
| 69 | return mainServer(args) catch @panic("internal test runner failure"); |
| 70 | 70 | } else { |
| 71 | | return mainTerminal(); |
| 71 | return mainTerminal(args); |
| 72 | 72 | } |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | | fn mainServer() !void { |
| 75 | fn mainServer(args: []const [:0]const u8) !void { |
| 76 | 76 | @disableInstrumentation(); |
| 77 | 77 | var stdin_reader = Io.File.stdin().readerStreaming(runner_threaded_io, &stdin_buffer); |
| 78 | 78 | var stdout_writer = Io.File.stdout().writerStreaming(runner_threaded_io, &stdout_buffer); |
| ... | ... | @@ -131,7 +131,9 @@ fn mainServer() !void { |
| 131 | 131 | |
| 132 | 132 | .run_test => { |
| 133 | 133 | testing.allocator_instance = .{}; |
| 134 | | testing.io_instance = .init(testing.allocator, .{}); |
| 134 | testing.io_instance = .init(testing.allocator, .{ |
| 135 | .argv0 = if (@hasField(Io.Threaded.Argv0, "value")) .{ .value = args[0] } else .{}, |
| 136 | }); |
| 135 | 137 | log_err_count = 0; |
| 136 | 138 | const index = try server.receiveBody_u32(); |
| 137 | 139 | const test_fn = builtin.test_functions[index]; |
| ... | ... | @@ -215,7 +217,7 @@ fn mainServer() !void { |
| 215 | 217 | } |
| 216 | 218 | } |
| 217 | 219 | |
| 218 | | fn mainTerminal() void { |
| 220 | fn mainTerminal(args: []const [:0]const u8) void { |
| 219 | 221 | @disableInstrumentation(); |
| 220 | 222 | if (builtin.fuzz) @panic("fuzz test requires server"); |
| 221 | 223 | |
| ... | ... | @@ -233,7 +235,9 @@ fn mainTerminal() void { |
| 233 | 235 | var leaks: usize = 0; |
| 234 | 236 | for (test_fn_list, 0..) |test_fn, i| { |
| 235 | 237 | testing.allocator_instance = .{}; |
| 236 | | testing.io_instance = .init(testing.allocator, .{}); |
| 238 | testing.io_instance = .init(testing.allocator, .{ |
| 239 | .argv0 = if (@hasField(Io.Threaded.Argv0, "value")) .{ .value = args[0] } else .{}, |
| 240 | }); |
| 237 | 241 | defer { |
| 238 | 242 | testing.io_instance.deinit(); |
| 239 | 243 | if (testing.allocator_instance.deinit() == .leak) leaks += 1; |