aboutsummaryrefslogtreecommitdiff
path: root/src/main.zig
diff options
context:
space:
mode:
authorg-w1 <jacoblevgw@gmail.com>2021-01-02 23:11:34 -0500
committerAndrew Kelley <andrew@ziglang.org>2021-01-02 20:35:44 -0800
commit3d151fbfc8db71f87ee84dd33c49910584708a04 (patch)
tree2cbc939edf89e035a9906cda4cfb566c2ff11a4c /src/main.zig
parentfb37c1b0912c65d72b82f32df8bc7e780ab1ad80 (diff)
downloadzig-3d151fbfc8db71f87ee84dd33c49910584708a04.tar.gz
zig-3d151fbfc8db71f87ee84dd33c49910584708a04.zip
fix 7665:
only add self exe path when testing
Diffstat (limited to 'src/main.zig')
-rw-r--r--src/main.zig13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/main.zig b/src/main.zig
index b1243badff..519671bccf 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -1853,9 +1853,16 @@ fn buildOutputType(
else => unreachable,
}
}
- try argv.appendSlice(&[_][]const u8{
- exe_path, self_exe_path,
- });
+ // when testing pass the zig_exe_path to argv
+ if (arg_mode == .zig_test)
+ try argv.appendSlice(&[_][]const u8{
+ exe_path, self_exe_path,
+ })
+ // when running just pass the current exe
+ else
+ try argv.appendSlice(&[_][]const u8{
+ exe_path,
+ });
} else {
for (test_exec_args.items) |arg| {
if (arg) |a| {