Skip to content

Commit

Permalink
Rollup merge of rust-lang#127621 - Oneirical:hypnotest-show, r=jieyouxu
Browse files Browse the repository at this point in the history
Rewrite and rename `issue-22131` and `issue-26006` `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).

Please try:

try-job: x86_64-msvc
try-job: i686-mingw
  • Loading branch information
GuillaumeGomez authored Jul 18, 2024
2 parents ce0be92 + fc4404c commit e761e9b
Show file tree
Hide file tree
Showing 10 changed files with 62 additions and 34 deletions.
2 changes: 0 additions & 2 deletions src/tools/tidy/src/allowed_run_make_makefiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ run-make/interdependent-c-libraries/Makefile
run-make/issue-107094/Makefile
run-make/issue-14698/Makefile
run-make/issue-15460/Makefile
run-make/issue-22131/Makefile
run-make/issue-26006/Makefile
run-make/issue-28595/Makefile
run-make/issue-33329/Makefile
run-make/issue-35164/Makefile
Expand Down
5 changes: 5 additions & 0 deletions tests/run-make/invalid-symlink-search-path/in/bar/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
extern crate foo;

pub fn main() {
let _ = foo::hello_world();
}
3 changes: 3 additions & 0 deletions tests/run-make/invalid-symlink-search-path/in/foo/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pub fn hello_world() -> i32 {
42
}
33 changes: 33 additions & 0 deletions tests/run-make/invalid-symlink-search-path/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// In this test, the symlink created is invalid (valid relative to the root, but not
// relatively to where it is located), and used to cause an internal
// compiler error (ICE) when passed as a library search path. This was fixed in #26044,
// and this test checks that the invalid symlink is instead simply ignored.
// See https://github.com/rust-lang/rust/issues/26006

//@ needs-symlink
//Reason: symlink requires elevated permission in Windows

use run_make_support::{rfs, rustc};

fn main() {
// We create two libs: `bar` which depends on `foo`. We need to compile `foo` first.
rfs::create_dir("out");
rfs::create_dir("out/foo");
rustc()
.input("in/foo/lib.rs")
.crate_name("foo")
.crate_type("lib")
.metadata("foo")
.output("out/foo/libfoo.rlib")
.run();
rfs::create_dir("out/bar");
rfs::create_dir("out/bar/deps");
rfs::create_symlink("out/foo/libfoo.rlib", "out/bar/deps/libfoo.rlib");
// Check that the invalid symlink does not cause an ICE
rustc()
.input("in/bar/lib.rs")
.library_search_path("dependency=out/bar/deps")
.run_fail()
.assert_exit_code(1)
.assert_stderr_not_contains("internal compiler error");
}
8 changes: 0 additions & 8 deletions tests/run-make/issue-22131/Makefile

This file was deleted.

17 changes: 0 additions & 17 deletions tests/run-make/issue-26006/Makefile

This file was deleted.

3 changes: 0 additions & 3 deletions tests/run-make/issue-26006/in/libc/lib.rs

This file was deleted.

4 changes: 0 additions & 4 deletions tests/run-make/issue-26006/in/time/lib.rs

This file was deleted.

File renamed without changes.
21 changes: 21 additions & 0 deletions tests/run-make/rustdoc-cfgspec-parsing/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// A rustdoc bug caused the `feature=bar` syntax for the cfg flag to be interpreted
// wrongly, with `feature=bar` instead of just `bar` being understood as the feature name.
// After this was fixed in #22135, this test checks that this bug does not make a resurgence.
// See https://github.com/rust-lang/rust/issues/22131

//@ ignore-cross-compile
// Reason: rustdoc fails to find the "foo" crate

use run_make_support::{cwd, rustc, rustdoc};

fn main() {
rustc().cfg(r#"feature="bar""#).crate_type("lib").input("foo.rs").run();
rustdoc()
.arg("--test")
.arg("--cfg")
.arg(r#"feature="bar""#)
.library_search_path(cwd())
.input("foo.rs")
.run()
.assert_stdout_contains("foo.rs - foo (line 1) ... ok");
}

0 comments on commit e761e9b

Please sign in to comment.