Rollup merge of #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.
This commit is contained in:
Matthias Krüger 2023-07-06 12:12:10 +02:00 committed by GitHub
commit f94a0c91cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4022,8 +4022,11 @@ impl<'test> TestCx<'test> {
}
fn normalize_output(&self, output: &str, custom_rules: &[(String, String)]) -> String {
let rflags = self.props.run_flags.as_ref();
let cflags = self.props.compile_flags.join(" ");
let json = cflags.contains("--error-format json")
let json = rflags
.map_or(false, |s| s.contains("--format json") || s.contains("--format=json"))
|| cflags.contains("--error-format json")
|| cflags.contains("--error-format pretty-json")
|| cflags.contains("--error-format=json")
|| cflags.contains("--error-format=pretty-json")