Fix windows test

This commit is contained in:
Jakub Beránek 2024-06-08 15:40:07 +02:00
parent 5844b679f3
commit b10a404199
No known key found for this signature in database
GPG Key ID: 909CD0D26483516B
1 changed files with 2 additions and 2 deletions

View File

@ -2,7 +2,7 @@
//! a "hello world" application by setting `PATH` to `C:\Windows\System32`.
//@ only-windows
use run_make_support::{env_var, rustc};
use run_make_support::{cwd, env_var, rustc};
use std::path::PathBuf;
use std::process::Command;
@ -12,7 +12,7 @@ fn main() {
let windows_dir = env_var("SystemRoot");
let system32: PathBuf = [&windows_dir, "System32"].iter().collect();
// Note: This does not use the support wrappers so that we can precisely control the PATH
let exe = "hello.exe";
let exe = cwd().join("hello.exe");
let status = Command::new(exe).env("PATH", &system32).spawn().unwrap().wait().unwrap();
if !status.success() {
panic!("Command failed!\noutput status: `{status}`");