From c3b26b1479824aa5ce745c220a82de7528bc26a9 Mon Sep 17 00:00:00 2001 From: weili Date: Fri, 15 Apr 2016 12:03:00 -0700 Subject: Use platform specific test results as fallback in difference tests So far, we have only two Windows tests require to use platform specific test results due to platform idiosyncracies. However, VS2015 has fixed those issues. So in general, We only need to use platform based results if checking against the regular results failed. Review URL: https://codereview.chromium.org/1892013003 --- testing/tools/pngdiffer.py | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'testing') diff --git a/testing/tools/pngdiffer.py b/testing/tools/pngdiffer.py index bef252674f..79d1b7588a 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 -- cgit v1.2.3