forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#127000 - Oneirical:no-test-for-the-wicked, r=…
…Kobzol Migrate `use-suggestions-rust-2018`, `overwrite-input`, `lto-dylib-dep` and `many-crates-but-no-match` `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).
- Loading branch information
Showing
12 changed files
with
79 additions
and
76 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 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,15 @@ | ||
// Compiling with link-time-optimizations (LTO) would previously run into an internal | ||
// compiler error (ICE) if a dylib was passed as a required library. This was due to a | ||
// misplaced assert! call in the compiler, which is now removed. This test checks that | ||
// this bug does not make a resurgence and that dylib+lto compilation succeeds. | ||
// See https://github.com/rust-lang/rust/issues/59137 | ||
|
||
//@ ignore-cross-compile | ||
|
||
use run_make_support::{run, rustc}; | ||
|
||
fn main() { | ||
rustc().input("a_dylib.rs").crate_type("dylib").arg("-Cprefer-dynamic").run(); | ||
rustc().input("main.rs").arg("-Clto").run(); | ||
run("main"); | ||
} |
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,31 @@ | ||
// An extended version of the ui/changing-crates.rs test, this test puts | ||
// multiple mismatching crates into the search path of crateC (A2 and A3) | ||
// and checks that the standard error contains helpful messages to indicate | ||
// what should be done to fix the issue. | ||
// See https://github.com/rust-lang/rust/issues/13266 | ||
|
||
use run_make_support::{fs_wrapper, rustc}; | ||
|
||
fn main() { | ||
fs_wrapper::create_dir("a1"); | ||
fs_wrapper::create_dir("a2"); | ||
fs_wrapper::create_dir("a3"); | ||
rustc().crate_type("rlib").out_dir("a1").input("crateA1.rs").run(); | ||
rustc().crate_type("rlib").library_search_path("a1").input("crateB.rs").run(); | ||
rustc().crate_type("rlib").out_dir("a2").input("crateA2.rs").run(); | ||
rustc().crate_type("rlib").out_dir("a3").input("crateA3.rs").run(); | ||
// Ensure crateC fails to compile since A1 is "missing" and A2/A3 hashes do not match | ||
rustc() | ||
.crate_type("rlib") | ||
.library_search_path("a2") | ||
.library_search_path("a3") | ||
.input("crateC.rs") | ||
.run_fail() | ||
.assert_stderr_contains( | ||
"found possibly newer version of crate `crateA` which `crateB` depends on", | ||
) | ||
.assert_stderr_contains("note: perhaps that crate needs to be recompiled?") | ||
.assert_stderr_contains("crate `crateA`:") | ||
.assert_stderr_contains("crate `crateB`:"); | ||
// the 'crate `crateA`' will match two entries. | ||
} |
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 |
---|---|---|
@@ -1,6 +1,4 @@ | ||
warning: ignoring --out-dir flag due to -o flag | ||
|
||
error: the input file "main.rs" would be overwritten by the generated executable | ||
|
||
error: aborting due to 1 previous error; 1 warning emitted | ||
error: aborting due to 1 previous error | ||
|
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 |
---|---|---|
@@ -1,6 +1,4 @@ | ||
warning: ignoring --out-dir flag due to -o flag | ||
|
||
error: the generated executable for the input file "main.rs" conflicts with the existing directory "." | ||
|
||
error: aborting due to 1 previous error; 1 warning emitted | ||
error: aborting due to 1 previous error | ||
|
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,13 @@ | ||
// An attempt to set the output `-o` into a directory or a file we cannot write into should indeed | ||
// be an error; but not an ICE (Internal Compiler Error). This test attempts both and checks | ||
// that the standard error matches what is expected. | ||
// See https://github.com/rust-lang/rust/issues/66530 | ||
|
||
use run_make_support::{diff, rustc}; | ||
|
||
fn main() { | ||
let file_out = rustc().input("main.rs").output("main.rs").run_fail().stderr_utf8(); | ||
let folder_out = rustc().input("main.rs").output(".").run_fail().stderr_utf8(); | ||
diff().expected_file("file.stderr").actual_text("actual-file-stderr", file_out).run(); | ||
diff().expected_file("folder.stderr").actual_text("actual-folder-stderr", folder_out).run(); | ||
} |
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,18 @@ | ||
// The compilation error caused by calling on an unimported crate | ||
// should have a suggestion to write, say, crate::bar::Foo instead | ||
// of just bar::Foo. However, this suggestion used to only appear for | ||
// extern crate statements, not crate struct. After this was fixed in #51456, | ||
// this test checks that the correct suggestion is printed no matter what. | ||
// See https://github.com/rust-lang/rust/issues/51212 | ||
|
||
use run_make_support::{rust_lib_name, rustc}; | ||
|
||
fn main() { | ||
rustc().input("ep-nested-lib.rs").run(); | ||
rustc() | ||
.input("use-suggestions.rs") | ||
.edition("2018") | ||
.extern_("ep_nested_lib", rust_lib_name("ep_nested_lib")) | ||
.run_fail() | ||
.assert_stderr_contains("use ep_nested_lib::foo::bar::Baz"); | ||
} |