forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#125613 - ChrisDenton:windows-recipie, r=jieyouxu
Use `rmake` for `windows-` run-make tests Convert some Makefile tests to recipes. I renamed "issue-85441" to "windows-ws2_32" as I think it's slightly more descriptive. EDIT: `llvm-readobj` seems to work for reading DLL imports so I've used that instead of `objdump`. cc rust-lang#121876
- Loading branch information
Showing
18 changed files
with
78 additions
and
62 deletions.
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
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,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"); | ||
} |
This file was deleted.
Oops, something went wrong.
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,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").linker("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").linker("rust-lld").link_arg("/WHOLEARCHIVE:libbaz.rlib").run(); | ||
} |
This file was deleted.
Oops, something went wrong.
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,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"); | ||
} |
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 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,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")); | ||
} |
1 change: 1 addition & 0 deletions
1
tests/run-make/windows-subsystem/console.rs → tests/ui/windows-subsystem/console.rs
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
//@ run-pass | ||
#![windows_subsystem = "console"] | ||
|
||
fn main() {} |
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions
1
tests/run-make/windows-subsystem/windows.rs → tests/ui/windows-subsystem/windows.rs
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
//@ run-pass | ||
#![windows_subsystem = "windows"] | ||
|
||
fn main() {} |