From 00d4064e5414fc0845e354b50c7f1a8323449268 Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Mon, 30 Jan 2017 19:48:54 -0800 Subject: Fixup test harness When the results of the test runner were converted to return a tuple the following code which checked the results for true/false were not updated to extract the success value from the tuple. This caused the code to think that the results always passed even when they failed. This CL fixes the two tests which were broken (both just minor image result differences) which slipped in during this breakage. Change-Id: I01b56dd7b05013c2c12c83543746cf59b145e561 Reviewed-on: https://pdfium-review.googlesource.com/2456 Reviewed-by: Tom Sepez Commit-Queue: dsinclair --- DEPS | 2 +- samples/BUILD.gn | 3 +++ samples/pdfium_test.cc | 5 +++++ testing/SUPPRESSIONS | 30 ++++++++++++++++++++++++++++++ testing/tools/suppressor.py | 4 ++++ testing/tools/test_runner.py | 11 ++++++----- 6 files changed, 49 insertions(+), 6 deletions(-) diff --git a/DEPS b/DEPS index a93bd2a988..db8817d33b 100644 --- a/DEPS +++ b/DEPS @@ -15,7 +15,7 @@ vars = { 'gtest_revision': '8245545b6dc9c4703e6496d1efd19e975ad2b038', 'icu_revision': '73e24736676b4b438270fda44e5b2c83b49fdd80', 'instrumented_lib_revision': '45f5814b1543e41ea0be54c771e3840ea52cca4a', - 'pdfium_tests_revision': '9d17ef47f310332ac64e78e636681d493482a409', + 'pdfium_tests_revision': '0574927025c223e4c705cb951f592cfef2503500', 'skia_revision': 'f44703a87f532b3f593d91605d66d52c6bbc45c9', 'tools_memory_revision': '427f10475e1a8d72424c29d00bf689122b738e5d', 'trace_event_revision': '06294c8a4a6f744ef284cd63cfe54dbf61eea290', diff --git a/samples/BUILD.gn b/samples/BUILD.gn index 11bc9bab38..23f4d0ca56 100644 --- a/samples/BUILD.gn +++ b/samples/BUILD.gn @@ -30,6 +30,9 @@ config("pdfium_samples_config") { if (pdf_use_skia) { defines += [ "PDF_ENABLE_SKIA" ] } + if (is_asan) { + defines += [ "PDF_ENABLE_ASAN" ] + } if (use_coverage && is_clang) { cflags += [ "--coverage", diff --git a/samples/pdfium_test.cc b/samples/pdfium_test.cc index 1e0a5be50e..a0afd4d09c 100644 --- a/samples/pdfium_test.cc +++ b/samples/pdfium_test.cc @@ -893,6 +893,11 @@ static void ShowConfig() { config.append("XFA"); maybe_comma = ","; #endif // PDF_ENABLE_XFA +#ifdef PDF_ENABLE_ASAN + config.append(maybe_comma); + config.append("ASAN"); + maybe_comma = ","; +#endif // PDF_ENABLE_ASAN printf("%s\n", config.c_str()); } diff --git a/testing/SUPPRESSIONS b/testing/SUPPRESSIONS index 2d5424751b..94c3a5d233 100644 --- a/testing/SUPPRESSIONS +++ b/testing/SUPPRESSIONS @@ -484,6 +484,36 @@ zh_file1.pdf mac * * zh_function_list.pdf mac * * zh_shared_document.pdf mac * * +bug_679643.in * * noxfa +bug_679642.in * * noxfa + +### TODO(dsinclair): These need to be fixed .... +bug_524043_1.pdf * * * +bug_524043_2.pdf * * * +bug_524043_3.pdf * * * +bug_524043_4.pdf * * * +bug_524043_5.pdf * * * +bug_524043_7.pdf * * * +bug_543018_1.pdf * * * +bug_543018_2.pdf * * * +bug_551258_1.pdf * * * +getarray.pdf * * * +example_014.pdf * * * +example_015.pdf * * * +example_054.pdf * * * +event_fieldfull_1_.pdf * * * + +Test_DateField_locale_en_CA.pdf asan * * +Test_DateField_locale_en_GB.pdf asan * * +Test_DateField_locale_en_US.pdf asan * * +Test_DateField_locale_fr_CA.pdf asan * * +Test_DateField_locale_fr_FR.pdf asan * * +Test_DateField_locale_nl_NL.pdf asan * * +Test_DateField_locale_zh_CN.pdf asan * * +Test_DateField_locale_zh_HK.pdf asan * * +Test_PasswordField.pdf asan * * +format_custom_format.pdf asan * * + # # xfa_specific # diff --git a/testing/tools/suppressor.py b/testing/tools/suppressor.py index b7629ef6f8..86d2668adb 100755 --- a/testing/tools/suppressor.py +++ b/testing/tools/suppressor.py @@ -12,8 +12,10 @@ class Suppressor: feature_vector = feature_string.strip().split(",") self.has_v8 = "V8" in feature_vector self.has_xfa = "XFA" in feature_vector + self.is_asan = "ASAN" in feature_vector 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( common.os_name(), v8_option, xfa_option, self._ExtractSuppressions(f))) @@ -31,6 +33,8 @@ class Suppressor: os_column = item[1].split(","); js_column = item[2].split(","); xfa_column = item[3].split(","); + if self.is_asan and 'asan' in os_column: + return True return (('*' in os_column or os in os_column) and ('*' in js_column or js in js_column) and ('*' in xfa_column or xfa in xfa_column)) diff --git a/testing/tools/test_runner.py b/testing/tools/test_runner.py index 3a31709be4..7a64e0ddc3 100644 --- a/testing/tools/test_runner.py +++ b/testing/tools/test_runner.py @@ -125,8 +125,8 @@ class TestRunner: return common.RunCommandExtractHashedFiles(cmd_to_run) def HandleResult(self, input_filename, input_path, result): + success, image_paths = result if self.gold_results: - success, image_paths = result if image_paths: for img_path, md5_hash in image_paths: # the output filename (without extension becomes the test name) @@ -134,10 +134,10 @@ class TestRunner: self.gold_results.AddTestResult(test_name, md5_hash, img_path) if self.test_suppressor.IsResultSuppressed(input_filename): - if result: + if success: self.surprises.append(input_path) else: - if not result: + if not success: self.failures.append(input_path) @@ -271,6 +271,7 @@ class TestRunner: print '\n\nSummary of Failures:' for failure in self.failures: print failure - if not options.ignore_errors: - return 1 + + if not options.ignore_errors: + return 1 return 0 -- cgit v1.2.3