Skip to content

Commit f94a0c9

Browse files
authored
Rollup merge of rust-lang#112295 - ForrestOfBarnes:tests-listing-format-json-windows-fix, r=pietroalbini
Fix the tests-listing-format-json test on Windows tests/ui/test-attrs/tests-listing-json-format.rs was failing on Windows because each path in the json-formatted output contained "\\\\" instead of "\\". `runtest::TestCx::normalize_output` already checks the compile flags for json-related arguments to handle this case, so I added an equivalent check for the new run flag.
2 parents b112bc5 + ec18a34 commit f94a0c9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/tools/compiletest/src/runtest.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4022,8 +4022,11 @@ impl<'test> TestCx<'test> {
40224022
}
40234023

40244024
fn normalize_output(&self, output: &str, custom_rules: &[(String, String)]) -> String {
4025+
let rflags = self.props.run_flags.as_ref();
40254026
let cflags = self.props.compile_flags.join(" ");
4026-
let json = cflags.contains("--error-format json")
4027+
let json = rflags
4028+
.map_or(false, |s| s.contains("--format json") || s.contains("--format=json"))
4029+
|| cflags.contains("--error-format json")
40274030
|| cflags.contains("--error-format pretty-json")
40284031
|| cflags.contains("--error-format=json")
40294032
|| cflags.contains("--error-format=pretty-json")

0 commit comments

Comments
 (0)