std.Build: do not assume custom test runners support client-server mode

This commit is contained in:
dweiller 2023-03-30 17:33:28 +11:00 committed by Andrew Kelley
parent aa76ca2931
commit db18b562ac
2 changed files with 3 additions and 1 deletions

View File

@ -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();
}

View File

@ -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,