-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Migrate extern-flag-fun
, incremental-debugger-visualiser
and incremental-session-fail
run-make
tests to rmake.rs
#126490
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
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 @@ | ||
// The --extern flag can override the default crate search of | ||
// the compiler and directly fetch a given path. There are a few rules | ||
// to follow: for example, there can't be more than one rlib, the crates must | ||
// be valid ("no-exist" in this test), and private crates can't be loaded | ||
// as non-private. This test checks that these rules are enforced. | ||
// See https://github.com/rust-lang/rust/pull/15319 | ||
|
||
use run_make_support::{rust_lib_name, rustc}; | ||
|
||
fn main() { | ||
rustc().input("bar.rs").crate_type("rlib").run(); | ||
// Exactly the same rlib as the first line, only the filename changes. | ||
rustc().input("bar.rs").crate_type("rlib").extra_filename("-a").run(); | ||
rustc().input("bar-alt.rs").crate_type("rlib").run(); | ||
// The crate must be valid. | ||
rustc().input("foo.rs").extern_("bar", "no-exist").run_fail(); | ||
rustc().input("foo.rs").extern_("bar", "foo.rs").run_fail(); | ||
// Compilation fails with two different rlibs. | ||
rustc() | ||
.input("foo.rs") | ||
.extern_("bar", rust_lib_name("bar")) | ||
.extern_("bar", rust_lib_name("bar-alt")) | ||
.run_fail(); | ||
// Even though this one has seemingly two rlibs, they are one and the same. | ||
rustc() | ||
.input("foo.rs") | ||
.extern_("bar", rust_lib_name("bar")) | ||
.extern_("bar", rust_lib_name("bar-a")) | ||
.run(); | ||
rustc().input("foo.rs").extern_("bar", rust_lib_name("bar")).run(); | ||
// Try to be sneaky and load a private crate from with a non-private name. | ||
rustc().input("rustc.rs").arg("-Zforce-unstable-if-unmarked").crate_type("rlib").run(); | ||
rustc() | ||
.input("gated_unstable.rs") | ||
.extern_("alloc", rust_lib_name("rustc")) | ||
.run_fail() | ||
.assert_stderr_contains("rustc_private"); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,56 @@ | ||
// This test ensures that changes to files referenced via #[debugger_visualizer] | ||
// (in this case, foo.py and foo.natvis) are picked up when compiling incrementally. | ||
// See https://github.com/rust-lang/rust/pull/111641 | ||
|
||
use run_make_support::{fs_wrapper, invalid_utf8_contains, invalid_utf8_not_contains, rustc}; | ||
use std::io::Read; | ||
|
||
fn main() { | ||
fs_wrapper::create_file("foo.py"); | ||
fs_wrapper::write("foo.py", "GDB script v1"); | ||
Oneirical marked this conversation as resolved.
Show resolved
Hide resolved
|
||
fs_wrapper::create_file("foo.natvis"); | ||
fs_wrapper::write("foo.natvis", "Natvis v1"); | ||
rustc() | ||
.input("foo.rs") | ||
.crate_type("rlib") | ||
.emit("metadata") | ||
.incremental("incremental") | ||
.arg("-Zincremental-verify-ich") | ||
.run(); | ||
|
||
invalid_utf8_contains("libfoo.rmeta", "GDB script v1"); | ||
invalid_utf8_contains("libfoo.rmeta", "Natvis v1"); | ||
|
||
// Change only the GDB script and check that the change has been picked up | ||
fs_wrapper::remove_file("foo.py"); | ||
fs_wrapper::create_file("foo.py"); | ||
fs_wrapper::write("foo.py", "GDB script v2"); | ||
rustc() | ||
.input("foo.rs") | ||
.crate_type("rlib") | ||
.emit("metadata") | ||
.incremental("incremental") | ||
.arg("-Zincremental-verify-ich") | ||
.run(); | ||
|
||
invalid_utf8_contains("libfoo.rmeta", "GDB script v2"); | ||
invalid_utf8_not_contains("libfoo.rmeta", "GDB script v1"); | ||
invalid_utf8_contains("libfoo.rmeta", "Natvis v1"); | ||
|
||
// Now change the Natvis version and check that the change has been picked up | ||
fs_wrapper::remove_file("foo.natvis"); | ||
fs_wrapper::create_file("foo.natvis"); | ||
fs_wrapper::write("foo.natvis", "Natvis v2"); | ||
rustc() | ||
.input("foo.rs") | ||
.crate_type("rlib") | ||
.emit("metadata") | ||
.incremental("incremental") | ||
.arg("-Zincremental-verify-ich") | ||
.run(); | ||
|
||
invalid_utf8_contains("libfoo.rmeta", "GDB script v2"); | ||
invalid_utf8_not_contains("libfoo.rmeta", "GDB script v1"); | ||
invalid_utf8_not_contains("libfoo.rmeta", "Natvis v1"); | ||
invalid_utf8_contains("libfoo.rmeta", "Natvis v2"); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,15 @@ | ||
// Failing to create the directory where output incremental | ||
// files would be stored used to cause an ICE (Internal Compiler | ||
// Error). This was patched in #85698, and this test checks that | ||
// the ensuing compilation failure is not an ICE. | ||
// See https://github.com/rust-lang/rust/pull/85698 | ||
|
||
use run_make_support::{fs_wrapper, rustc}; | ||
|
||
fn main() { | ||
fs_wrapper::create_file("session"); | ||
// rustc should fail to create the session directory here. | ||
let out = rustc().input("foo.rs").crate_type("rlib").incremental("session").run_fail(); | ||
out.assert_stderr_contains("could not create incremental compilation crate directory"); | ||
out.assert_stderr_not_contains("internal compiler error"); | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.