authorgravatar for jacoblevgw@gmail.comJacob G-W <jacoblevgw@gmail.com> 2021-01-02 23:11:34-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-01-02 20:35:44-08:00
log3d151fbfc8db71f87ee84dd33c49910584708a04
tree2cbc939edf89e035a9906cda4cfb566c2ff11a4c
parentfb37c1b0912c65d72b82f32df8bc7e780ab1ad80

fix 7665:

only add self exe path when testing

1 files changed, 10 insertions(+), 3 deletions(-)

src/main.zig+10-3
...@@ -1853,9 +1853,16 @@ fn buildOutputType(...@@ -1853,9 +1853,16 @@ fn buildOutputType(
1853 else => unreachable,1853 else => unreachable,
1854 }1854 }
1855 }1855 }
1856 try argv.appendSlice(&[_][]const u8{1856 // when testing pass the zig_exe_path to argv
1857 exe_path, self_exe_path,1857 if (arg_mode == .zig_test)
1858 });1858 try argv.appendSlice(&[_][]const u8{
1859 exe_path, self_exe_path,
1860 })
1861 // when running just pass the current exe
1862 else
1863 try argv.appendSlice(&[_][]const u8{
1864 exe_path,
1865 });
1859 } else {1866 } else {
1860 for (test_exec_args.items) |arg| {1867 for (test_exec_args.items) |arg| {
1861 if (arg) |a| {1868 if (arg) |a| {