about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-07-28 22:14:48 +0530
committerGitHub <noreply@github.com>2022-07-28 22:14:48 +0530
commita045788430877d39e398a07fd81dc122a8552acd (patch)
tree71ffb732b03301a6031c9e7c972ab4f2971c38b5 /src/test
parent48efd30c9d2eac9c1dc4e3896510ae5ded763d26 (diff)
parent62ad16f1288649d715393eb300f0f3fea9be9663 (diff)
downloadrust-a045788430877d39e398a07fd81dc122a8552acd.tar.gz
rust-a045788430877d39e398a07fd81dc122a8552acd.zip
Rollup merge of #99807 - Nilstrieb:wsl-ui-test-fix, r=Mark-Simulacrum
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.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/linkage-attr/issue-10755.rs5
-rw-r--r--src/test/ui/process/process-spawn-nonexistent.rs12
2 files changed, 11 insertions, 6 deletions
diff --git a/src/test/ui/linkage-attr/issue-10755.rs b/src/test/ui/linkage-attr/issue-10755.rs
index 5ce69bceed3..afd2dc46ca3 100644
--- a/src/test/ui/linkage-attr/issue-10755.rs
+++ b/src/test/ui/linkage-attr/issue-10755.rs
@@ -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() {
 }
diff --git a/src/test/ui/process/process-spawn-nonexistent.rs b/src/test/ui/process/process-spawn-nonexistent.rs
index 70de7316a81..a513722639a 100644
--- a/src/test/ui/process/process-spawn-nonexistent.rs
+++ b/src/test/ui/process/process-spawn-nonexistent.rs
@@ -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
+    ));
 }