From db18b562acd7d7dd3a35880aabee3b1c34fb043a Mon Sep 17 00:00:00 2001 From: dweiller <4678790+dweiller@users.noreply.github.com> Date: Thu, 30 Mar 2023 17:33:28 +1100 Subject: [PATCH] std.Build: do not assume custom test runners support client-server mode --- lib/std/Build.zig | 2 +- lib/std/Build/Step/Compile.zig | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/std/Build.zig b/lib/std/Build.zig index d2d09539cb..8f4ace6aa2 100644 --- a/lib/std/Build.zig +++ b/lib/std/Build.zig @@ -904,7 +904,7 @@ pub fn addRunArtifact(b: *Build, exe: *Step.Compile) *Step.Run { const run_step = Step.Run.create(b, b.fmt("run {s}", .{exe.name})); run_step.addArtifactArg(exe); - if (exe.kind == .@"test") { + if (exe.kind == .@"test" and exe.test_server_mode) { run_step.enableTestRunnerMode(); } diff --git a/lib/std/Build/Step/Compile.zig b/lib/std/Build/Step/Compile.zig index 90e20c10c3..385f0e6a64 100644 --- a/lib/std/Build/Step/Compile.zig +++ b/lib/std/Build/Step/Compile.zig @@ -73,6 +73,7 @@ exec_cmd_args: ?[]const ?[]const u8, filter: ?[]const u8, test_evented_io: bool = false, test_runner: ?[]const u8, +test_server_mode: bool, code_model: std.builtin.CodeModel = .default, wasi_exec_model: ?std.builtin.WasiExecModel = null, /// Symbols to be exported when compiling to wasm @@ -499,6 +500,7 @@ pub fn create(owner: *std.Build, options: Options) *Compile { .exec_cmd_args = null, .filter = options.filter, .test_runner = options.test_runner, + .test_server_mode = options.test_runner == null, .disable_stack_probing = false, .disable_sanitize_c = false, .sanitize_thread = false,