Skip to content

Commit 312de35

Browse files
committed
restructure try_run_tests
1 parent 8199c95 commit 312de35

File tree

2 files changed

+13
-18
lines changed

2 files changed

+13
-18
lines changed

src/bootstrap/src/utils/exec.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ impl<'a> BootstrapCommand {
223223

224224
/// Mark the command as being executed, disarming the drop bomb.
225225
/// If this method is not called before the command is dropped, its drop will panic.
226-
fn mark_as_executed(&mut self) {
226+
pub fn mark_as_executed(&mut self) {
227227
self.drop_bomb.defuse();
228228
}
229229

@@ -625,18 +625,12 @@ impl ExecutionContext {
625625
exit!(1);
626626
}
627627

628-
<<<<<<< HEAD
629-
pub fn stream<'a>(
630-
=======
631628
/// Spawns the command with configured stdout and stderr handling.
632629
///
633-
/// Returns `None` if in dry-run mode and the command is not allowed to run.
634-
///
635-
/// Panics if the command fails to spawn.
630+
/// Returns None if in dry-run mode or Panics if the command fails to spawn.
636631
pub fn stream(
637-
>>>>>>> c2e83361cec (add comment to exec)
638632
&self,
639-
command: &'a mut BootstrapCommand,
633+
command: &mut BootstrapCommand,
640634
stdout: OutputMode,
641635
stderr: OutputMode,
642636
) -> Option<StreamingCommand> {

src/bootstrap/src/utils/render_tests.rs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,17 @@ pub(crate) fn try_run_tests(
3434
cmd: &mut BootstrapCommand,
3535
stream: bool,
3636
) -> bool {
37-
if !run_tests(builder, cmd, stream) {
38-
if builder.fail_fast {
39-
crate::exit!(1);
40-
} else {
41-
builder.config.exec_ctx().add_to_delay_failure(format!("{cmd:?}"));
42-
false
43-
}
44-
} else {
45-
true
37+
if run_tests(builder, cmd, stream) {
38+
return true;
4639
}
40+
41+
if builder.fail_fast {
42+
crate::exit!(1);
43+
}
44+
45+
builder.config.exec_ctx().add_to_delay_failure(format!("{cmd:?}"));
46+
47+
false
4748
}
4849

4950
fn run_tests(builder: &Builder<'_>, cmd: &mut BootstrapCommand, stream: bool) -> bool {

0 commit comments

Comments
 (0)