build: inherit setExecCmd from test compile steps when creating run steps
This should fix #17756
This commit is contained in:
@@ -972,10 +972,24 @@ pub fn addRunArtifact(b: *Build, exe: *Step.Compile) *Step.Run {
|
||||
// Consider that this is declarative; the run step may not be run unless a user
|
||||
// option is supplied.
|
||||
const run_step = Step.Run.create(b, b.fmt("run {s}", .{exe.name}));
|
||||
run_step.addArtifactArg(exe);
|
||||
if (exe.kind == .@"test") {
|
||||
if (exe.exec_cmd_args) |exec_cmd_args| {
|
||||
for (exec_cmd_args) |cmd_arg| {
|
||||
if (cmd_arg) |arg| {
|
||||
run_step.addArg(arg);
|
||||
} else {
|
||||
run_step.addArtifactArg(exe);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
run_step.addArtifactArg(exe);
|
||||
}
|
||||
|
||||
if (exe.kind == .@"test" and exe.test_server_mode) {
|
||||
run_step.enableTestRunnerMode();
|
||||
if (exe.test_server_mode) {
|
||||
run_step.enableTestRunnerMode();
|
||||
}
|
||||
} else {
|
||||
run_step.addArtifactArg(exe);
|
||||
}
|
||||
|
||||
return run_step;
|
||||
|
||||
Reference in New Issue
Block a user