Skip to content

Commit 20c3698

Browse files
refactor(update_expected): inline reconcile arg. entry
We're going to need the split-apart fields in a subsequent refactoring, so do that now.
1 parent 7ed6b85 commit 20c3698

1 file changed

Lines changed: 19 additions & 15 deletions

File tree

moz-webgpu-cts/src/main.rs

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -532,18 +532,12 @@ fn run(cli: Cli) -> ExitCode {
532532
.chain(other_entries_by_test)
533533
.filter_map(|(test_path, test_entry)| {
534534
fn reconcile<Out>(
535-
entry: Entry<Out>,
535+
meta_props: &mut TestProps<Out>,
536+
reported: BTreeMap<Platform, BTreeMap<BuildProfile, Expected<Out>>>,
536537
preset: ReportProcessingPreset,
537-
) -> TestProps<Out>
538-
where
538+
) where
539539
Out: Debug + Default + EnumSetType,
540540
{
541-
let Entry {
542-
meta_props,
543-
reported,
544-
} = entry;
545-
546-
let mut meta_props = meta_props.unwrap_or_default();
547541
let reconciled = 'resolve: {
548542
let reported = |platform, build_profile| {
549543
reported
@@ -587,19 +581,22 @@ fn run(cli: Cli) -> ExitCode {
587581
}
588582
};
589583
meta_props.expected = Some(reconciled);
590-
meta_props
591584
}
592585

593586
let TestEntry {
594-
entry: test_entry,
587+
entry:
588+
Entry {
589+
meta_props: properties,
590+
reported: test_reported,
591+
},
595592
subtests: subtest_entries,
596593
} = test_entry;
597594

598-
if test_entry.meta_props.is_none() {
595+
if properties.is_none() {
599596
log::info!("new test entry: {test_path:?}")
600597
}
601598

602-
if test_entry.reported.is_empty() && using_reports {
599+
if test_reported.is_empty() && using_reports {
603600
let test_path = &test_path;
604601
let msg = lazy_format!("no entries found in reports for {:?}", test_path);
605602
match preset {
@@ -612,7 +609,9 @@ fn run(cli: Cli) -> ExitCode {
612609
}
613610
}
614611

615-
let properties = reconcile(test_entry, preset);
612+
let mut properties = properties.unwrap_or_default();
613+
614+
reconcile(&mut properties, test_reported, preset);
616615

617616
let mut subtests = BTreeMap::new();
618617
for (subtest_name, subtest) in subtest_entries {
@@ -622,8 +621,13 @@ fn run(cli: Cli) -> ExitCode {
622621
log::error!("internal error: duplicate test path {test_path:?}");
623622
}
624623

625-
let mut properties = reconcile(subtest, preset);
624+
let Entry {
625+
meta_props: properties,
626+
reported: subtest_reported,
627+
} = subtest;
626628

629+
let mut properties = properties.unwrap_or_default();
630+
reconcile(&mut properties, subtest_reported, preset);
627631
for (_, expected) in properties.expected.as_mut().unwrap().iter_mut() {
628632
taint_subtest_timeouts_by_suspicion(expected);
629633
}

0 commit comments

Comments
 (0)