Skip to content

Commit

Permalink
Rollup merge of rust-lang#99807 - Nilstrieb:wsl-ui-test-fix, r=Mark-S…
Browse files Browse the repository at this point in the history
…imulacrum

Fix PermissionDenied UI tests on WSL

On my WSL with `appendWindowsPath=true`, running an invalid command returns `PermissionDenied` instead of `NotFound`, causing two UI tests to fail.
  • Loading branch information
Dylan-DPC committed Jul 28, 2022
2 parents 48efd30 + 62ad16f commit a045788
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
5 changes: 4 additions & 1 deletion src/test/ui/linkage-attr/issue-10755.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
// build-fail
// dont-check-compiler-stderr
// compile-flags: -C linker=llllll -C linker-flavor=ld
// error-pattern: linker `llllll` not found
// error-pattern: `llllll`

// Before, the error-pattern checked for "not found". On WSL with appendWindowsPath=true, running
// in invalid command returns a PermissionDenied instead.

fn main() {
}
12 changes: 7 additions & 5 deletions src/test/ui/process/process-spawn-nonexistent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ use std::io::ErrorKind;
use std::process::Command;

fn main() {
assert_eq!(Command::new("nonexistent")
.spawn()
.unwrap_err()
.kind(),
ErrorKind::NotFound);
let result = Command::new("nonexistent").spawn().unwrap_err().kind();

assert!(matches!(
result,
// Under WSL with appendWindowsPath=true, this fails with PermissionDenied
ErrorKind::NotFound | ErrorKind::PermissionDenied
));
}

0 comments on commit a045788

Please sign in to comment.