Skip to content

Commit 8d34a57

Browse files
committed
test(check): Verify build-dir lock is taken on check builds
1 parent e6b0a65 commit 8d34a57

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/testsuite/check.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1719,6 +1719,28 @@ fn check_build_should_not_lock_artifact_dir() {
17191719
assert!(!p.root().join("target/debug/.cargo-lock").exists());
17201720
}
17211721

1722+
#[cargo_test]
1723+
fn check_build_should_not_lock_artifact_dir_when_build_dir_is_not_same_dir() {
1724+
let p = project()
1725+
.file("src/main.rs", r#"fn main() { println!("Hello, World!") }"#)
1726+
.file(
1727+
".cargo/config.toml",
1728+
r#"
1729+
[build]
1730+
target-dir = "target-dir"
1731+
build-dir = "build-dir"
1732+
"#,
1733+
)
1734+
.build();
1735+
1736+
p.cargo("check").enable_mac_dsym().run();
1737+
1738+
// Verify we did NOT take the build-dir lock
1739+
assert!(!p.root().join("target-dir/debug/.cargo-lock").exists());
1740+
// Verify we did take the build-dir lock
1741+
assert!(p.root().join("build-dir/debug/.cargo-lock").exists());
1742+
}
1743+
17221744
// Regression test for #16305
17231745
#[cargo_test]
17241746
fn check_build_should_not_uplift_proc_macro_dylib_deps() {

0 commit comments

Comments
 (0)