Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Unified Diff: tools/drmemory/scripts/pdfium_tests.py

Issue 1464453003: Enable Dr. Memory to run javascript, pixel, and corpus tests (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/drmemory/scripts/pdfium_tests.py
diff --git a/tools/drmemory/scripts/pdfium_tests.py b/tools/drmemory/scripts/pdfium_tests.py
index 5486b16046e0ef6e65cf0806f41e817cde6f7f3d..64c0533ada884ed5ec4dcb436219c6670289a931 100644
--- a/tools/drmemory/scripts/pdfium_tests.py
+++ b/tools/drmemory/scripts/pdfium_tests.py
@@ -269,11 +269,51 @@ class ChromeTests:
def TestPDFiumEmbedderTests(self):
return self.SimpleTest("pdfium_embeddertests", "pdfium_embeddertests")
+ def TestPDFiumTest(self, script_name):
+ # Build the commandline in 'cmd'.
Lei Zhang 2015/11/20 00:17:47 nit: command line
zhaoqin1 2015/11/21 04:20:46 Done.
+ # It's going to be roughly
+ # python valgrind_test.py ...
+ # but we'll use the --indirect_pdfium_test flag to valgrind_test.py
+ # to avoid valgrinding python.
+
+ # Start by building the valgrind_test.py commandline.
+ tool = valgrind_test.CreateTool(self._options.valgrind_tool)
+ cmd = self._DefaultCommand(tool)
+ cmd.append("--trace_children")
+ cmd.append("--indirect_pdfium_test")
+ cmd.append("--ignore_exit_code")
+ # Now build script_cmd, the run_corpus_tests commandline.
+ script = os.path.join(self._source_dir, "..", "testing", "tools", script_name)
Lei Zhang 2015/11/20 00:17:47 80 chars / line, ditto on line 290.
Lei Zhang 2015/11/20 00:17:47 I think the |self._source_dir| calculation is wron
zhaoqin1 2015/11/21 04:20:45 line 57: self._source_dir = os.path.dirname(os.pat
zhaoqin1 2015/11/21 04:20:45 Done.
+ script_cmd = ["python", script]
+ if self._options.build_dir:
+ script_cmd.extend(["--build-dir", self._options.build_dir])
+ # TODO(zhaoqin): figure out why wrapper does not work with test_one_file_parallel
+ # in run_corpus_tests.py, now it only runs in single process mode.
+ if script_name == "run_corpus_tests.py":
+ script_cmd.extend(["-j", "1"])
+ # Now run script_cmd with the wrapper in cmd
+ cmd.extend(["--"])
Lei Zhang 2015/11/20 00:17:47 Just append("--")
zhaoqin1 2015/11/21 04:20:45 Done.
+ cmd.extend(script_cmd)
+
+ ret = tool.Run(cmd, "layout", min_runtime_in_seconds=0)
+ return ret
+
+ def TestPDFiumJavascript(self):
+ return self.TestPDFiumTest("run_javascript_tests.py")
+
+ def TestPDFiumPixel(self):
+ return self.TestPDFiumTest("run_pixel_tests.py")
+
+ def TestPDFiumCorpus(self):
+ return self.TestPDFiumTest("run_corpus_tests.py")
Lei Zhang 2015/11/20 00:17:47 blank line after this
zhaoqin1 2015/11/21 04:20:45 Done.
# The known list of tests.
_test_list = {
"cmdline" : RunCmdLine,
"pdfium_unittests": TestPDFiumUnitTests,
"pdfium_embeddertests": TestPDFiumEmbedderTests,
+ "pdfium_javascript": TestPDFiumJavascript,
Lei Zhang 2015/11/20 00:17:47 Can we sort the list?
zhaoqin1 2015/11/21 04:20:45 Done.
+ "pdfium_pixel": TestPDFiumPixel,
+ "pdfium_corpus": TestPDFiumCorpus,
}

Powered by Google App Engine
This is Rietveld 408576698