mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 00:34:06 +00:00
Remove run_quiet_delaying_failure
This commit is contained in:
parent
949e667d3f
commit
e933cfb13c
@ -2342,11 +2342,11 @@ fn markdown_test(builder: &Builder<'_>, compiler: Compiler, markdown: &Path) ->
|
|||||||
let test_args = builder.config.test_args().join(" ");
|
let test_args = builder.config.test_args().join(" ");
|
||||||
cmd.arg("--test-args").arg(test_args);
|
cmd.arg("--test-args").arg(test_args);
|
||||||
|
|
||||||
if builder.config.verbose_tests {
|
let mut cmd = BootstrapCommand::from(&mut cmd).delay_failure();
|
||||||
builder.run_delaying_failure(&mut cmd)
|
if !builder.config.verbose_tests {
|
||||||
} else {
|
cmd = cmd.quiet();
|
||||||
builder.run_quiet_delaying_failure(&mut cmd)
|
|
||||||
}
|
}
|
||||||
|
builder.run_tracked(cmd).is_success()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||||
|
@ -958,6 +958,7 @@ impl Build {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Execute a command and return its output.
|
||||||
fn run_tracked(&self, command: BootstrapCommand<'_>) -> CommandOutput {
|
fn run_tracked(&self, command: BootstrapCommand<'_>) -> CommandOutput {
|
||||||
if self.config.dry_run() {
|
if self.config.dry_run() {
|
||||||
return CommandOutput::default();
|
return CommandOutput::default();
|
||||||
@ -1037,15 +1038,6 @@ impl Build {
|
|||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Runs a command, printing out nice contextual information if it fails.
|
|
||||||
/// Exits if the command failed to execute at all, otherwise returns its
|
|
||||||
/// `status.success()`.
|
|
||||||
fn run_quiet_delaying_failure(&self, cmd: &mut Command) -> bool {
|
|
||||||
self.run_cmd(
|
|
||||||
BootstrapCommand::from(cmd).delay_failure().output_mode(OutputMode::PrintOnFailure),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// A centralized function for running commands that do not return output.
|
/// A centralized function for running commands that do not return output.
|
||||||
pub(crate) fn run_cmd<'a, C: Into<BootstrapCommand<'a>>>(&self, cmd: C) -> bool {
|
pub(crate) fn run_cmd<'a, C: Into<BootstrapCommand<'a>>>(&self, cmd: C) -> bool {
|
||||||
if self.config.dry_run() {
|
if self.config.dry_run() {
|
||||||
|
@ -44,6 +44,11 @@ impl<'a> BootstrapCommand<'a> {
|
|||||||
Self { failure_behavior: BehaviorOnFailure::Ignore, ..self }
|
Self { failure_behavior: BehaviorOnFailure::Ignore, ..self }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Do not print the output of the command, unless it fails.
|
||||||
|
pub fn quiet(self) -> Self {
|
||||||
|
self.output_mode(OutputMode::PrintOnFailure)
|
||||||
|
}
|
||||||
|
|
||||||
pub fn output_mode(self, output_mode: OutputMode) -> Self {
|
pub fn output_mode(self, output_mode: OutputMode) -> Self {
|
||||||
Self { output_mode, ..self }
|
Self { output_mode, ..self }
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user