summaryrefslogtreecommitdiff
path: root/testing/tools/run_javascript_tests.py
diff options
context:
space:
mode:
authorQin Zhao <zhaoqin@google.com>2015-11-23 16:45:46 -0500
committerQin Zhao <zhaoqin@google.com>2015-11-23 16:45:46 -0500
commit36476923ae5eb8e9283e605f3c85ee8811c86014 (patch)
tree75ed61aafca424d98304dbb55cef127a21d78a7e /testing/tools/run_javascript_tests.py
parent7711b60efc62db14748711727560367d948745f1 (diff)
downloadpdfium-36476923ae5eb8e9283e605f3c85ee8811c86014.tar.xz
Enable Dr. Memory to run javascript, pixel, and corpus testschromium/2575chromium/2574
- 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 .
Diffstat (limited to 'testing/tools/run_javascript_tests.py')
-rwxr-xr-xtesting/tools/run_javascript_tests.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/testing/tools/run_javascript_tests.py b/testing/tools/run_javascript_tests.py
index e2fdc66918..0c2401774e 100755
--- a/testing/tools/run_javascript_tests.py
+++ b/testing/tools/run_javascript_tests.py
@@ -18,7 +18,8 @@ import common
# c_dir - "path/to/a/b/c"
def generate_and_test(input_filename, source_dir, working_dir,
- fixup_path, pdfium_test_path, text_diff_path):
+ fixup_path, pdfium_test_path, text_diff_path,
+ 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')
@@ -29,7 +30,11 @@ def generate_and_test(input_filename, source_dir, working_dir,
subprocess.check_call(
[sys.executable, fixup_path, '--output-dir=' + working_dir, input_path])
with open(txt_path, 'w') as outfile:
- subprocess.check_call([pdfium_test_path, pdf_path], stdout=outfile)
+ # add Dr. Memory wrapper if exist
+ cmd_to_run = common.DrMemoryWrapper(drmem_wrapper, input_root)
+ cmd_to_run.extend([pdfium_test_path, pdf_path])
+ # run test
+ subprocess.check_call(cmd_to_run, stdout=outfile)
subprocess.check_call(
[sys.executable, text_diff_path, expected_path, txt_path])
except subprocess.CalledProcessError as e:
@@ -41,6 +46,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)
@@ -70,7 +77,8 @@ def main():
input_path = os.path.join(source_dir, input_filename)
if os.path.isfile(input_path):
if not generate_and_test(input_filename, source_dir, working_dir,
- fixup_path, pdfium_test_path, text_diff_path):
+ fixup_path, pdfium_test_path, text_diff_path,
+ options.wrapper):
failures.append(input_path)
if failures: