| ... | ... | @@ -34,6 +34,7 @@ pub fn main() !void { |
| 34 | 34 | testZigInitLib, |
| 35 | 35 | testZigInitExe, |
| 36 | 36 | testGodboltApi, |
| 37 | testMissingOutputPath, |
| 37 | 38 | }; |
| 38 | 39 | for (test_fns) |testFn| { |
| 39 | 40 | try fs.deleteTree(a, dir_path); |
| ... | ... | @@ -129,3 +130,12 @@ fn testGodboltApi(zig_exe: []const u8, dir_path: []const u8) anyerror!void { |
| 129 | 130 | testing.expect(std.mem.indexOf(u8, out_asm, "mov\teax, edi") != null); |
| 130 | 131 | testing.expect(std.mem.indexOf(u8, out_asm, "imul\teax, edi") != null); |
| 131 | 132 | } |
| 133 | |
| 134 | fn testMissingOutputPath(zig_exe: []const u8, dir_path: []const u8) !void { |
| 135 | _ = try exec(dir_path, [_][]const u8{ zig_exe, "init-exe" }); |
| 136 | const output_path = try fs.path.join(a, [_][]const u8{ "does", "not", "exist" }); |
| 137 | const source_path = try fs.path.join(a, [_][]const u8{ "src", "main.zig" }); |
| 138 | _ = try exec(dir_path, [_][]const u8{ |
| 139 | zig_exe, "build-exe", source_path, "--output-dir", output_path |
| 140 | }); |
| 141 | } |