Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 7c6d836

Browse files
authoredJul 20, 2024
Rollup merge of rust-lang#127985 - Oneirical:testibule-of-hell, r=Kobzol
Migrate `test-benches`, `c-unwind-abi-catch-panic` and `compiler-lookup-paths-2` `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).
2 parents 863fcea + 2192a91 commit 7c6d836

File tree

7 files changed

+60
-36
lines changed

7 files changed

+60
-36
lines changed
 

‎src/tools/tidy/src/allowed_run_make_makefiles.txt

-3
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@ run-make/c-dynamic-rlib/Makefile
44
run-make/c-static-dylib/Makefile
55
run-make/c-static-rlib/Makefile
66
run-make/c-unwind-abi-catch-lib-panic/Makefile
7-
run-make/c-unwind-abi-catch-panic/Makefile
87
run-make/cat-and-grep-sanity-check/Makefile
98
run-make/cdylib-dylib-linkage/Makefile
10-
run-make/compiler-lookup-paths-2/Makefile
119
run-make/compiler-rt-works-on-mingw/Makefile
1210
run-make/cross-lang-lto-clang/Makefile
1311
run-make/cross-lang-lto-pgo-smoketest/Makefile
@@ -96,7 +94,6 @@ run-make/staticlib-dylib-linkage/Makefile
9694
run-make/symbol-mangling-hashed/Makefile
9795
run-make/symbol-visibility/Makefile
9896
run-make/sysroot-crates-are-unstable/Makefile
99-
run-make/test-benches/Makefile
10097
run-make/thumb-none-cortex-m/Makefile
10198
run-make/thumb-none-qemu/Makefile
10299
run-make/translation/Makefile

‎tests/run-make/c-unwind-abi-catch-panic/Makefile

-10
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// A test for calling `C-unwind` functions across foreign function boundaries (FFI).
2+
// This test triggers a panic when calling a foreign function that calls *back* into Rust.
3+
// This catches a panic across an FFI boundary and downcasts it into an integer.
4+
// The Rust code that panics is in the same directory, unlike `c-unwind-abi-catch-lib-panic`.
5+
// See https://github.com/rust-lang/rust/pull/76570
6+
7+
//@ ignore-cross-compile
8+
// Reason: the compiled binary is executed
9+
//@ needs-unwind
10+
// Reason: this test exercises panic unwinding
11+
12+
use run_make_support::{build_native_static_lib, run, rustc};
13+
14+
fn main() {
15+
build_native_static_lib("add");
16+
rustc().input("main.rs").run();
17+
run("main");
18+
}

‎tests/run-make/compiler-lookup-paths-2/Makefile

-11
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// This test checks that extern crate declarations in Cargo without a corresponding declaration
2+
// in the manifest of a dependency are NOT allowed. The last rustc call does it anyways, which
3+
// should result in a compilation failure.
4+
// See https://github.com/rust-lang/rust/pull/21113
5+
6+
use run_make_support::{path, rfs, rust_lib_name, rustc};
7+
8+
fn main() {
9+
rfs::create_dir("a");
10+
rfs::create_dir("b");
11+
rustc().input("a.rs").run();
12+
rfs::rename(rust_lib_name("a"), path("a").join(rust_lib_name("a")));
13+
rustc().input("b.rs").library_search_path("a").run();
14+
rfs::rename(rust_lib_name("b"), path("b").join(rust_lib_name("b")));
15+
rustc()
16+
.input("c.rs")
17+
.library_search_path("crate=b")
18+
.library_search_path("dependency=a")
19+
.run_fail();
20+
}

‎tests/run-make/test-benches/Makefile

-12
This file was deleted.

‎tests/run-make/test-benches/rmake.rs

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// #[bench] is a Rust feature to run benchmarks on performance-critical
2+
// code, which previously experienced a runtime panic bug in #103794.
3+
// In order to ensure future breakages of this feature are detected, this
4+
// smoke test was created, using the benchmarking feature with various
5+
// runtime flags.
6+
// See https://github.com/rust-lang/rust/issues/103794
7+
8+
//@ ignore-cross-compile
9+
// Reason: the compiled binary is executed
10+
//@ needs-unwind
11+
// Reason: #[bench] and -Zpanic-abort-tests can't be combined
12+
13+
use run_make_support::{run, run_with_args, rustc};
14+
15+
fn main() {
16+
// Smoke-test that #[bench] isn't entirely broken.
17+
rustc().arg("--test").input("smokebench.rs").opt().run();
18+
run_with_args("smokebench", &["--bench"]);
19+
run_with_args("smokebench", &["--bench", "noiter"]);
20+
run_with_args("smokebench", &["--bench", "yesiter"]);
21+
run("smokebench");
22+
}

0 commit comments

Comments
 (0)
Failed to load comments.