test/src/Cases: fix incorrect code to find zig_lib_directory

The runCases function incorrectly called the introspect.findZigLibDir
function, causing a possible error, depending on the location of the
local cache directory, since the current executable is check-case.

Use findZigLibDirFromSelfExe, passing the zig_exe_path argument.

The current CI scripts work correctly because ZIG_LOCAL_CACHE_DIR is set
to "$(pwd)/zig-local-cache".

Fixes #15044
This commit is contained in:
Manlio Perillo
2023-03-24 21:50:02 +01:00
committed by Veikka Tuominen
parent 539e0b0469
commit 423d7b848b

View File

@@ -1154,7 +1154,7 @@ fn runCases(self: *Cases, zig_exe_path: []const u8) !void {
progress.terminal = null;
defer root_node.end();
var zig_lib_directory = try introspect.findZigLibDir(self.gpa);
var zig_lib_directory = try introspect.findZigLibDirFromSelfExe(self.gpa, zig_exe_path);
defer zig_lib_directory.handle.close();
defer self.gpa.free(zig_lib_directory.path.?);