diff options
| author | bit-aloo <sshourya17@gmail.com> | 2025-07-04 20:54:09 +0530 |
|---|---|---|
| committer | bit-aloo <sshourya17@gmail.com> | 2025-07-06 00:11:20 +0530 |
| commit | 312de35d3aa33c2c58386ca1544046c54c6d4da2 (patch) | |
| tree | 28391ef5c9ef28671270d735b580293eb454d954 | |
| parent | 8199c950e83b1ae7913f5c1a9b5608065b299039 (diff) | |
| download | rust-312de35d3aa33c2c58386ca1544046c54c6d4da2.tar.gz rust-312de35d3aa33c2c58386ca1544046c54c6d4da2.zip | |
restructure try_run_tests
| -rw-r--r-- | src/bootstrap/src/utils/exec.rs | 12 | ||||
| -rw-r--r-- | src/bootstrap/src/utils/render_tests.rs | 19 |
2 files changed, 13 insertions, 18 deletions
diff --git a/src/bootstrap/src/utils/exec.rs b/src/bootstrap/src/utils/exec.rs index c5b3c322be4..487077835ac 100644 --- a/src/bootstrap/src/utils/exec.rs +++ b/src/bootstrap/src/utils/exec.rs @@ -223,7 +223,7 @@ impl<'a> BootstrapCommand { /// Mark the command as being executed, disarming the drop bomb. /// If this method is not called before the command is dropped, its drop will panic. - fn mark_as_executed(&mut self) { + pub fn mark_as_executed(&mut self) { self.drop_bomb.defuse(); } @@ -625,18 +625,12 @@ impl ExecutionContext { exit!(1); } -<<<<<<< HEAD - pub fn stream<'a>( -======= /// Spawns the command with configured stdout and stderr handling. /// - /// Returns `None` if in dry-run mode and the command is not allowed to run. - /// - /// Panics if the command fails to spawn. + /// Returns None if in dry-run mode or Panics if the command fails to spawn. pub fn stream( ->>>>>>> c2e83361cec (add comment to exec) &self, - command: &'a mut BootstrapCommand, + command: &mut BootstrapCommand, stdout: OutputMode, stderr: OutputMode, ) -> Option<StreamingCommand> { diff --git a/src/bootstrap/src/utils/render_tests.rs b/src/bootstrap/src/utils/render_tests.rs index 73a22ec2826..934699d736b 100644 --- a/src/bootstrap/src/utils/render_tests.rs +++ b/src/bootstrap/src/utils/render_tests.rs @@ -34,16 +34,17 @@ pub(crate) fn try_run_tests( cmd: &mut BootstrapCommand, stream: bool, ) -> bool { - if !run_tests(builder, cmd, stream) { - if builder.fail_fast { - crate::exit!(1); - } else { - builder.config.exec_ctx().add_to_delay_failure(format!("{cmd:?}")); - false - } - } else { - true + if run_tests(builder, cmd, stream) { + return true; } + + if builder.fail_fast { + crate::exit!(1); + } + + builder.config.exec_ctx().add_to_delay_failure(format!("{cmd:?}")); + + false } fn run_tests(builder: &Builder<'_>, cmd: &mut BootstrapCommand, stream: bool) -> bool { |
