Skip to content

Commit 5ac0d8e

Browse files
Merge pull request #114 from ErichDonGubler/empty-exec-reports
feat(update-expected): accept and warn on empty exec. reports
2 parents d1e1ad9 + 4a6cb97 commit 5ac0d8e

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

moz-webgpu-cts/src/main.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,14 @@ fn run(cli: Cli) -> ExitCode {
392392
.wrap_err("failed to open file")
393393
.and_then(|reader| {
394394
serde_json::from_reader::<_, ExecutionReport>(reader)
395+
.map(Some)
396+
.or_else(|e| {
397+
if e.is_eof() && matches!((e.line(), e.column()), (1, 0)) {
398+
Ok(None)
399+
} else {
400+
Err(e)
401+
}
402+
})
395403
.into_diagnostic()
396404
.wrap_err("failed to parse JSON")
397405
})
@@ -410,11 +418,19 @@ fn run(cli: Cli) -> ExitCode {
410418
});
411419

412420
for res in exec_reports_receiver {
413-
let (_path, exec_report) = match res {
421+
let (path, exec_report) = match res {
414422
Ok(ok) => ok,
415423
Err(AlreadyReportedToCommandline) => return ExitCode::FAILURE,
416424
};
417425

426+
let exec_report = match exec_report {
427+
Some(some) => some,
428+
None => {
429+
log::warn!("empty report found: {}", path.display());
430+
continue;
431+
}
432+
};
433+
418434
let ExecutionReport {
419435
run_info:
420436
RunInfo {

0 commit comments

Comments
 (0)