File tree 1 file changed +2
-2
lines changed
tests/run-make/windows-binary-no-external-deps
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change 2
2
//! a "hello world" application by setting `PATH` to `C:\Windows\System32`.
3
3
//@ only-windows
4
4
5
- use run_make_support:: { env_var, rustc} ;
5
+ use run_make_support:: { env_var, rustc, cwd } ;
6
6
use std:: path:: PathBuf ;
7
7
use std:: process:: Command ;
8
8
@@ -12,7 +12,7 @@ fn main() {
12
12
let windows_dir = env_var ( "SystemRoot" ) ;
13
13
let system32: PathBuf = [ & windows_dir, "System32" ] . iter ( ) . collect ( ) ;
14
14
// Note: This does not use the support wrappers so that we can precisely control the PATH
15
- let exe = "hello.exe" ;
15
+ let exe = cwd ( ) . join ( "hello.exe" ) ;
16
16
let status = Command :: new ( exe) . env ( "PATH" , & system32) . spawn ( ) . unwrap ( ) . wait ( ) . unwrap ( ) ;
17
17
if !status. success ( ) {
18
18
panic ! ( "Command failed!\n output status: `{status}`" ) ;
You can’t perform that action at this time.
0 commit comments