authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-12-25 15:36:21-08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-12-26 19:58:56-08:00
logb0691df5ba898c8f6ac2c03e19e312502a2a0cc5
tree7fa1cb5bca6c8b8e3337da4c08ac329fe4b6986e
parent0126e71903fbb71ce0d968034920e2869f60548f

test_runner: fix simple runner compilation


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

lib/compiler/test_runner.zig+8-6
......@@ -329,6 +329,8 @@ pub fn mainSimple() anyerror!void {
329329 else => false,
330330 };
331331
332 testing.io_instance = .init(testing.allocator, .{});
333
332334 var passed: u64 = 0;
333335 var skipped: u64 = 0;
334336 var failed: u64 = 0;
......@@ -338,26 +340,26 @@ pub fn mainSimple() anyerror!void {
338340
339341 for (builtin.test_functions) |test_fn| {
340342 if (enable_write) {
341 stdout.writeAll(test_fn.name) catch {};
342 stdout.writeAll("... ") catch {};
343 stdout.writeStreamingAll(runner_threaded_io, test_fn.name) catch {};
344 stdout.writeStreamingAll(runner_threaded_io, "... ") catch {};
343345 }
344346 if (test_fn.func()) |_| {
345 if (enable_write) stdout.writeAll("PASS\n") catch {};
347 if (enable_write) stdout.writeStreamingAll(runner_threaded_io, "PASS\n") catch {};
346348 } else |err| {
347349 if (err != error.SkipZigTest) {
348 if (enable_write) stdout.writeAll("FAIL\n") catch {};
350 if (enable_write) stdout.writeStreamingAll(runner_threaded_io, "FAIL\n") catch {};
349351 failed += 1;
350352 if (!enable_write) return err;
351353 continue;
352354 }
353 if (enable_write) stdout.writeAll("SKIP\n") catch {};
355 if (enable_write) stdout.writeStreamingAll(runner_threaded_io, "SKIP\n") catch {};
354356 skipped += 1;
355357 continue;
356358 }
357359 passed += 1;
358360 }
359361 if (enable_print) {
360 var stdout_writer = stdout.writer(&.{});
362 var stdout_writer = stdout.writer(runner_threaded_io, &.{});
361363 stdout_writer.interface.print("{} passed, {} skipped, {} failed\n", .{ passed, skipped, failed }) catch {};
362364 }
363365 if (failed != 0) std.process.exit(1);