forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#127381 - Oneirical:testalt-consciousness, r=jieyouxu Migrate `issue-83045`, `rustc-macro-dep-files` and `env-dep-info` `run-make` tests to rmake Part of rust-lang#121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). Please try on musl. try-job: dist-x86_64-musl
- Loading branch information
Showing
14 changed files
with
96 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
macro_use.d: macro_use.rs | ||
|
||
macro_use.rs: | ||
|
||
# env-dep:EXISTING_PROC_MACRO_ENV=1 | ||
# env-dep:NONEXISTENT_PROC_MACEO_ENV |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
main.d: main.rs | ||
|
||
main.rs: | ||
|
||
# env-dep:ESCAPE\nESCAPE\\ | ||
# env-dep:EXISTING_ENV=1 | ||
# env-dep:EXISTING_OPT_ENV=1 | ||
# env-dep:NONEXISTENT_OPT_ENV |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Inside dep-info emit files, #71858 made it so all accessed environment | ||
// variables are usefully printed. This test checks that this feature works | ||
// as intended by checking if the environment variables used in compilation | ||
// appear in the output dep-info files. | ||
// See https://github.com/rust-lang/rust/issues/40364 | ||
|
||
use run_make_support::{diff, rustc}; | ||
|
||
fn main() { | ||
rustc() | ||
.env("EXISTING_ENV", "1") | ||
.env("EXISTING_OPT_ENV", "1") | ||
.emit("dep-info") | ||
.input("main.rs") | ||
.run(); | ||
diff().expected_file("correct_main.d").actual_file("main.d").run(); | ||
// Procedural macro | ||
rustc().input("macro_def.rs").run(); | ||
rustc().env("EXISTING_PROC_MACRO_ENV", "1").emit("dep-info").input("macro_use.rs").run(); | ||
diff().expected_file("correct_macro.d").actual_file("macro_use.d").run(); | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// This test case creates a situation where the crate loader would run | ||
// into an ICE (internal compiler error) when confronted with an invalid setup where it cannot | ||
// find the dependency of a direct dependency. | ||
// | ||
// The test case makes sure that the compiler produces the expected | ||
// error message but does not ICE immediately after. | ||
// | ||
// See https://github.com/rust-lang/rust/issues/83045 | ||
|
||
//@ only-x86_64 | ||
//@ only-linux | ||
// Reason: This is a platform-independent issue, no need to waste time testing | ||
// everywhere. | ||
|
||
// NOTE: We use `bare_rustc` below so that the compiler can't find liba.rlib | ||
// If we used `rustc` the additional '-L rmake_out' option would allow rustc to | ||
// actually find the crate. | ||
|
||
use run_make_support::{bare_rustc, fs_wrapper, rust_lib_name, rustc}; | ||
|
||
fn main() { | ||
rustc().crate_name("a").crate_type("rlib").input("a.rs").arg("--verbose").run(); | ||
rustc() | ||
.crate_name("b") | ||
.crate_type("rlib") | ||
.extern_("a", rust_lib_name("a")) | ||
.input("b.rs") | ||
.arg("--verbose") | ||
.run(); | ||
bare_rustc() | ||
.extern_("b", rust_lib_name("b")) | ||
.crate_type("rlib") | ||
.edition("2018") | ||
.input("c.rs") | ||
.run_fail() | ||
.assert_stderr_contains("E0463") | ||
.assert_stderr_not_contains("internal compiler error"); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
bar.d: bar.rs | ||
|
||
bar.rs: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// --emit dep-info used to print all macro-generated code it could | ||
// find as if it was part of a nonexistent file named "proc-macro source", | ||
// which is not a valid path. After this was fixed in #36776, this test checks | ||
// that macro code is not falsely seen as coming from a different file in dep-info. | ||
// See https://github.com/rust-lang/rust/issues/36625 | ||
|
||
use run_make_support::{diff, rustc, target}; | ||
|
||
fn main() { | ||
rustc().input("foo.rs").run(); | ||
rustc().input("bar.rs").target(target()).emit("dep-info").run(); | ||
// The emitted file should not contain "proc-macro source". | ||
diff().expected_file("correct.d").actual_file("bar.d").run(); | ||
} |