From 5c1efd404f6f0c6bc190101fad3a9977c4e2e6d2 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 19 Jan 2016 15:05:36 -0800 Subject: Merge to XFA: Hook up show-config to testing scripts. Review URL: https://codereview.chromium.org/1607923004 . (cherry picked from commit d40e189ba1ab515ef9b3df7928e215be150df336) TBR=ochang@chromium.org Review URL: https://codereview.chromium.org/1607113002 . --- testing/tools/run_corpus_tests.py | 3 ++- testing/tools/run_javascript_tests.py | 5 +++++ testing/tools/run_pixel_tests.py | 3 ++- testing/tools/suppressor.py | 7 +++++-- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/testing/tools/run_corpus_tests.py b/testing/tools/run_corpus_tests.py index e2b950c363..0c44cc6972 100755 --- a/testing/tools/run_corpus_tests.py +++ b/testing/tools/run_corpus_tests.py @@ -102,7 +102,8 @@ def main(): if not os.path.exists(working_dir): os.makedirs(working_dir) - test_suppressor = suppressor.Suppressor(finder) + feature_string = subprocess.check_output([pdfium_test_path, '--show-config']) + test_suppressor = suppressor.Suppressor(finder, feature_string) image_differ = pngdiffer.PNGDiffer(finder) # test files are under .../pdfium/testing/corpus. diff --git a/testing/tools/run_javascript_tests.py b/testing/tools/run_javascript_tests.py index 0c2401774e..b09ea49e78 100755 --- a/testing/tools/run_javascript_tests.py +++ b/testing/tools/run_javascript_tests.py @@ -63,6 +63,11 @@ def main(): if not os.path.exists(working_dir): os.makedirs(working_dir) + feature_string = subprocess.check_output([pdfium_test_path, '--show-config']) + if "V8" not in feature_string.strip().split(","): + print "V8 not enabled, skipping." + return 0 + input_files = [] if len(args): for file_name in args: diff --git a/testing/tools/run_pixel_tests.py b/testing/tools/run_pixel_tests.py index 8d838402f9..8a102f4c42 100755 --- a/testing/tools/run_pixel_tests.py +++ b/testing/tools/run_pixel_tests.py @@ -70,7 +70,8 @@ def main(): if not os.path.exists(working_dir): os.makedirs(working_dir) - test_suppressor = suppressor.Suppressor(finder) + feature_string = subprocess.check_output([pdfium_test_path, '--show-config']) + test_suppressor = suppressor.Suppressor(finder, feature_string) image_differ = pngdiffer.PNGDiffer(finder) input_files = [] diff --git a/testing/tools/suppressor.py b/testing/tools/suppressor.py index f25db4564b..a1c3171de1 100755 --- a/testing/tools/suppressor.py +++ b/testing/tools/suppressor.py @@ -8,10 +8,13 @@ import os import common class Suppressor: - def __init__(self, finder): + def __init__(self, finder, feature_string): + feature_vector = feature_string.strip().split(",") + v8_option = ["nov8", "v8"]["V8" in feature_vector] + xfa_option = ["noxfa", "xfa"]["XFA" in feature_vector] with open(os.path.join(finder.TestingDir(), 'SUPPRESSIONS')) as f: self.suppression_set = set(self._FilterSuppressions( - common.os_name(), "v8", "xfa", self._ExtractSuppressions(f))) + common.os_name(), v8_option, xfa_option, self._ExtractSuppressions(f))) def _ExtractSuppressions(self, f): return [y.split(' ') for y in -- cgit v1.2.3