File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
library/std/src/sys/windows/process Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -186,8 +186,15 @@ fn windows_exe_resolver() {
186186 let temp = tmpdir ( ) ;
187187 let mut exe_path = temp. path ( ) . to_owned ( ) ;
188188 exe_path. push ( "exists.exe" ) ;
189- symlink ( "<DOES NOT EXIST>" . as_ref ( ) , & exe_path) . unwrap ( ) ;
190189
191190 // A broken symlink should still be resolved.
192- assert ! ( resolve_exe( OsStr :: new( "exists.exe" ) , empty_paths, Some ( temp. path( ) . as_ref( ) ) ) . is_ok( ) ) ;
191+ // Skip this check if not in CI and creating symlinks isn't possible.
192+ let is_ci = env:: var ( "CI" ) . is_ok ( ) ;
193+ let result = symlink ( "<DOES NOT EXIST>" . as_ref ( ) , & exe_path) ;
194+ if is_ci || result. is_ok ( ) {
195+ result. unwrap ( ) ;
196+ assert ! (
197+ resolve_exe( OsStr :: new( "exists.exe" ) , empty_paths, Some ( temp. path( ) . as_ref( ) ) ) . is_ok( )
198+ ) ;
199+ }
193200}
You can’t perform that action at this time.
0 commit comments