diff options
-rwxr-xr-x | tools/valgrind/chrome_tests.py | 4 | ||||
-rw-r--r-- | tools/valgrind/valgrind_test.py | 15 |
2 files changed, 19 insertions, 0 deletions
diff --git a/tools/valgrind/chrome_tests.py b/tools/valgrind/chrome_tests.py index 5e7ce3e..5e10bd2 100755 --- a/tools/valgrind/chrome_tests.py +++ b/tools/valgrind/chrome_tests.py @@ -73,6 +73,10 @@ class ChromeTests: else: self._options.build_dir = None + if self._options.build_dir: + build_dir = os.path.abspath(self._options.build_dir) + self._command_preamble += ["--build_dir=%s" % (self._options.build_dir)] + def _EnsureBuildDirFound(self): if not self._options.build_dir: raise BuildDirNotFound("Oops, couldn't find a build dir, please " diff --git a/tools/valgrind/valgrind_test.py b/tools/valgrind/valgrind_test.py index 3ea32b5..554b2f7 100644 --- a/tools/valgrind/valgrind_test.py +++ b/tools/valgrind/valgrind_test.py @@ -65,6 +65,8 @@ class BaseTool(object): self._parser.add_option("-t", "--timeout", dest="timeout", metavar="TIMEOUT", default=10000, help="timeout in seconds for the run (default 10000)") + self._parser.add_option("", "--build_dir", + help="the location of the compiler output") self._parser.add_option("", "--source_dir", help="path to top of source tree for this build" "(used to normalize source paths in baseline)") @@ -845,6 +847,19 @@ class DrMemory(BaseTool): proc += ["-logdir", common.NormalizeWindowsPath(self.log_dir)] + if self._options.build_dir: + # The other case is only possible with -t cmdline. + # Anyways, if we omit -symcache_dir the -logdir's value is used which + # should be fine. + symcache_dir = os.path.join(self._options.build_dir, "drmemory.symcache") + if not os.path.exists(symcache_dir): + try: + os.mkdir(symcache_dir) + except OSError: + logging.warning("Can't create symcache dir?") + if os.path.exists(symcache_dir): + proc += ["-symcache_dir", symcache_dir] + # Use -no_summary to suppress DrMemory's summary and init-time # notifications. We generate our own with drmemory_analyze.py. proc += ["-batch", "-no_summary"] |