Skip to content

Commit b94eae5

Browse files
committed
rewrite many-crates-but-no-match to rmake
1 parent c6bb357 commit b94eae5

File tree

3 files changed

+31
-36
lines changed

3 files changed

+31
-36
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ run-make/lto-smoke-c/Makefile
100100
run-make/macos-deployment-target/Makefile
101101
run-make/macos-fat-archive/Makefile
102102
run-make/manual-link/Makefile
103-
run-make/many-crates-but-no-match/Makefile
104103
run-make/metadata-dep-info/Makefile
105104
run-make/min-global-align/Makefile
106105
run-make/mingw-export-call-convention/Makefile

tests/run-make/many-crates-but-no-match/Makefile

-35
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// An extended version of the ui/changing-crates.rs test, this test puts
2+
// multiple mismatching crates into the search path of crateC (A2 and A3)
3+
// and checks that the standard error contains helpful messages to indicate
4+
// what should be done to fix the issue.
5+
// See https://github.com/rust-lang/rust/issues/13266
6+
7+
use run_make_support::{fs_wrapper, rustc};
8+
9+
fn main() {
10+
fs_wrapper::create_dir("a1");
11+
fs_wrapper::create_dir("a2");
12+
fs_wrapper::create_dir("a3");
13+
rustc().crate_type("rlib").out_dir("a1").input("crateA1.rs").run();
14+
rustc().crate_type("rlib").library_search_path("a1").input("crateB.rs").run();
15+
rustc().crate_type("rlib").out_dir("a2").input("crateA2.rs").run();
16+
rustc().crate_type("rlib").out_dir("a3").input("crateA3.rs").run();
17+
// Ensure crateC fails to compile since A1 is "missing" and A2/A3 hashes do not match
18+
rustc()
19+
.crate_type("rlib")
20+
.library_search_path("a2")
21+
.library_search_path("a3")
22+
.input("crateC.rs")
23+
.run_fail()
24+
.assert_stderr_contains(
25+
"found possibly newer version of crate `crateA` which `crateB` depends on",
26+
)
27+
.assert_stderr_contains("note: perhaps that crate needs to be recompiled?")
28+
.assert_stderr_contains("crate `crateA`:")
29+
.assert_stderr_contains("crate `crateB`:");
30+
// the 'crate `crateA`' will match two entries.
31+
}

0 commit comments

Comments
 (0)