Skip to content

Commit de5d264

Browse files
committed
rustfix coverage: Skip UI tests with non-json error-format
1 parent 13acecc commit de5d264

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/runtest.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2270,12 +2270,15 @@ actual:\n\
22702270

22712271
if self.config.rustfix_coverage {
22722272
// Find out which tests have `MachineApplicable` suggestions but are missing
2273-
// `run-rustfix` or `run-rustfix-only-machine-applicable` headers
2273+
// `run-rustfix` or `run-rustfix-only-machine-applicable` headers.
2274+
//
2275+
// This will return an empty `Vec` in case the executed test file has a
2276+
// `compile-flags: --error-format=xxxx` header with a value other than `json`.
22742277
let suggestions = get_suggestions_from_json(
22752278
&proc_res.stderr,
22762279
&HashSet::new(),
22772280
Filter::MachineApplicableOnly
2278-
).unwrap();
2281+
).unwrap_or_default();
22792282
if suggestions.len() > 0
22802283
&& !self.props.run_rustfix
22812284
&& !self.props.rustfix_only_machine_applicable {

0 commit comments

Comments
 (0)