| ... | ... | @@ -329,6 +329,8 @@ pub fn mainSimple() anyerror!void { |
| 329 | 329 | else => false, |
| 330 | 330 | }; |
| 331 | 331 | |
| 332 | testing.io_instance = .init(testing.allocator, .{}); |
| 333 | |
| 332 | 334 | var passed: u64 = 0; |
| 333 | 335 | var skipped: u64 = 0; |
| 334 | 336 | var failed: u64 = 0; |
| ... | ... | @@ -338,26 +340,26 @@ pub fn mainSimple() anyerror!void { |
| 338 | 340 | |
| 339 | 341 | for (builtin.test_functions) |test_fn| { |
| 340 | 342 | 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 {}; |
| 343 | 345 | } |
| 344 | 346 | 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 {}; |
| 346 | 348 | } else |err| { |
| 347 | 349 | 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 {}; |
| 349 | 351 | failed += 1; |
| 350 | 352 | if (!enable_write) return err; |
| 351 | 353 | continue; |
| 352 | 354 | } |
| 353 | | if (enable_write) stdout.writeAll("SKIP\n") catch {}; |
| 355 | if (enable_write) stdout.writeStreamingAll(runner_threaded_io, "SKIP\n") catch {}; |
| 354 | 356 | skipped += 1; |
| 355 | 357 | continue; |
| 356 | 358 | } |
| 357 | 359 | passed += 1; |
| 358 | 360 | } |
| 359 | 361 | if (enable_print) { |
| 360 | | var stdout_writer = stdout.writer(&.{}); |
| 362 | var stdout_writer = stdout.writer(runner_threaded_io, &.{}); |
| 361 | 363 | stdout_writer.interface.print("{} passed, {} skipped, {} failed\n", .{ passed, skipped, failed }) catch {}; |
| 362 | 364 | } |
| 363 | 365 | if (failed != 0) std.process.exit(1); |