From 33a401dd603ec76805ebb5c933fe41f1dfeabd5b Mon Sep 17 00:00:00 2001 From: dweiller <4678790+dweiller@users.noreplay.github.com> Date: Tue, 1 Nov 2022 11:57:43 +1100 Subject: [PATCH] std.build: add support for custom test runner --- lib/std/build.zig | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/std/build.zig b/lib/std/build.zig index 3f903a0b12..3def982017 100644 --- a/lib/std/build.zig +++ b/lib/std/build.zig @@ -1509,6 +1509,7 @@ pub const LibExeObjStep = struct { name_prefix: []const u8, filter: ?[]const u8, test_evented_io: bool = false, + test_runner: ?[]const u8, code_model: std.builtin.CodeModel = .default, wasi_exec_model: ?std.builtin.WasiExecModel = null, /// Symbols to be exported when compiling to wasm @@ -1772,6 +1773,7 @@ pub const LibExeObjStep = struct { .exec_cmd_args = null, .name_prefix = "", .filter = null, + .test_runner = null, .disable_stack_probing = false, .disable_sanitize_c = false, .sanitize_thread = false, @@ -2670,6 +2672,11 @@ pub const LibExeObjStep = struct { try zig_args.append(self.name_prefix); } + if (self.test_runner) |test_runner| { + try zig_args.append("--test-runner"); + try zig_args.append(builder.pathFromRoot(test_runner)); + } + for (builder.debug_log_scopes) |log_scope| { try zig_args.append("--debug-log"); try zig_args.append(log_scope);