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 @@ fn run(self, builder: &Builder<'_>) { 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 = + 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");