Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(270)

Unified Diff: testing/tools/pngdiffer.py

Issue 1892013003: Use platform specific test results as fallback in difference tests (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: address comments Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing/tools/pngdiffer.py
diff --git a/testing/tools/pngdiffer.py b/testing/tools/pngdiffer.py
index bef252674f09d848a37448afb099fb2dd54b1577..79d1b7588a7eeda4df99bc3caa341687e8081954 100755
--- a/testing/tools/pngdiffer.py
+++ b/testing/tools/pngdiffer.py
@@ -49,21 +49,32 @@ class PNGDiffer():
while True:
actual_path = actual_path_template % i
expected_path = expected_path_template % i
+ # PDFium tests should be platform independent. Platform based results are
+ # used to capture platform dependent implementations.
platform_expected_path = (
platform_expected_path_template % (self.os_name, i))
- if os.path.exists(platform_expected_path):
- expected_path = platform_expected_path
- elif not os.path.exists(expected_path):
+ if (not os.path.exists(expected_path) and
+ not os.path.exists(platform_expected_path)):
if i == 0:
print "WARNING: no expected results files for " + input_filename
break
print "Checking " + actual_path
sys.stdout.flush()
- error = common.RunCommand(
- [self.pdfium_diff_path, expected_path, actual_path], redirect_output)
+ if os.path.exists(expected_path):
+ error = common.RunCommand(
+ [self.pdfium_diff_path, expected_path, actual_path],
+ redirect_output)
+ else:
+ error = 1;
if error:
- print "FAILURE: " + input_filename + "; " + str(error)
- return True
+ # When failed, we check against platform based results.
+ if os.path.exists(platform_expected_path):
+ error = common.RunCommand(
+ [self.pdfium_diff_path, platform_expected_path, actual_path],
+ redirect_output)
+ if error:
+ print "FAILURE: " + input_filename + "; " + str(error)
+ return True
i += 1
return False
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698