From 8998024aa388b1d15992133b98fadba1047e4bfe Mon Sep 17 00:00:00 2001 From: czzrr Date: Fri, 19 Aug 2022 22:14:36 +0200 Subject: [PATCH] Correct test-args to compiletest on Windows --- src/bootstrap/test.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index baad0c75295a5..c759d9b88e2ff 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 = + 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");