Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync changes from mozilla-central gfx/wr #3839

Merged
merged 2 commits into from Jan 22, 2020
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Next

Bug 1610626 - Fix wrench reftest mode incorrectly printing unexpected…

… in some cases. r=Bert

The semantics of the inaccuracy reftest mode are that the overall
test succeeds as long as one of the multiple test images mismatches
the reference image.

However, the previous implementation would print an unexpected result
if any of the comparisons were equal (even though the overall test
result would be reported correctly).

This patch changes wrench so that it only reports an unexpected
failure for the overall test, not each individual reference.

Differential Revision: https://phabricator.services.mozilla.com/D60564

[ghsync] From https://hg.mozilla.org/mozilla-central/rev/3d076ae68a9411e4f412c90d2743987f7b916850
  • Loading branch information
gw3583 authored and moz-gfx committed Jan 22, 2020
commit ac786a5da6edf104c58cf4704bab6d7070de59ee
@@ -149,21 +149,10 @@ impl Reftest {
}
}

/// Check the negative case (expecting inequality) and report details if same
fn check_and_report_inequality_failure(
&self,
comparison: ReftestImageComparison,
) -> bool {
match comparison {
ReftestImageComparison::Equal => {
println!("REFTEST TEST-UNEXPECTED-FAIL | {} | image comparison", self);
println!("REFTEST TEST-END | {}", self);
false
}
ReftestImageComparison::NotEqual { .. } => {
true
}
}
/// Report details of the negative case
fn report_unexpected_equality(&self) {
println!("REFTEST TEST-UNEXPECTED-FAIL | {} | image comparison", self);
println!("REFTEST TEST-END | {}", self);
}
}

@@ -704,7 +693,15 @@ impl<'a> ReftestHarness<'a> {
// Ensure that the final image *doesn't* match the reference
let test = images.pop().unwrap();
let comparison = test.compare(&reference);
t.check_and_report_inequality_failure(comparison)
match comparison {
ReftestImageComparison::Equal => {
t.report_unexpected_equality();
false
}
ReftestImageComparison::NotEqual { .. } => {
true
}
}
}
ReftestOp::Accurate => {
// Ensure that *all* images match the reference
@@ -724,14 +721,18 @@ impl<'a> ReftestHarness<'a> {
}
ReftestOp::Inaccurate => {
// Ensure that at least one of the images doesn't match the reference
let mut found_mismatch = false;
let all_same = images.iter().all(|image| {
match image.compare(&reference) {
ReftestImageComparison::Equal => true,
ReftestImageComparison::NotEqual { .. } => false,
}
});

for test in images.drain(..) {
let comparison = test.compare(&reference);
found_mismatch |= t.check_and_report_inequality_failure(comparison);
if all_same {
t.report_unexpected_equality();
}

found_mismatch
!all_same
}
}
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.