Skip to content

Commit 7161e2d

Browse files
authored
Rollup merge of #127621 - Oneirical:hypnotest-show, r=jieyouxu
Rewrite and rename `issue-22131` and `issue-26006` `run-make` tests to rmake Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). Please try: try-job: x86_64-msvc try-job: i686-mingw
2 parents c86e13f + fc4404c commit 7161e2d

File tree

10 files changed

+62
-34
lines changed

10 files changed

+62
-34
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ run-make/interdependent-c-libraries/Makefile
3838
run-make/issue-107094/Makefile
3939
run-make/issue-14698/Makefile
4040
run-make/issue-15460/Makefile
41-
run-make/issue-22131/Makefile
42-
run-make/issue-26006/Makefile
4341
run-make/issue-28595/Makefile
4442
run-make/issue-33329/Makefile
4543
run-make/issue-35164/Makefile
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
extern crate foo;
2+
3+
pub fn main() {
4+
let _ = foo::hello_world();
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pub fn hello_world() -> i32 {
2+
42
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// In this test, the symlink created is invalid (valid relative to the root, but not
2+
// relatively to where it is located), and used to cause an internal
3+
// compiler error (ICE) when passed as a library search path. This was fixed in #26044,
4+
// and this test checks that the invalid symlink is instead simply ignored.
5+
// See https://github.com/rust-lang/rust/issues/26006
6+
7+
//@ needs-symlink
8+
//Reason: symlink requires elevated permission in Windows
9+
10+
use run_make_support::{rfs, rustc};
11+
12+
fn main() {
13+
// We create two libs: `bar` which depends on `foo`. We need to compile `foo` first.
14+
rfs::create_dir("out");
15+
rfs::create_dir("out/foo");
16+
rustc()
17+
.input("in/foo/lib.rs")
18+
.crate_name("foo")
19+
.crate_type("lib")
20+
.metadata("foo")
21+
.output("out/foo/libfoo.rlib")
22+
.run();
23+
rfs::create_dir("out/bar");
24+
rfs::create_dir("out/bar/deps");
25+
rfs::create_symlink("out/foo/libfoo.rlib", "out/bar/deps/libfoo.rlib");
26+
// Check that the invalid symlink does not cause an ICE
27+
rustc()
28+
.input("in/bar/lib.rs")
29+
.library_search_path("dependency=out/bar/deps")
30+
.run_fail()
31+
.assert_exit_code(1)
32+
.assert_stderr_not_contains("internal compiler error");
33+
}

tests/run-make/issue-22131/Makefile

-8
This file was deleted.

tests/run-make/issue-26006/Makefile

-17
This file was deleted.

tests/run-make/issue-26006/in/libc/lib.rs

-3
This file was deleted.

tests/run-make/issue-26006/in/time/lib.rs

-4
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// A rustdoc bug caused the `feature=bar` syntax for the cfg flag to be interpreted
2+
// wrongly, with `feature=bar` instead of just `bar` being understood as the feature name.
3+
// After this was fixed in #22135, this test checks that this bug does not make a resurgence.
4+
// See https://github.com/rust-lang/rust/issues/22131
5+
6+
//@ ignore-cross-compile
7+
// Reason: rustdoc fails to find the "foo" crate
8+
9+
use run_make_support::{cwd, rustc, rustdoc};
10+
11+
fn main() {
12+
rustc().cfg(r#"feature="bar""#).crate_type("lib").input("foo.rs").run();
13+
rustdoc()
14+
.arg("--test")
15+
.arg("--cfg")
16+
.arg(r#"feature="bar""#)
17+
.library_search_path(cwd())
18+
.input("foo.rs")
19+
.run()
20+
.assert_stdout_contains("foo.rs - foo (line 1) ... ok");
21+
}

0 commit comments

Comments
 (0)