diff options
| author | Loris Cro <kappaloris@gmail.com> | 2023-06-18 09:06:40 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-18 09:06:40 +0200 |
| commit | 216ef10dc471e4db60a30208be178d6c59efeaaf (patch) | |
| tree | 8c239dab283ae9cb3b7fe099bae240bcc53f894e /lib/test_runner.zig | |
| parent | 0fc1d396495c1ab482197021dedac8bea3f9401c (diff) | |
| parent | 729a051e9e38674233190aea23c0ac8c134f2d67 (diff) | |
| download | zig-216ef10dc471e4db60a30208be178d6c59efeaaf.tar.gz zig-216ef10dc471e4db60a30208be178d6c59efeaaf.zip | |
Merge branch 'master' into autodoc-searchkey
Diffstat (limited to 'lib/test_runner.zig')
| -rw-r--r-- | lib/test_runner.zig | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/lib/test_runner.zig b/lib/test_runner.zig index 20d7b02e26..33fe547b57 100644 --- a/lib/test_runner.zig +++ b/lib/test_runner.zig @@ -12,10 +12,7 @@ var cmdline_buffer: [4096]u8 = undefined; var fba = std.heap.FixedBufferAllocator.init(&cmdline_buffer); pub fn main() void { - if (builtin.zig_backend == .stage2_wasm or - (builtin.zig_backend == .stage2_x86_64 and builtin.os.tag != .linux) or - builtin.zig_backend == .stage2_aarch64) - { + if (builtin.zig_backend == .stage2_aarch64) { return mainSimple() catch @panic("test failure"); } @@ -234,25 +231,33 @@ pub fn log( /// work-in-progress backends can handle it. pub fn mainSimple() anyerror!void { const enable_print = false; + const print_all = false; var passed: u64 = 0; var skipped: u64 = 0; var failed: u64 = 0; const stderr = if (enable_print) std.io.getStdErr() else {}; for (builtin.test_functions) |test_fn| { + if (enable_print and print_all) { + stderr.writeAll(test_fn.name) catch {}; + stderr.writeAll("... ") catch {}; + } test_fn.func() catch |err| { - if (enable_print) stderr.writeAll(test_fn.name) catch {}; + if (enable_print and !print_all) { + stderr.writeAll(test_fn.name) catch {}; + stderr.writeAll("... ") catch {}; + } if (err != error.SkipZigTest) { - if (enable_print) stderr.writeAll("... FAIL\n") catch {}; + if (enable_print) stderr.writeAll("FAIL\n") catch {}; failed += 1; if (!enable_print) return err; continue; } - if (enable_print) stderr.writeAll("... SKIP\n") catch {}; + if (enable_print) stderr.writeAll("SKIP\n") catch {}; skipped += 1; continue; }; - //if (enable_print) stderr.writeAll("... PASS\n") catch {}; + if (enable_print and print_all) stderr.writeAll("PASS\n") catch {}; passed += 1; } if (enable_print) { |
