summaryrefslogtreecommitdiff
path: root/testing/tools/run_pixel_tests.py
diff options
context:
space:
mode:
authorQin Zhao <zhaoqin@google.com>2015-11-23 16:50:49 -0500
committerQin Zhao <zhaoqin@google.com>2015-11-23 16:50:49 -0500
commitfba46da798abae8c8cc0e9329e14bca860c2afc6 (patch)
tree976fd4425cf7bf3099cf4657d64059adaa827b37 /testing/tools/run_pixel_tests.py
parent65db985775e032463cf9ae93ba4c6f7b01961bf0 (diff)
downloadpdfium-fba46da798abae8c8cc0e9329e14bca860c2afc6.tar.xz
Merge to XFA: Enable Dr. Memory to run javascript, pixel, and corpus tests
- add DrMemoryWrapper in common.py to adjust Dr. Memory wrapper - add --wrapper option to run_*_tests.py for Dr. Mempry wrapper - update run_*_tests.py to handle Dr. Memory wrapper - add TestPDFiumTest in pdfium_tests.py to support run_*_tests.py - remove ValgrindTool in valgrind_tests.py R=thestig@chromium.org BUG=pdfium:238 Review URL: https://codereview.chromium.org/1464453003 . (cherry picked from commit 36476923ae5eb8e9283e605f3c85ee8811c86014) Review URL: https://codereview.chromium.org/1465333002 .
Diffstat (limited to 'testing/tools/run_pixel_tests.py')
-rwxr-xr-xtesting/tools/run_pixel_tests.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/testing/tools/run_pixel_tests.py b/testing/tools/run_pixel_tests.py
index b167923b86..8d838402f9 100755
--- a/testing/tools/run_pixel_tests.py
+++ b/testing/tools/run_pixel_tests.py
@@ -20,7 +20,8 @@ import suppressor
# c_dir - "path/to/a/b/c"
def generate_and_test(input_filename, source_dir, working_dir,
- fixup_path, pdfium_test_path, image_differ):
+ fixup_path, pdfium_test_path, image_differ,
+ drmem_wrapper):
input_root, _ = os.path.splitext(input_filename)
input_path = os.path.join(source_dir, input_root + '.in')
pdf_path = os.path.join(working_dir, input_root + '.pdf')
@@ -36,7 +37,11 @@ def generate_and_test(input_filename, source_dir, working_dir,
sys.stdout.flush()
subprocess.check_call(
[sys.executable, fixup_path, '--output-dir=' + working_dir, input_path])
- subprocess.check_call([pdfium_test_path, '--png', pdf_path])
+ # add Dr. Memory wrapper if exist
+ cmd_to_run = common.DrMemoryWrapper(drmem_wrapper, input_root)
+ cmd_to_run.extend([pdfium_test_path, '--png', pdf_path])
+ # run test
+ subprocess.check_call(cmd_to_run)
except subprocess.CalledProcessError as e:
print "FAILURE: " + input_filename + "; " + str(e)
return False
@@ -50,6 +55,8 @@ def main():
parser = optparse.OptionParser()
parser.add_option('--build-dir', default=os.path.join('out', 'Debug'),
help='relative path from the base source directory')
+ parser.add_option('--wrapper', default='', dest="wrapper",
+ help='Dr. Memory wrapper for running test under Dr. Memory')
options, args = parser.parse_args()
finder = common.DirectoryFinder(options.build_dir)
fixup_path = finder.ScriptPath('fixup_pdf_template.py')
@@ -82,7 +89,8 @@ def main():
if test_suppressor.IsSuppressed(input_filename):
continue
if not generate_and_test(input_filename, source_dir, working_dir,
- fixup_path, pdfium_test_path, image_differ):
+ fixup_path, pdfium_test_path, image_differ,
+ options.wrapper):
failures.append(input_path)
if failures: