diff options
author | Qin Zhao <zhaoqin@google.com> | 2015-11-24 16:11:01 -0500 |
---|---|---|
committer | Qin Zhao <zhaoqin@google.com> | 2015-11-24 16:11:01 -0500 |
commit | ed19d211f96f47e06dc1b597c5a054e17d7e160d (patch) | |
tree | 71dea2880d799870b9ab2141112e1bb87ec384e6 /tools/drmemory/scripts/pdfium_tests.py | |
parent | b599f192d635d97a2f41e8ffc9784e5291b11caf (diff) | |
download | pdfium-ed19d211f96f47e06dc1b597c5a054e17d7e160d.tar.xz |
Merge to XFA: Update pdfium_tests.py to run pdfium tests with Dr. Memory on buildbots
- update pdfium_tests.py to setup Dr. Memory so it can be used directly without
pdfium_tests.bat on buildbots
R=thestig@chromium.org
BUG=PDFium:238
Review URL: https://codereview.chromium.org/1478453002 .
(cherry picked from commit abea9d857e8e197d0095940f882b0db6a785d825)
Review URL: https://codereview.chromium.org/1467183005 .
Diffstat (limited to 'tools/drmemory/scripts/pdfium_tests.py')
-rw-r--r-- | tools/drmemory/scripts/pdfium_tests.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/drmemory/scripts/pdfium_tests.py b/tools/drmemory/scripts/pdfium_tests.py index c1733f5592..de0ce9cea2 100644 --- a/tools/drmemory/scripts/pdfium_tests.py +++ b/tools/drmemory/scripts/pdfium_tests.py @@ -55,10 +55,19 @@ class ChromeTests: # tools/drmemory/scripts relative to the top of the tree. script_dir = os.path.dirname(path_utils.ScriptDir()) self._source_dir = os.path.dirname(os.path.dirname(script_dir)) + # Setup Dr. Memory if it's not set up yet. + drmem_cmd = os.getenv("DRMEMORY_COMMAND") + if not drmem_cmd: + drmem_sfx = os.path.join(script_dir, "drmemory-windows-sfx.exe") + if not os.path.isfile(drmem_sfx): + raise RuntimeError, "Cannot find drmemory-windows-sfx.exe" + drmem_dir = os.path.join(script_dir, "unpacked") + subprocess.call([drmem_sfx, "-o" + drmem_dir, "-y"], 0) + drmem_cmd = os.path.join(drmem_dir, "bin", "drmemory.exe") + os.environ["DRMEMORY_COMMAND"] = drmem_cmd # since this path is used for string matching, make sure it's always # an absolute Unix-style path self._source_dir = os.path.abspath(self._source_dir).replace('\\', '/') - valgrind_test_script = os.path.join(script_dir, "valgrind_test.py") self._command_preamble = ["--source-dir=%s" % (self._source_dir)] if not self._options.build_dir: |