Skip to content

Commit e2d1d24

Browse files
committed
Fix several issues with close_output test.
1 parent 9fcb8c1 commit e2d1d24

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

tests/testsuite/build.rs

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4840,6 +4840,9 @@ fn close_output() {
48404840
48414841
[lib]
48424842
proc-macro = true
4843+
4844+
[[bin]]
4845+
name = "foobar"
48434846
"#,
48444847
)
48454848
.file(
@@ -4864,15 +4867,14 @@ fn close_output() {
48644867
} else {
48654868
println!("{}", i);
48664869
}
4867-
std::thread::sleep(std::time::Duration::new(0, 1));
48684870
}
48694871
TokenStream::new()
48704872
}
48714873
"#
48724874
.replace("__ADDR__", &addr.to_string()),
48734875
)
48744876
.file(
4875-
"src/main.rs",
4877+
"src/bin/foobar.rs",
48764878
r#"
48774879
foo::repro!();
48784880
@@ -4913,19 +4915,27 @@ fn close_output() {
49134915
};
49144916

49154917
let stderr = spawn(false);
4916-
lines_match(
4917-
"\
4918+
assert!(
4919+
lines_match(
4920+
"\
49184921
[COMPILING] foo [..]
49194922
hello stderr!
49204923
[ERROR] [..]
49214924
[WARNING] build failed, waiting for other jobs to finish...
49224925
[ERROR] build failed
49234926
",
4924-
&stderr,
4927+
&stderr,
4928+
),
4929+
"lines differ:\n{}",
4930+
stderr
49254931
);
49264932

49274933
// Try again with stderr.
49284934
p.build_dir().rm_rf();
49294935
let stdout = spawn(true);
4930-
lines_match("hello_stdout!", &stdout);
4936+
assert!(
4937+
lines_match("hello stdout!\n", &stdout),
4938+
"lines differ:\n{}",
4939+
stdout
4940+
);
49314941
}

0 commit comments

Comments
 (0)