Skip to content

Commit f6cac45

Browse files
committed
Add set-good option
1 parent 3245ae7 commit f6cac45

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

moz-webgpu-cts/src/main.rs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ use camino::Utf8PathBuf;
3030
use clap::{Parser, ValueEnum};
3131
use enumset::EnumSetType;
3232
use format::lazy_format;
33-
use indexmap::{IndexMap, IndexSet};
33+
use indexmap::{Equivalent, IndexMap, IndexSet};
3434
use joinery::JoinableIterator;
3535
use miette::{miette, Diagnostic, IntoDiagnostic, NamedSource, Report, SourceSpan, WrapErr};
3636
use path_dsl::path;
@@ -105,6 +105,8 @@ enum ReportProcessingPreset {
105105
#[value(alias("same-fx"))]
106106
Merge,
107107
ResetAll,
108+
/// Resets only bad->good
109+
SetGood,
108110
}
109111

110112
#[derive(Clone, Copy, Debug, Default, ValueEnum)]
@@ -627,6 +629,18 @@ fn run(cli: Cli) -> ExitCode {
627629
Some(rep) => meta | rep,
628630
None => meta,
629631
},
632+
ReportProcessingPreset::SetGood => {
633+
|meta: Expectation<_>, rep: Option<Expectation<_>>| match rep {
634+
Some(rep) => {
635+
if rep.equivalent(&Expectation::default()) {
636+
rep
637+
} else {
638+
meta
639+
}
640+
}
641+
None => meta,
642+
}
643+
}
630644
};
631645

632646
normalize(
@@ -680,6 +694,9 @@ fn run(cli: Cli) -> ExitCode {
680694
);
681695
return None;
682696
}
697+
ReportProcessingPreset::SetGood => {
698+
log::warn!("no good results in {test_path:?}")
699+
}
683700
}
684701
}
685702

0 commit comments

Comments
 (0)