Skip to content

Commit

Permalink
change approach to prevent interleaving compiletest message
Browse files Browse the repository at this point in the history
  • Loading branch information
pietroalbini committed Mar 3, 2023
1 parent 9a1ff1b commit 4958272
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 1 addition & 6 deletions src/bootstrap/render_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//! to reimplement all the rendering logic in this module because of that.

use crate::builder::Builder;
use std::io::{BufRead, BufReader, Cursor, Write};
use std::io::{BufRead, BufReader, Write};
use std::process::{ChildStdout, Command, Stdio};
use std::time::Duration;
use yansi_term::Color;
Expand Down Expand Up @@ -43,7 +43,6 @@ pub(crate) fn try_run_tests(builder: &Builder<'_>, cmd: &mut Command) -> bool {

fn run_tests(builder: &Builder<'_>, cmd: &mut Command) -> bool {
cmd.stdout(Stdio::piped());
cmd.stderr(Stdio::piped());

builder.verbose(&format!("running: {cmd:?}"));

Expand All @@ -62,10 +61,6 @@ fn run_tests(builder: &Builder<'_>, cmd: &mut Command) -> bool {
);
}

// Show the stderr emitted by the test runner at the end. As of 2023-03-02 this is only the
// message at the end of a failed compiletest run.
std::io::copy(&mut Cursor::new(&result.stderr), &mut std::io::stderr().lock()).unwrap();

result.status.success()
}

Expand Down
2 changes: 1 addition & 1 deletion src/tools/compiletest/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ pub fn run_tests(config: Config) {
// easy to miss which tests failed, and as such fail to reproduce
// the failure locally.

eprintln!(
println!(
"Some tests failed in compiletest suite={}{} mode={} host={} target={}",
config.suite,
config.compare_mode.map(|c| format!(" compare_mode={:?}", c)).unwrap_or_default(),
Expand Down

0 comments on commit 4958272

Please sign in to comment.