From b0691df5ba898c8f6ac2c03e19e312502a2a0cc5 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 25 Dec 2025 15:36:21 -0800 Subject: [PATCH] test_runner: fix simple runner compilation --- lib/compiler/test_runner.zig | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/compiler/test_runner.zig b/lib/compiler/test_runner.zig index 32b589cec8415f9bd2ad0985a6b8dcc4272c00b7..da3da684d920bd9758406453a19eda086782b676 100644 --- a/lib/compiler/test_runner.zig +++ b/lib/compiler/test_runner.zig @@ -329,6 +329,8 @@ pub fn mainSimple() anyerror!void { else => false, }; + testing.io_instance = .init(testing.allocator, .{}); + var passed: u64 = 0; var skipped: u64 = 0; var failed: u64 = 0; @@ -338,26 +340,26 @@ pub fn mainSimple() anyerror!void { for (builtin.test_functions) |test_fn| { if (enable_write) { - stdout.writeAll(test_fn.name) catch {}; - stdout.writeAll("... ") catch {}; + stdout.writeStreamingAll(runner_threaded_io, test_fn.name) catch {}; + stdout.writeStreamingAll(runner_threaded_io, "... ") catch {}; } if (test_fn.func()) |_| { - if (enable_write) stdout.writeAll("PASS\n") catch {}; + if (enable_write) stdout.writeStreamingAll(runner_threaded_io, "PASS\n") catch {}; } else |err| { if (err != error.SkipZigTest) { - if (enable_write) stdout.writeAll("FAIL\n") catch {}; + if (enable_write) stdout.writeStreamingAll(runner_threaded_io, "FAIL\n") catch {}; failed += 1; if (!enable_write) return err; continue; } - if (enable_write) stdout.writeAll("SKIP\n") catch {}; + if (enable_write) stdout.writeStreamingAll(runner_threaded_io, "SKIP\n") catch {}; skipped += 1; continue; } passed += 1; } if (enable_print) { - var stdout_writer = stdout.writer(&.{}); + var stdout_writer = stdout.writer(runner_threaded_io, &.{}); stdout_writer.interface.print("{} passed, {} skipped, {} failed\n", .{ passed, skipped, failed }) catch {}; } if (failed != 0) std.process.exit(1); -- 2.54.0