diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-11-17 02:18:56 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-11-17 02:18:56 -0500 |
| commit | c21884e1d64e4193e03be4f3064917a26b34b142 (patch) | |
| tree | 91e09e1df556e260ea2f1b171eaa05bd30646e1f /test/cli.zig | |
| parent | 2928b01afc5f0d84669ac6a70eedab4117d805f3 (diff) | |
| parent | 704374e51294e14285b0b54030c1cb6154868098 (diff) | |
| download | zig-c21884e1d64e4193e03be4f3064917a26b34b142.tar.gz zig-c21884e1d64e4193e03be4f3064917a26b34b142.zip | |
Merge remote-tracking branch 'origin/master' into llvm8
Diffstat (limited to 'test/cli.zig')
| -rw-r--r-- | test/cli.zig | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/test/cli.zig b/test/cli.zig index 00899e4b51..54ef58af79 100644 --- a/test/cli.zig +++ b/test/cli.zig @@ -30,8 +30,8 @@ pub fn main() !void { const zig_exe = try os.path.resolve(a, zig_exe_rel); const dir_path = try os.path.join(a, cache_root, "clitest"); - const TestFn = fn ([]const u8, []const u8) error!void; - const test_fns = []TestFn.{ + const TestFn = fn ([]const u8, []const u8) anyerror!void; + const test_fns = []TestFn{ testZigInitLib, testZigInitExe, testGodboltApi, @@ -85,18 +85,18 @@ fn exec(cwd: []const u8, argv: []const []const u8) !os.ChildProcess.ExecResult { } fn testZigInitLib(zig_exe: []const u8, dir_path: []const u8) !void { - _ = try exec(dir_path, [][]const u8.{ zig_exe, "init-lib" }); - const test_result = try exec(dir_path, [][]const u8.{ zig_exe, "build", "test" }); + _ = try exec(dir_path, [][]const u8{ zig_exe, "init-lib" }); + const test_result = try exec(dir_path, [][]const u8{ zig_exe, "build", "test" }); assertOrPanic(std.mem.endsWith(u8, test_result.stderr, "All tests passed.\n")); } fn testZigInitExe(zig_exe: []const u8, dir_path: []const u8) !void { - _ = try exec(dir_path, [][]const u8.{ zig_exe, "init-exe" }); - const run_result = try exec(dir_path, [][]const u8.{ zig_exe, "build", "run" }); + _ = try exec(dir_path, [][]const u8{ zig_exe, "init-exe" }); + const run_result = try exec(dir_path, [][]const u8{ zig_exe, "build", "run" }); assertOrPanic(std.mem.eql(u8, run_result.stderr, "All your base are belong to us.\n")); } -fn testGodboltApi(zig_exe: []const u8, dir_path: []const u8) error!void { +fn testGodboltApi(zig_exe: []const u8, dir_path: []const u8) anyerror!void { if (builtin.os != builtin.Os.linux or builtin.arch != builtin.Arch.x86_64) return; const example_zig_path = try os.path.join(a, dir_path, "example.zig"); @@ -113,7 +113,7 @@ fn testGodboltApi(zig_exe: []const u8, dir_path: []const u8) error!void { \\} ); - const args = [][]const u8.{ + const args = [][]const u8{ zig_exe, "build-obj", "--cache-dir", dir_path, "--output", example_s_path, |
