Skip to content

Fix rebuild_sub_package_then_while_package on HFS. #7865

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 39 additions & 11 deletions tests/testsuite/freshness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,21 +136,49 @@ fn rebuild_sub_package_then_while_package() {
.file("b/src/lib.rs", "")
.build();

p.cargo("build").run();
p.cargo("build")
.with_stderr(
"\
[COMPILING] b [..]
[COMPILING] a [..]
[COMPILING] foo [..]
[FINISHED] dev [..]
",
)
.run();

File::create(&p.root().join("b/src/lib.rs"))
.unwrap()
.write_all(br#"pub fn b() {}"#)
.unwrap();
if is_coarse_mtime() {
sleep_ms(1000);
}
p.change_file("b/src/lib.rs", "pub fn b() {}");

p.cargo("build -pb").run();
p.cargo("build -pb -v")
.with_stderr(
"\
[COMPILING] b [..]
[RUNNING] `rustc --crate-name b [..]
[FINISHED] dev [..]
",
)
.run();

File::create(&p.root().join("src/lib.rs"))
.unwrap()
.write_all(br#"extern crate a; extern crate b; pub fn toplevel() {}"#)
.unwrap();
p.change_file(
"src/lib.rs",
"extern crate a; extern crate b; pub fn toplevel() {}",
);

p.cargo("build").run();
p.cargo("build -v")
.with_stderr(
"\
[FRESH] b [..]
[COMPILING] a [..]
[RUNNING] `rustc --crate-name a [..]
[COMPILING] foo [..]
[RUNNING] `rustc --crate-name foo [..]
[FINISHED] dev [..]
",
)
.run();
}

#[cargo_test]
Expand Down