From 55c91fc42d048a18c724bdaffe3709bef8aa143e Mon Sep 17 00:00:00 2001 From: dweiller <4678790+dweiller@users.noreplay.github.com> Date: Tue, 25 Oct 2022 16:52:29 +1100 Subject: stage2: add test_runner_path for user provided test runner --- src/Compilation.zig | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/Compilation.zig') diff --git a/src/Compilation.zig b/src/Compilation.zig index 958aac5e1b..e8e15b75ad 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -994,6 +994,7 @@ pub const InitOptions = struct { reference_trace: ?u32 = null, test_filter: ?[]const u8 = null, test_name_prefix: ?[]const u8 = null, + test_runner_path: ?[]const u8 = null, subsystem: ?std.Target.SubSystem = null, /// WASI-only. Type of WASI execution model ("command" or "reactor"). wasi_exec_model: ?std.builtin.WasiExecModel = null, @@ -1578,12 +1579,15 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { errdefer std_pkg.destroy(gpa); const root_pkg = if (options.is_test) root_pkg: { - const test_pkg = try Package.createWithDir( - gpa, - options.zig_lib_directory, - null, - "test_runner.zig", - ); + const test_pkg = if (options.test_runner_path) |test_runner| + try Package.create(gpa, null, test_runner) + else + try Package.createWithDir( + gpa, + options.zig_lib_directory, + null, + "test_runner.zig", + ); errdefer test_pkg.destroy(gpa); break :root_pkg test_pkg; -- cgit v1.2.3