Skip to content
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-14698. issue-33329 and issue-107094 run-make tests to rmake or ui #127820

Merged
merged 3 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/tools/tidy/src/allowed_run_make_makefiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@ run-make/foreign-rust-exceptions/Makefile
run-make/incr-add-rust-src-component/Makefile
run-make/incr-foreign-head-span/Makefile
run-make/interdependent-c-libraries/Makefile
run-make/issue-107094/Makefile
run-make/issue-14698/Makefile
run-make/issue-15460/Makefile
run-make/issue-33329/Makefile
run-make/issue-35164/Makefile
run-make/issue-36710/Makefile
run-make/issue-47551/Makefile
Expand Down
20 changes: 20 additions & 0 deletions tests/run-make/invalid-tmpdir-env-var/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// When the TMP (on Windows) or TMPDIR (on Unix) variable is set to an invalid
// or non-existing directory, this used to cause an internal compiler error (ICE). After the
// addition of proper error handling in #28430, this test checks that the expected message is
// printed.
// See https:/rust-lang/rust/issues/14698

use run_make_support::{is_windows, rustc};

// NOTE: This is not a UI test despite its simplicity, as the error message contains a path
// with some variability that is difficult to normalize

fn main() {
let mut rustc = rustc();
if is_windows() {
rustc.env("TMP", "fake");
} else {
rustc.env("TMPDIR", "fake");
}
rustc.input("foo.rs").run_fail().assert_stderr_contains("couldn't create a temp dir");
}
7 changes: 0 additions & 7 deletions tests/run-make/issue-107094/Makefile

This file was deleted.

4 changes: 0 additions & 4 deletions tests/run-make/issue-14698/Makefile

This file was deleted.

5 changes: 0 additions & 5 deletions tests/run-make/issue-33329/Makefile

This file was deleted.

1 change: 0 additions & 1 deletion tests/run-make/issue-33329/main.rs

This file was deleted.

20 changes: 20 additions & 0 deletions tests/run-make/version-verbose-commit-hash/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// `--version --verbose` should display the git-commit hashes of rustc and rustdoc, but this
// functionality was lost due to #104184. After this feature was returned by #109981, this
// test ensures it will not be broken again.
// See https:/rust-lang/rust/issues/107094

//@ needs-git-hash

use run_make_support::{bare_rustc, bare_rustdoc, regex};

fn main() {
let out_rustc =
bare_rustc().arg("--version").arg("--verbose").run().stdout_utf8().to_lowercase();
let out_rustdoc =
bare_rustdoc().arg("--version").arg("--verbose").run().stdout_utf8().to_lowercase();
let re =
regex::Regex::new(r#"commit-hash: [0-9a-f]{40}\ncommit-date: [0-9]{4}-[0-9]{2}-[0-9]{2}"#)
.unwrap();
assert!(re.is_match(&out_rustc));
assert!(re.is_match(&out_rustdoc));
}
8 changes: 8 additions & 0 deletions tests/ui/errors/wrong-target-spec.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// The attentive may note the underscores in the target triple, making it invalid. This test
// checks that such invalid target specs are rejected by the compiler.
// See https:/rust-lang/rust/issues/33329

//@ needs-llvm-components: x86
//@ compile-flags: --target x86_64_unknown-linux-musl

fn main() {}
2 changes: 2 additions & 0 deletions tests/ui/errors/wrong-target-spec.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
error: Error loading target specification: Could not find specification for target "x86_64_unknown-linux-musl". Run `rustc --print target-list` for a list of built-in targets

Loading