|
5 | 5 | // fail to be used by the compiler. |
6 | 6 | // See https://github.com/rust-lang/rust/pull/19941 |
7 | 7 |
|
8 | | -use run_make_support::fs_wrapper; |
9 | | -use run_make_support::{rmake_out_path, rustc}; |
| 8 | +use run_make_support::{fs_wrapper, rustc}; |
10 | 9 |
|
11 | 10 | fn main() { |
12 | | - assert!(rmake_out_path("libnative.a").exists()); |
13 | | - fs_wrapper::create_dir_all(rmake_out_path("crate")); |
14 | | - fs_wrapper::create_dir_all(rmake_out_path("native")); |
15 | | - fs_wrapper::rename(rmake_out_path("libnative.a"), rmake_out_path("native")); |
| 11 | + assert!("libnative.a".exists()); |
| 12 | + fs_wrapper::create_dir_all("crate"); |
| 13 | + fs_wrapper::create_dir_all("native"); |
| 14 | + fs_wrapper::rename("libnative.a", "native/libnative.a"); |
16 | 15 | rustc().input("a.rs").run(); |
17 | | - fs_wrapper::rename(rmake_out_path("liba.a"), rmake_out_path("crate")); |
| 16 | + fs_wrapper::rename("liba.a", "crate/liba.a"); |
18 | 17 | rustc() |
19 | 18 | .input("b.rs") |
20 | | - .specific_library_search_path("native", rmake_out_path("crate")) |
| 19 | + .specific_library_search_path("native", "crate") |
21 | 20 | .run_fail(); |
22 | 21 | rustc() |
23 | 22 | .input("b.rs") |
24 | | - .specific_library_search_path("dependency", rmake_out_path("crate")) |
| 23 | + .specific_library_search_path("dependency", "crate") |
25 | 24 | .run_fail(); |
26 | | - rustc().input("b.rs").specific_library_search_path("crate", rmake_out_path("crate")).run(); |
27 | | - rustc().input("b.rs").specific_library_search_path("all", rmake_out_path("crate")).run(); |
| 25 | + rustc().input("b.rs").specific_library_search_path("crate", "crate").run(); |
| 26 | + rustc().input("b.rs").specific_library_search_path("all", "crate").run(); |
28 | 27 |
|
29 | 28 | rustc() |
30 | 29 | .input("c.rs") |
31 | | - .specific_library_search_path("native", rmake_out_path("crate")) |
| 30 | + .specific_library_search_path("native", "crate") |
32 | 31 | .run_fail(); |
33 | | - rustc().input("c.rs").specific_library_search_path("crate", rmake_out_path("crate")).run_fail(); |
34 | | - rustc().input("c.rs").specific_library_search_path("dependency", rmake_out_path("crate")).run(); |
35 | | - rustc().input("c.rs").specific_library_search_path("all", rmake_out_path("crate")).run(); |
| 32 | + rustc().input("c.rs").specific_library_search_path("crate", "crate").run_fail(); |
| 33 | + rustc().input("c.rs").specific_library_search_path("dependency", "crate").run(); |
| 34 | + rustc().input("c.rs").specific_library_search_path("all", "crate").run(); |
36 | 35 |
|
37 | 36 | rustc() |
38 | 37 | .input("d.rs") |
39 | | - .specific_library_search_path("dependency", rmake_out_path("native")) |
| 38 | + .specific_library_search_path("dependency", "native") |
40 | 39 | .run_fail(); |
41 | 40 | rustc() |
42 | 41 | .input("d.rs") |
43 | | - .specific_library_search_path("crate", rmake_out_path("native")) |
| 42 | + .specific_library_search_path("crate", "native") |
44 | 43 | .run_fail(); |
45 | | - rustc().input("d.rs").specific_library_search_path("native", rmake_out_path("native")).run(); |
46 | | - rustc().input("d.rs").specific_library_search_path("all", rmake_out_path("native")).run(); |
| 44 | + rustc().input("d.rs").specific_library_search_path("native", "native").run(); |
| 45 | + rustc().input("d.rs").specific_library_search_path("all", "native").run(); |
47 | 46 |
|
48 | 47 | // Deduplication tests. |
49 | | - fs_wrapper::create_dir_all(rmake_out_path("e1")); |
50 | | - fs_wrapper::create_dir_all(rmake_out_path("e2")); |
| 48 | + fs_wrapper::create_dir_all("e1"); |
| 49 | + fs_wrapper::create_dir_all("e2"); |
51 | 50 |
|
52 | | - rustc().input("e.rs").output(rmake_out_path("e1/libe.rlib")).run(); |
53 | | - rustc().input("e.rs").output(rmake_out_path("e2/libe.rlib")).run(); |
| 51 | + rustc().input("e.rs").output("e1/libe.rlib")).run(); |
| 52 | + rustc().input("e.rs").output("e2/libe.rlib")).run(); |
54 | 53 | // If the library hash is correct, compilation should succeed. |
55 | 54 | rustc() |
56 | 55 | .input("f.rs") |
57 | | - .library_search_path(rmake_out_path("e1")) |
58 | | - .library_search_path(rmake_out_path("e2")) |
| 56 | + .library_search_path("e1") |
| 57 | + .library_search_path("e2") |
59 | 58 | .run(); |
60 | 59 | rustc() |
61 | 60 | .input("f.rs") |
62 | | - .specific_library_search_path("crate", rmake_out_path("e1")) |
63 | | - .library_search_path(rmake_out_path("e2")) |
| 61 | + .specific_library_search_path("crate", "e1") |
| 62 | + .library_search_path("e2") |
64 | 63 | .run(); |
65 | 64 | rustc() |
66 | 65 | .input("f.rs") |
67 | | - .specific_library_search_path("crate", rmake_out_path("e1")) |
68 | | - .specific_library_search_path("crate", rmake_out_path("e2")) |
| 66 | + .specific_library_search_path("crate", "e1") |
| 67 | + .specific_library_search_path("crate", "e2") |
69 | 68 | .run(); |
70 | 69 | // If the library has a different hash, errors should occur. |
71 | | - rustc().input("e2.rs").output(rmake_out_path("e2/libe.rlib")).run(); |
| 70 | + rustc().input("e2.rs").output("e2/libe.rlib")).run(); |
72 | 71 | rustc() |
73 | 72 | .input("f.rs") |
74 | | - .library_search_path(rmake_out_path("e1")) |
75 | | - .library_search_path(rmake_out_path("e2")) |
| 73 | + .library_search_path("e1") |
| 74 | + .library_search_path("e2") |
76 | 75 | .run_fail(); |
77 | 76 | rustc() |
78 | 77 | .input("f.rs") |
79 | | - .specific_library_search_path("crate", rmake_out_path("e1")) |
80 | | - .library_search_path(rmake_out_path("e2")) |
| 78 | + .specific_library_search_path("crate", "e1") |
| 79 | + .library_search_path("e2") |
81 | 80 | .run_fail(); |
82 | 81 | rustc() |
83 | 82 | .input("f.rs") |
84 | | - .specific_library_search_path("crate", rmake_out_path("e1")) |
85 | | - .specific_library_search_path("crate", rmake_out_path("e2")) |
| 83 | + .specific_library_search_path("crate", "e1") |
| 84 | + .specific_library_search_path("crate", "e2") |
86 | 85 | .run_fail(); |
87 | 86 | // Native and dependency paths do not cause errors. |
88 | 87 | rustc() |
89 | 88 | .input("f.rs") |
90 | | - .specific_library_search_path("native", rmake_out_path("e1")) |
91 | | - .library_search_path(rmake_out_path("e2")) |
| 89 | + .specific_library_search_path("native", "e1") |
| 90 | + .library_search_path("e2") |
92 | 91 | .run(); |
93 | 92 | rustc() |
94 | 93 | .input("f.rs") |
95 | | - .specific_library_search_path("dependency", rmake_out_path("e1")) |
96 | | - .library_search_path(rmake_out_path("e2")) |
| 94 | + .specific_library_search_path("dependency", "e1") |
| 95 | + .library_search_path("e2") |
97 | 96 | .run(); |
98 | 97 | rustc() |
99 | 98 | .input("f.rs") |
100 | | - .specific_library_search_path("dependency", rmake_out_path("e1")) |
101 | | - .specific_library_search_path("crate", rmake_out_path("e2")) |
| 99 | + .specific_library_search_path("dependency", "e1") |
| 100 | + .specific_library_search_path("crate", "e2") |
102 | 101 | .run(); |
103 | 102 | } |
0 commit comments