-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrite and rename issue-22131
and issue-26006
run-make
tests to rmake
#127621
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
extern crate foo; | ||
|
||
pub fn main() { | ||
let _ = foo::hello_world(); | ||
} |
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,3 @@ | ||
pub fn hello_world() -> i32 { | ||
42 | ||
} |
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,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"); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
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,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"); | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Problem: the original test even is wonky, because it was expected to succeed by switching out a local
libc
versus alibc
provided from the sysroot. Let's not try to force a success here, but instead merely check the failure is not from an ICE. Here's what I tried locally that passed on a Windows machine with symlink permissions enabled:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very detailed rework, thank you very much. I have added it to this PR.