diff options
author | Henrique Nakashima <hnakashima@chromium.org> | 2017-06-27 09:48:24 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-06-27 14:47:12 +0000 |
commit | 3bcabf323f096156545d279c6381317fbc7fbd5a (patch) | |
tree | b74e10a273dfe7f44914de4a816a9389100f364c /testing/tools/suppressor.py | |
parent | d261b065d09046bbcc6594e48220cff44a371732 (diff) | |
download | pdfium-3bcabf323f096156545d279c6381317fbc7fbd5a.tar.xz |
Fail pixel tests when they do not provide the expected image.
Also showing stats on number of failures, successes, suppressions,
etc.
Change-Id: Id12faf504ea8d6b1c343d7a8b412d03dc787ca3a
Reviewed-on: https://pdfium-review.googlesource.com/6834
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'testing/tools/suppressor.py')
-rwxr-xr-x | testing/tools/suppressor.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/testing/tools/suppressor.py b/testing/tools/suppressor.py index 3b2872df95..be03e21516 100755 --- a/testing/tools/suppressor.py +++ b/testing/tools/suppressor.py @@ -12,11 +12,15 @@ class Suppressor: feature_vector = feature_string.strip().split(",") self.has_v8 = "V8" in feature_vector self.has_xfa = "XFA" in feature_vector + self.suppression_set = self._LoadSuppressedSet('SUPPRESSIONS', finder) + self.pixel_suppression_set = self._LoadSuppressedSet('SUPPRESSIONS_PIXEL', + finder) + + def _LoadSuppressedSet(self, suppressions_filename, finder): v8_option = "v8" if self.has_v8 else "nov8" xfa_option = "xfa" if self.has_xfa else "noxfa" - - with open(os.path.join(finder.TestingDir(), 'SUPPRESSIONS')) as f: - self.suppression_set = set(self._FilterSuppressions( + with open(os.path.join(finder.TestingDir(), suppressions_filename)) as f: + return set(self._FilterSuppressions( common.os_name(), v8_option, xfa_option, self._ExtractSuppressions(f))) def _ExtractSuppressions(self, f): @@ -47,3 +51,9 @@ class Suppressor: print "%s execution is suppressed" % input_filepath return True return False + + def IsPixelDiffSuppressed(self, input_filename): + if input_filename in self.pixel_suppression_set: + print "%s is pixel suppressed" % input_filename + return True + return False |