aboutsummaryrefslogtreecommitdiff
path: root/test/cli.zig
diff options
context:
space:
mode:
authorJay Weisskopf <jay@jayschwa.net>2019-09-11 00:25:10 -0400
committerAndrew Kelley <andrew@ziglang.org>2019-09-24 00:20:29 -0400
commit0bdc85181cbe1954dac7e96c5ab4b2fe209b9098 (patch)
tree88fbcfba5153d69568478b9d0e411e9783edd4e9 /test/cli.zig
parent663e665843627cead40258a74ffddf4574fbb816 (diff)
downloadzig-0bdc85181cbe1954dac7e96c5ab4b2fe209b9098.tar.gz
zig-0bdc85181cbe1954dac7e96c5ab4b2fe209b9098.zip
Create user-specified `output-dir`
Fixes #2637
Diffstat (limited to 'test/cli.zig')
-rw-r--r--test/cli.zig10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/cli.zig b/test/cli.zig
index 6d0b09785f..8287c41b81 100644
--- a/test/cli.zig
+++ b/test/cli.zig
@@ -34,6 +34,7 @@ pub fn main() !void {
testZigInitLib,
testZigInitExe,
testGodboltApi,
+ testMissingOutputPath,
};
for (test_fns) |testFn| {
try fs.deleteTree(a, dir_path);
@@ -129,3 +130,12 @@ fn testGodboltApi(zig_exe: []const u8, dir_path: []const u8) anyerror!void {
testing.expect(std.mem.indexOf(u8, out_asm, "mov\teax, edi") != null);
testing.expect(std.mem.indexOf(u8, out_asm, "imul\teax, edi") != null);
}
+
+fn testMissingOutputPath(zig_exe: []const u8, dir_path: []const u8) !void {
+ _ = try exec(dir_path, [_][]const u8{ zig_exe, "init-exe" });
+ const output_path = try fs.path.join(a, [_][]const u8{ "does", "not", "exist" });
+ const source_path = try fs.path.join(a, [_][]const u8{ "src", "main.zig" });
+ _ = try exec(dir_path, [_][]const u8{
+ zig_exe, "build-exe", source_path, "--output-dir", output_path
+ });
+}