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

Rollup of 5 pull requests #125624

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
c8b0e5b
The number of tests does not depend on the architecture's pointer width
tbu- May 20, 2024
90fec5a
Add `copy_dir_all` and `recursive_diff` functions to `run-make-support`
GuillaumeGomez May 25, 2024
1551fd1
Add file path in case it cannot be read in `Diff::actual_file`
GuillaumeGomez May 25, 2024
f0ab814
Add `Rustdoc::output_format`
GuillaumeGomez May 25, 2024
bdf3864
Migrate `run-make/rustdoc-verify-output-files` to `rmake.rs`
GuillaumeGomez May 25, 2024
7d24f87
MIR validation: ensure that downcast projection is followed by field …
RalfJung May 27, 2024
b3ee911
Use `rmake` for `windows-` run-make tests
ChrisDenton May 27, 2024
57e68b6
Remove Makefiles from allowed_run_make_makefiles
ChrisDenton May 27, 2024
e081170
Add linker option to run-make-support
ChrisDenton May 27, 2024
ad5dce5
Move run-make windows_subsystem tests to ui tests
ChrisDenton May 27, 2024
e5d1003
crashes: increment the number of tracked ones
matthiaskrgr May 25, 2024
894386a
remove fixed crashes, add fixed crashes to tests, add new cashed foun…
matthiaskrgr May 27, 2024
569f510
Rollup merge of #125339 - tbu-:pr_tidy_ui_tests_u32, r=clubby789
matthiaskrgr May 27, 2024
22e8279
Rollup merge of #125539 - matthiaskrgr:cräsh, r=jieyouxu
matthiaskrgr May 27, 2024
69308e9
Rollup merge of #125542 - GuillaumeGomez:migrate-rustdoc-verify-outpu…
matthiaskrgr May 27, 2024
834914c
Rollup merge of #125613 - ChrisDenton:windows-recipie, r=jieyouxu
matthiaskrgr May 27, 2024
a3d4b5f
Rollup merge of #125616 - RalfJung:mir-validate-downcast-projection, …
matthiaskrgr May 27, 2024
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
Prev Previous commit
Next Next commit
Use rmake for windows- run-make tests
  • Loading branch information
ChrisDenton committed May 27, 2024
commit b3ee91128e7527b16b24bfeca81186490ace0cfa
6 changes: 6 additions & 0 deletions src/tools/run-make-support/src/llvm_readobj.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ impl LlvmReadobj {
self
}

/// Pass `--coff-imports` to display the Windows DLL imports
pub fn coff_imports(&mut self) -> &mut Self {
self.cmd.arg("--coff-imports");
self
}

/// Get the [`Output`][::std::process::Output] of the finished process.
#[track_caller]
pub fn command_output(&mut self) -> ::std::process::Output {
Expand Down
9 changes: 0 additions & 9 deletions tests/run-make/issue-85441/Makefile

This file was deleted.

9 changes: 0 additions & 9 deletions tests/run-make/windows-binary-no-external-deps/Makefile

This file was deleted.

15 changes: 15 additions & 0 deletions tests/run-make/windows-binary-no-external-deps/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//@ only-windows

// Ensure that we aren't relying on any non-system DLLs when compiling and running
// a "hello world" application by setting `PATH` to `C:\Windows\System32`.

use run_make_support::{run, rustc};
use std::env;
use std::path::PathBuf;

fn main() {
let windows_dir = env::var("SystemRoot").unwrap();
let system32: PathBuf = [&windows_dir, "System32"].iter().collect();
rustc().input("hello.rs").env("PATH", system32).run();
run("hello");
}
19 changes: 0 additions & 19 deletions tests/run-make/windows-safeseh/Makefile

This file was deleted.

15 changes: 15 additions & 0 deletions tests/run-make/windows-safeseh/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//@ only-windows
//@ needs-rust-lld

use run_make_support::rustc;

fn main() {
// Ensure that LLD can link when an .rlib contains a synthetic object
// file referencing exported or used symbols.
rustc().input("foo.rs").arg("-Clinker=rust-lld").run();

// Ensure that LLD can link when /WHOLEARCHIVE: is used with an .rlib.
// Previously, lib.rmeta was not marked as (trivially) SAFESEH-aware.
rustc().input("baz.rs").run();
rustc().input("bar.rs").arg("-Clinker=rust-lld").link_arg("/WHOLEARCHIVE:libbaz.rlib").run();
}
8 changes: 0 additions & 8 deletions tests/run-make/windows-spawn/Makefile

This file was deleted.

17 changes: 17 additions & 0 deletions tests/run-make/windows-spawn/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//@ only-windows

use run_make_support::{run, rustc, tmp_dir};

// On Windows `Command` uses `CreateProcessW` to run a new process.
// However, in the past std used to not pass in the application name, leaving
// `CreateProcessW` to use heuristics to guess the intended name from the
// command line string. Sometimes this could go very wrong.
// E.g. in Rust 1.0 `Command::new("foo").arg("bar").spawn()` will try to launch
// `foo bar.exe` if foo.exe does not exist. Which is clearly not desired.

fn main() {
let out_dir = tmp_dir();
rustc().input("hello.rs").output(out_dir.join("hopefullydoesntexist bar.exe")).run();
rustc().input("spawn.rs").run();
run("spawn");
}
10 changes: 4 additions & 6 deletions tests/run-make/windows-spawn/spawn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ use std::process::Command;

fn main() {
// Make sure it doesn't try to run "hopefullydoesntexist bar.exe".
assert_eq!(Command::new("hopefullydoesntexist")
.arg("bar")
.spawn()
.unwrap_err()
.kind(),
ErrorKind::NotFound);
assert_eq!(
Command::new("hopefullydoesntexist").arg("bar").spawn().unwrap_err().kind(),
ErrorKind::NotFound
)
}
6 changes: 0 additions & 6 deletions tests/run-make/windows-subsystem/Makefile

This file was deleted.

8 changes: 8 additions & 0 deletions tests/run-make/windows-subsystem/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//@ ignore-cross-compile

use run_make_support::rustc;

fn main() {
rustc().input("windows.rs").run();
rustc().input("console.rs").run();
}
13 changes: 13 additions & 0 deletions tests/run-make/windows-ws2_32/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//@ only-msvc

// Tests that WS2_32.dll is not unnecessarily linked, see issue #85441

use run_make_support::{llvm_readobj, rustc, tmp_dir};

fn main() {
rustc().input("empty.rs").run();
let empty = tmp_dir().join("empty.exe");
let output = llvm_readobj().input(empty).coff_imports().run();
let output = String::from_utf8(output.stdout).unwrap();
assert!(!output.to_ascii_uppercase().contains("WS2_32.DLL"));
}