diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-07-24 14:31:00 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-07-24 15:02:05 -0700 |
| commit | 93ae386f560e7a3464df31b7c9bc9acdc231bc3f (patch) | |
| tree | 4d279258d3812a47b5f5188c9304937c6133fa98 /test/cli.zig | |
| parent | be294e3744b221e7a7aad3ce8fbd1a30148487bc (diff) | |
| download | zig-93ae386f560e7a3464df31b7c9bc9acdc231bc3f.tar.gz zig-93ae386f560e7a3464df31b7c9bc9acdc231bc3f.zip | |
stage2: don't skip liveness or codegen if -femit-asm is supplied
Fixes Godbolt's CLI usage of Zig.
Diffstat (limited to 'test/cli.zig')
| -rw-r--r-- | test/cli.zig | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/test/cli.zig b/test/cli.zig index 3ba74f1ec1..7c0238e771 100644 --- a/test/cli.zig +++ b/test/cli.zig @@ -33,17 +33,26 @@ pub fn main() !void { defer fs.cwd().deleteTree(dir_path) catch {}; const TestFn = fn ([]const u8, []const u8) anyerror!void; - const test_fns = [_]TestFn{ - testZigInitLib, - testZigInitExe, - testGodboltApi, - testMissingOutputPath, - testZigFmt, + const Test = struct { + func: TestFn, + name: []const u8, }; - inline for (test_fns) |testFn| { + const tests = [_]Test{ + .{ .func = testZigInitLib, .name = "zig init-lib" }, + .{ .func = testZigInitExe, .name = "zig init-exe" }, + .{ .func = testGodboltApi, .name = "godbolt API" }, + .{ .func = testMissingOutputPath, .name = "missing output path" }, + .{ .func = testZigFmt, .name = "zig fmt" }, + }; + inline for (tests) |t| { try fs.cwd().deleteTree(dir_path); try fs.cwd().makeDir(dir_path); - try testFn(zig_exe, dir_path); + t.func(zig_exe, dir_path) catch |err| { + std.debug.print("test '{s}' failed: {s}\n", .{ + t.name, @errorName(err), + }); + return err; + }; } } |
