diff options
| author | David Rubin <daviru007@icloud.com> | 2024-03-30 05:49:16 -0700 |
|---|---|---|
| committer | David Rubin <daviru007@icloud.com> | 2024-05-11 02:17:11 -0700 |
| commit | 8ac239ebcea0eacfd99680d51489371e28266ec3 (patch) | |
| tree | c5deabdaab7895a7753c054346ea515b4f5d8213 /lib/compiler/test_runner.zig | |
| parent | c0629c3539f1c944636b6cc9cb531113759b089a (diff) | |
| download | zig-8ac239ebcea0eacfd99680d51489371e28266ec3.tar.gz zig-8ac239ebcea0eacfd99680d51489371e28266ec3.zip | |
riscv: add enough components to get a test runner working
Diffstat (limited to 'lib/compiler/test_runner.zig')
| -rw-r--r-- | lib/compiler/test_runner.zig | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/lib/compiler/test_runner.zig b/lib/compiler/test_runner.zig index 08a2e5721b..41dbbf0986 100644 --- a/lib/compiler/test_runner.zig +++ b/lib/compiler/test_runner.zig @@ -12,9 +12,9 @@ var cmdline_buffer: [4096]u8 = undefined; var fba = std.heap.FixedBufferAllocator.init(&cmdline_buffer); pub fn main() void { - if (builtin.zig_backend == .stage2_aarch64 or - builtin.zig_backend == .stage2_riscv64) - { + if (builtin.zig_backend == .stage2_riscv64) return mainExtraSimple() catch @panic("test failure"); + + if (builtin.zig_backend == .stage2_aarch64) { return mainSimple() catch @panic("test failure"); } @@ -249,3 +249,17 @@ pub fn mainSimple() anyerror!void { if (failed != 0) std.process.exit(1); } } + +pub fn mainExtraSimple() !void { + var pass_count: u8 = 0; + + for (builtin.test_functions) |test_fn| { + test_fn.func() catch |err| { + if (err != error.SkipZigTest) { + @panic(test_fn.name); + } + continue; + }; + pass_count += 1; + } +} |
