Commit db18b562ac

dweiller <4678790+dweiller@users.noreply.github.com>
2023-03-30 08:33:28
std.Build: do not assume custom test runners support client-server mode
1 parent aa76ca2
Changed files (2)
lib
std
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,
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();
     }