Skip to content

Commit

Permalink
Fix several issues with close_output test.
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed May 26, 2020
1 parent 9fcb8c1 commit e2d1d24
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions tests/testsuite/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4840,6 +4840,9 @@ fn close_output() {
[lib]
proc-macro = true
[[bin]]
name = "foobar"
"#,
)
.file(
Expand All @@ -4864,15 +4867,14 @@ fn close_output() {
} else {
println!("{}", i);
}
std::thread::sleep(std::time::Duration::new(0, 1));
}
TokenStream::new()
}
"#
.replace("__ADDR__", &addr.to_string()),
)
.file(
"src/main.rs",
"src/bin/foobar.rs",
r#"
foo::repro!();
Expand Down Expand Up @@ -4913,19 +4915,27 @@ fn close_output() {
};

let stderr = spawn(false);
lines_match(
"\
assert!(
lines_match(
"\
[COMPILING] foo [..]
hello stderr!
[ERROR] [..]
[WARNING] build failed, waiting for other jobs to finish...
[ERROR] build failed
",
&stderr,
&stderr,
),
"lines differ:\n{}",
stderr
);

// Try again with stderr.
p.build_dir().rm_rf();
let stdout = spawn(true);
lines_match("hello_stdout!", &stdout);
assert!(
lines_match("hello stdout!\n", &stdout),
"lines differ:\n{}",
stdout
);
}

0 comments on commit e2d1d24

Please sign in to comment.