-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 #125383 - Oneirical:bundle-them-up, r=jieyouxu
Rewrite `emit`, `mixing-formats` and `bare-outfile` `run-make` tests in `rmake.rs` format Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). try-job: x86_64-msvc
- Loading branch information
Showing
8 changed files
with
130 additions
and
111 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,15 @@ | ||
// This test checks that manually setting the output file as a bare file with no file extension | ||
// still results in successful compilation. | ||
|
||
//@ ignore-cross-compile | ||
|
||
use run_make_support::{run, rustc, tmp_dir}; | ||
use std::env; | ||
use std::fs; | ||
|
||
fn main() { | ||
fs::copy("foo.rs", tmp_dir().join("foo.rs")).unwrap(); | ||
env::set_current_dir(tmp_dir()); | ||
rustc().output("foo").input("foo.rs").run(); | ||
run("foo"); | ||
} |
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,19 @@ | ||
// A bug from 2015 would cause errors when emitting multiple types of files | ||
// in the same rustc call. A fix was created in #30452. This test checks that rustc still compiles | ||
// a source file successfully when emission of multiple output artifacts are requested. | ||
// See https://github.com/rust-lang/rust/pull/30452 | ||
|
||
//@ ignore-cross-compile | ||
|
||
use run_make_support::{run, rustc}; | ||
|
||
fn main() { | ||
let opt_levels = ["0", "1", "2", "3", "s", "z"]; | ||
for level in opt_levels { | ||
rustc().opt_level(level).emit("llvm-bc,llvm-ir,asm,obj,link").input("test-24876.rs").run(); | ||
} | ||
for level in opt_levels { | ||
rustc().opt_level(level).emit("llvm-bc,llvm-ir,asm,obj,link").input("test-26235.rs").run(); | ||
run("test-26235"); | ||
} | ||
} |
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,94 @@ | ||
// Testing various mixings of rlibs and dylibs. Makes sure that it's possible to | ||
// link an rlib to a dylib. The dependency tree among the file looks like: | ||
// | ||
// foo | ||
// / \ | ||
// bar1 bar2 | ||
// / \ / | ||
// baz baz2 | ||
// | ||
// This is generally testing the permutations of the foo/bar1/bar2 layer against | ||
// the baz/baz2 layer | ||
|
||
//@ ignore-cross-compile | ||
|
||
use run_make_support::{rustc, tmp_dir}; | ||
use std::fs; | ||
|
||
fn test_with_teardown(rustc_calls: impl Fn()) { | ||
rustc_calls(); | ||
//FIXME(Oneirical): This should be replaced with the run-make-support fs wrappers. | ||
fs::remove_dir_all(tmp_dir()).unwrap(); | ||
fs::create_dir(tmp_dir()).unwrap(); | ||
} | ||
|
||
fn main() { | ||
test_with_teardown(|| { | ||
// Building just baz | ||
rustc().crate_type("rlib").input("foo.rs").run(); | ||
rustc().crate_type("dylib").input("bar1.rs").arg("-Cprefer-dynamic").run(); | ||
rustc().crate_type("dylib,rlib").input("baz.rs").arg("-Cprefer-dynamic").run(); | ||
rustc().crate_type("bin").input("baz.rs").run(); | ||
}); | ||
test_with_teardown(|| { | ||
rustc().crate_type("dylib").input("foo.rs").arg("-Cprefer-dynamic").run(); | ||
rustc().crate_type("rlib").input("bar1.rs").run(); | ||
rustc().crate_type("dylib,rlib").input("baz.rs").arg("-Cprefer-dynamic").run(); | ||
rustc().crate_type("bin").input("baz.rs").run(); | ||
}); | ||
test_with_teardown(|| { | ||
// Building baz2 | ||
rustc().crate_type("rlib").input("foo.rs").run(); | ||
rustc().crate_type("dylib").input("bar1.rs").arg("-Cprefer-dynamic").run(); | ||
rustc().crate_type("dylib").input("bar2.rs").arg("-Cprefer-dynamic").run(); | ||
rustc().crate_type("dylib").input("baz2.rs").run_fail_assert_exit_code(1); | ||
rustc().crate_type("bin").input("baz2.rs").run_fail_assert_exit_code(1); | ||
}); | ||
test_with_teardown(|| { | ||
rustc().crate_type("rlib").input("foo.rs").run(); | ||
rustc().crate_type("rlib").input("bar1.rs").run(); | ||
rustc().crate_type("dylib").input("bar2.rs").arg("-Cprefer-dynamic").run(); | ||
rustc().crate_type("dylib,rlib").input("baz2.rs").run(); | ||
rustc().crate_type("bin").input("baz2.rs").run(); | ||
}); | ||
test_with_teardown(|| { | ||
rustc().crate_type("rlib").input("foo.rs").run(); | ||
rustc().crate_type("dylib").input("bar1.rs").arg("-Cprefer-dynamic").run(); | ||
rustc().crate_type("rlib").input("bar2.rs").run(); | ||
rustc().crate_type("dylib,rlib").input("baz2.rs").arg("-Cprefer-dynamic").run(); | ||
rustc().crate_type("bin").input("baz2.rs").run(); | ||
}); | ||
test_with_teardown(|| { | ||
rustc().crate_type("rlib").input("foo.rs").run(); | ||
rustc().crate_type("rlib").input("bar1.rs").run(); | ||
rustc().crate_type("rlib").input("bar2.rs").run(); | ||
rustc().crate_type("dylib,rlib").input("baz2.rs").arg("-Cprefer-dynamic").run(); | ||
rustc().crate_type("bin").input("baz2.rs").run(); | ||
}); | ||
test_with_teardown(|| { | ||
rustc().crate_type("dylib").input("foo.rs").arg("-Cprefer-dynamic").run(); | ||
rustc().crate_type("rlib").input("bar1.rs").run(); | ||
rustc().crate_type("rlib").input("bar2.rs").run(); | ||
rustc().crate_type("dylib,rlib").input("baz2.rs").arg("-Cprefer-dynamic").run(); | ||
rustc().crate_type("bin").input("baz2.rs").run(); | ||
}); | ||
test_with_teardown(|| { | ||
rustc().crate_type("dylib").input("foo.rs").arg("-Cprefer-dynamic").run(); | ||
rustc().crate_type("dylib").input("bar1.rs").arg("-Cprefer-dynamic").run(); | ||
rustc().crate_type("rlib").input("bar2.rs").run(); | ||
rustc().crate_type("dylib,rlib").input("baz2.rs").run(); | ||
rustc().crate_type("bin").input("baz2.rs").run(); | ||
}); | ||
test_with_teardown(|| { | ||
rustc().crate_type("dylib").input("foo.rs").arg("-Cprefer-dynamic").run(); | ||
rustc().crate_type("rlib").input("bar1.rs").run(); | ||
rustc().crate_type("dylib").input("bar2.rs").arg("-Cprefer-dynamic").run(); | ||
rustc().crate_type("dylib,rlib").input("baz2.rs").run(); | ||
rustc().crate_type("bin").input("baz2.rs").run(); | ||
}); | ||
rustc().crate_type("dylib").input("foo.rs").arg("-Cprefer-dynamic").run(); | ||
rustc().crate_type("dylib").input("bar1.rs").arg("-Cprefer-dynamic").run(); | ||
rustc().crate_type("dylib").input("bar2.rs").arg("-Cprefer-dynamic").run(); | ||
rustc().crate_type("dylib,rlib").input("baz2.rs").run(); | ||
rustc().crate_type("bin").input("baz2.rs").run(); | ||
} |