Skip to content

Commit 8ab562b

Browse files
authored
Rollup merge of rust-lang#100811 - czzrr:master, r=Mark-Simulacrum
Fix wrong compiletest filters on Windows As discussed in [rust-lang#79334](rust-lang#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?
2 parents d662b9c + 8998024 commit 8ab562b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/bootstrap/test.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -1514,7 +1514,15 @@ note: if you're sure you want to do this, please open an issue as to why. In the
15141514

15151515
test_args.append(&mut builder.config.cmd.test_args());
15161516

1517-
cmd.args(&test_args);
1517+
// On Windows, replace forward slashes in test-args by backslashes
1518+
// so the correct filters are passed to libtest
1519+
if cfg!(windows) {
1520+
let test_args_win: Vec<String> =
1521+
test_args.iter().map(|s| s.replace("/", "\\")).collect();
1522+
cmd.args(&test_args_win);
1523+
} else {
1524+
cmd.args(&test_args);
1525+
}
15181526

15191527
if builder.is_verbose() {
15201528
cmd.arg("--verbose");

0 commit comments

Comments
 (0)