diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-09 21:33:26 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-09 21:33:26 +0000 |
commit | 4d16f4c72c872cb8b1b7399617d887e86e10dbab (patch) | |
tree | 8ec03974518a10adc380d3839117bc6033d74902 /tools/valgrind/chrome_tests.py | |
parent | 13a96c981dc1dfc826e6592408e910d8284ccc52 (diff) | |
download | chromium_src-4d16f4c72c872cb8b1b7399617d887e86e10dbab.zip chromium_src-4d16f4c72c872cb8b1b7399617d887e86e10dbab.tar.gz chromium_src-4d16f4c72c872cb8b1b7399617d887e86e10dbab.tar.bz2 |
Add support for per-module suppression files.
Also fixes a typo in logging.
Review URL: http://codereview.chromium.org/17321
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7837 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/valgrind/chrome_tests.py')
-rwxr-xr-x | tools/valgrind/chrome_tests.py | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/tools/valgrind/chrome_tests.py b/tools/valgrind/chrome_tests.py index d393353..0292f14 100755 --- a/tools/valgrind/chrome_tests.py +++ b/tools/valgrind/chrome_tests.py @@ -82,10 +82,17 @@ class ChromeTests: '''Generates the default command array that most tests will use.''' module_dir = os.path.join(self._source_dir, module) - # For now, the suppressions files are all the same across all modules. Copy - # the code in the purify version of chrome_tests.py if we ever need - # per-module suppressions again... - self._data_dir = google.path_utils.ScriptDir() + # We need multiple data dirs, the current script directory and a module + # specific one. The global suppression file lives in our directory, and the + # module specific suppression file lives with the module. + self._data_dirs = [google.path_utils.ScriptDir()] + + if module == "chrome": + # unfortunately, not all modules have the same directory structure + self._data_dirs.append(os.path.join(module_dir, "test", "data", + "valgrind")) + else: + self._data_dirs.append(os.path.join(module_dir, "data", "valgrind")) if not self._options.build_dir: dir_chrome = os.path.join(self._source_dir, "chrome", "Hammer") @@ -114,7 +121,10 @@ class ChromeTests: self._options.build_dir = dir_chrome cmd = list(self._command_preamble) - cmd.append("--data_dir=%s" % self._data_dir) + for directory in self._data_dirs: + suppression_file = os.path.join(directory, "suppressions.txt") + if os.path.exists(suppression_file): + cmd.append("--suppressions=%s" % suppression_file) if self._options.baseline: cmd.append("--baseline") if self._options.verbose: @@ -135,14 +145,15 @@ class ChromeTests: and append the command-line option to cmd. ''' filters = [] - filename = os.path.join(self._data_dir, name + ".gtest.txt") - if os.path.exists(filename): - f = open(filename, 'r') - for line in f.readlines(): - if line.startswith("#") or line.startswith("//") or line.isspace(): - continue - line = line.rstrip() - filters.append(line) + for directory in self._data_dirs: + filename = os.path.join(directory, name + ".gtest.txt") + if os.path.exists(filename): + f = open(filename, 'r') + for line in f.readlines(): + if line.startswith("#") or line.startswith("//") or line.isspace(): + continue + line = line.rstrip() + filters.append(line) gtest_filter = self._options.gtest_filter if len(filters): if gtest_filter: |