Commit 570f610341

Vexu <git@vexu.eu>
2020-10-15 15:31:03
stage2: fix test harness tmp path handling
1 parent 2020ca6
Changed files (1)
src/test.zig
@@ -463,10 +463,10 @@ pub const TestContext = struct {
 
         var cache_dir = try tmp.dir.makeOpenPath("zig-cache", .{});
         defer cache_dir.close();
-        const bogus_path = "bogus"; // TODO this will need to be fixed before we can test LLVM extensions
+        const tmp_path = try std.fs.path.join(arena, &[_][]const u8{ ".", "zig-cache", "tmp", &tmp.sub_path });
         const zig_cache_directory: Compilation.Directory = .{
             .handle = cache_dir,
-            .path = try std.fs.path.join(arena, &[_][]const u8{ bogus_path, "zig-cache" }),
+            .path = try std.fs.path.join(arena, &[_][]const u8{ tmp_path, "zig-cache" }),
         };
 
         const tmp_src_path = switch (case.extension) {
@@ -475,7 +475,7 @@ pub const TestContext = struct {
         };
 
         var root_pkg: Package = .{
-            .root_src_directory = .{ .path = bogus_path, .handle = tmp.dir },
+            .root_src_directory = .{ .path = tmp_path, .handle = tmp.dir },
             .root_src_path = tmp_src_path,
         };
 
@@ -488,7 +488,7 @@ pub const TestContext = struct {
         });
 
         const emit_directory: Compilation.Directory = .{
-            .path = bogus_path,
+            .path = tmp_path,
             .handle = tmp.dir,
         };
         const emit_bin: Compilation.EmitLoc = .{