Skip to content

Commit 5ec0c00

Browse files
committed
Convert windows-binary-no-external-deps to rmake
1 parent e03f9cb commit 5ec0c00

File tree

2 files changed

+21
-9
lines changed

2 files changed

+21
-9
lines changed

tests/run-make/windows-binary-no-external-deps/Makefile

-9
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//! Ensure that we aren't relying on any non-system DLLs when running
2+
//! a "hello world" application by setting `PATH` to `C:\Windows\System32`.
3+
//@ only-windows
4+
5+
use run_make_support::{rustc, tmp_dir};
6+
use std::env;
7+
use std::path::PathBuf;
8+
use std::process::Command;
9+
10+
fn main() {
11+
rustc().input("hello.rs").run();
12+
13+
let windows_dir = env::var("SystemRoot").unwrap();
14+
let system32: PathBuf = [&windows_dir, "System32"].iter().collect();
15+
// Note: This does not use the support wrappers so that we can precisely control the PATH
16+
let exe = tmp_dir().join("hello.exe");
17+
let status = Command::new(exe).env("PATH", &system32).spawn().unwrap().wait().unwrap();
18+
if !status.success() {
19+
panic!("Command failed!\noutput status: `{status}`");
20+
}
21+
}

0 commit comments

Comments
 (0)