diff options
| author | ForrestOfBarnes <fsbarnes@gmail.com> | 2023-06-04 18:25:25 -0600 |
|---|---|---|
| committer | ForrestOfBarnes <fsbarnes@gmail.com> | 2023-06-18 20:06:43 -0600 |
| commit | ec18a34e1b3644fdb4aa1ef8723475ed9a8049d1 (patch) | |
| tree | 023eeb8fe7e6d8492cf57d2391b56ddbba3837af | |
| parent | f217411bacbe943ead9dfca93a91dff0753c2a96 (diff) | |
| download | rust-ec18a34e1b3644fdb4aa1ef8723475ed9a8049d1.tar.gz rust-ec18a34e1b3644fdb4aa1ef8723475ed9a8049d1.zip | |
Fixes tests/ui/test-attrs/tests-listing-format-json.rs on Windows
| -rw-r--r-- | src/tools/compiletest/src/runtest.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 25b16e38e53..0a4ddf59ad3 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -3712,8 +3712,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") |
