summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorYuki Okushi <jtitor@2k36.org>2022-08-27 13:14:18 +0900
committerGitHub <noreply@github.com>2022-08-27 13:14:18 +0900
commit7214f0cfc42c8a63ea039ddb82bd8790884c475f (patch)
treea180655d264a1a521f51e87a346cbd9e022abf4f /src/bootstrap
parent134cc2d6be66e5dd540d703f1fc58353fccfc761 (diff)
parent8998024aa388b1d15992133b98fadba1047e4bfe (diff)
downloadrust-7214f0cfc42c8a63ea039ddb82bd8790884c475f.tar.gz
rust-7214f0cfc42c8a63ea039ddb82bd8790884c475f.zip
Rollup merge of #100811 - czzrr:master, r=Mark-Simulacrum
Fix wrong compiletest filters on Windows

As discussed in [#79334](https://github.com/rust-lang/rust/issues/79334), when calling e.g.
```
python x.py test src/test/ui/expr/compound-assignment/eval-order.rs
```
on Windows, compiletest passes the filter `expr/compound-assignment/eval-order.rs` to libtest, which instead should be `expr\compound-assignment\eval-order.rs`, as that is the file found when collecting tests. This is what I fixed.

I'm not sure how to organize a test for this. Any suggestions?
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/test.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs
index baad0c75295..c759d9b88e2 100644
--- a/src/bootstrap/test.rs
+++ b/src/bootstrap/test.rs
@@ -1514,7 +1514,15 @@ note: if you're sure you want to do this, please open an issue as to why. In the
 
         test_args.append(&mut builder.config.cmd.test_args());
 
-        cmd.args(&test_args);
+        // On Windows, replace forward slashes in test-args by backslashes
+        // so the correct filters are passed to libtest
+        if cfg!(windows) {
+            let test_args_win: Vec<String> =
+                test_args.iter().map(|s| s.replace("/", "\\")).collect();
+            cmd.args(&test_args_win);
+        } else {
+            cmd.args(&test_args);
+        }
 
         if builder.is_verbose() {
             cmd.arg("--verbose");