| ... | @@ -12,10 +12,8 @@ var cmdline_buffer: [4096]u8 = undefined; | ... | @@ -12,10 +12,8 @@ var cmdline_buffer: [4096]u8 = undefined; |
| 12 | var fba = std.heap.FixedBufferAllocator.init(&cmdline_buffer); | 12 | var fba = std.heap.FixedBufferAllocator.init(&cmdline_buffer); |
| 13 | | 13 | |
| 14 | pub fn main() void { | 14 | pub fn main() void { |
| 15 | if (builtin.zig_backend == .stage2_riscv64) return mainExtraSimple() catch @panic("test failure"); | 15 | if (builtin.zig_backend == .stage2_riscv64) { |
| 16 | | 16 | return mainSimple() catch @panic("test failure\n"); |
| 17 | if (builtin.zig_backend == .stage2_aarch64) { | | |
| 18 | return mainSimple() catch @panic("test failure"); | | |
| 19 | } | 17 | } |
| 20 | | 18 | |
| 21 | const args = std.process.argsAlloc(fba.allocator()) catch | 19 | const args = std.process.argsAlloc(fba.allocator()) catch |
| ... | @@ -221,8 +219,9 @@ pub fn log( | ... | @@ -221,8 +219,9 @@ pub fn log( |
| 221 | /// Simpler main(), exercising fewer language features, so that | 219 | /// Simpler main(), exercising fewer language features, so that |
| 222 | /// work-in-progress backends can handle it. | 220 | /// work-in-progress backends can handle it. |
| 223 | pub fn mainSimple() anyerror!void { | 221 | pub fn mainSimple() anyerror!void { |
| 224 | const enable_print = false; | 222 | const enable_print = true; |
| 225 | const print_all = false; | 223 | const print_all = true; |
| | 224 | const print_summary = false; |
| 226 | | 225 | |
| 227 | var passed: u64 = 0; | 226 | var passed: u64 = 0; |
| 228 | var skipped: u64 = 0; | 227 | var skipped: u64 = 0; |
| ... | @@ -251,24 +250,8 @@ pub fn mainSimple() anyerror!void { | ... | @@ -251,24 +250,8 @@ pub fn mainSimple() anyerror!void { |
| 251 | if (enable_print and print_all) stderr.writeAll("PASS\n") catch {}; | 250 | if (enable_print and print_all) stderr.writeAll("PASS\n") catch {}; |
| 252 | passed += 1; | 251 | passed += 1; |
| 253 | } | 252 | } |
| 254 | if (enable_print) { | 253 | if (print_summary) { |
| 255 | stderr.writer().print("{} passed, {} skipped, {} failed\n", .{ passed, skipped, failed }) catch {}; | 254 | stderr.writer().print("{} passed, {} skipped, {} failed\n", .{ passed, skipped, failed }) catch {}; |
| 256 | if (failed != 0) std.process.exit(1); | 255 | if (failed != 0) std.process.exit(1); |
| 257 | } | 256 | } |
| 258 | } | 257 | } |
| 259 | | | |
| 260 | pub fn mainExtraSimple() !void { | | |
| 261 | var fail_count: u8 = 0; | | |
| 262 | | | |
| 263 | for (builtin.test_functions) |test_fn| { | | |
| 264 | test_fn.func() catch |err| { | | |
| 265 | if (err != error.SkipZigTest) { | | |
| 266 | fail_count += 1; | | |
| 267 | continue; | | |
| 268 | } | | |
| 269 | continue; | | |
| 270 | }; | | |
| 271 | } | | |
| 272 | | | |
| 273 | if (fail_count != 0) std.process.exit(1); | | |
| 274 | } | | |