Skip to content

Commit 773f118

Browse files
committed
Add set-good option
1 parent 4841826 commit 773f118

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;
@@ -106,6 +106,8 @@ enum ReportProcessingPreset {
106106
#[value(alias("same-fx"))]
107107
Merge,
108108
ResetAll,
109+
/// Resets only bad->good
110+
SetGood,
109111
}
110112

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

633647
normalize(
@@ -681,6 +695,9 @@ fn run(cli: Cli) -> ExitCode {
681695
);
682696
return None;
683697
}
698+
ReportProcessingPreset::SetGood => {
699+
log::warn!("no good results in {test_path:?}")
700+
}
684701
}
685702
}
686703

0 commit comments

Comments
 (0)