aboutsummaryrefslogtreecommitdiff
path: root/src/test.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-09-14 18:02:21 -0400
committerGitHub <noreply@github.com>2022-09-14 18:02:21 -0400
commitd834b180118cf336b09b8f664e294ec2222e6d16 (patch)
tree1c3450ba81bed2e4125bf21e21ce2e03631ca53e /src/test.zig
parent61aaef0b074dc2567e4c35c9cb55cb042c18d065 (diff)
parent85b10eb07c27d021804473ee54a0b5942e4784d5 (diff)
downloadzig-d834b180118cf336b09b8f664e294ec2222e6d16.tar.gz
zig-d834b180118cf336b09b8f664e294ec2222e6d16.zip
Merge pull request #11633 from SpexGuy
Remove `std.testing.zig_exe_path` in favor of `ZIG_EXE` environment variable
Diffstat (limited to 'src/test.zig')
-rw-r--r--src/test.zig9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/test.zig b/src/test.zig
index f26c65f3f8..b95a66c11f 100644
--- a/src/test.zig
+++ b/src/test.zig
@@ -1214,6 +1214,7 @@ pub const TestContext = struct {
fn run(self: *TestContext) !void {
const host = try std.zig.system.NativeTargetInfo.detect(.{});
+ const zig_exe_path = try std.process.getEnvVarOwned(self.arena, "ZIG_EXE");
var progress = std.Progress{};
const root_node = progress.start("compiler", self.cases.items.len);
@@ -1272,6 +1273,7 @@ pub const TestContext = struct {
&prg_node,
case.*,
zig_lib_directory,
+ zig_exe_path,
&aux_thread_pool,
global_cache_directory,
host,
@@ -1298,6 +1300,7 @@ pub const TestContext = struct {
root_node: *std.Progress.Node,
case: Case,
zig_lib_directory: Compilation.Directory,
+ zig_exe_path: []const u8,
thread_pool: *ThreadPool,
global_cache_directory: Compilation.Directory,
host: std.zig.system.NativeTargetInfo,
@@ -1351,7 +1354,7 @@ pub const TestContext = struct {
try tmp.dir.writeFile(tmp_src_path, update.src);
var zig_args = std.ArrayList([]const u8).init(arena);
- try zig_args.append(std.testing.zig_exe_path);
+ try zig_args.append(zig_exe_path);
if (case.is_test) {
try zig_args.append("test");
@@ -1545,7 +1548,7 @@ pub const TestContext = struct {
.link_libc = case.link_libc,
.use_llvm = use_llvm,
.use_stage1 = null, // We already handled stage1 tests
- .self_exe_path = std.testing.zig_exe_path,
+ .self_exe_path = zig_exe_path,
// TODO instead of turning off color, pass in a std.Progress.Node
.color = .off,
// TODO: force self-hosted linkers with stage2 backend to avoid LLD creeping in
@@ -1795,7 +1798,7 @@ pub const TestContext = struct {
continue :update; // Pass test.
}
try argv.appendSlice(&[_][]const u8{
- std.testing.zig_exe_path,
+ zig_exe_path,
"run",
"-cflags",
"-std=c99",