Skip to content

Commit

Permalink
Move all Valgrind/TSan/Dr.Memory gtest exclude files to tools/valgrin…
Browse files Browse the repository at this point in the history
…d/gtest_exclude

If I receive an LGTM, I'll land this patch (with updated .txt files of course)
during the weekend in the Europe afternoon to minimize possible damages.
Then I'll update all the docs accordingly

For the record,
I got the list of the files by doing
find . | grep -v "\.svn" | grep "valgrind.*gtest" | sed "s/\.gtest.*$//" | \
         sed "s/\/[a-z_]\+$//" | sort | uniq | tee list_dirs
And then
for F in `cat list_dirs`; do svn mv $F/*.txt tools/valgrind/gtest_exclude/; done

TEST=ran a few tests locally under Valgrind and TSan
Review URL: http://codereview.chromium.org/4054004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63681 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
timurrrr@chromium.org committed Oct 24, 2010
1 parent 7cb33da commit e56c5cb
Show file tree
Hide file tree
Showing 45 changed files with 65 additions and 54 deletions.
4 changes: 4 additions & 0 deletions base/data/valgrind/DIRECTORY_MOVED
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
For those who got a merge conflict in this directory on update:
The files from this dir has been moved to tools/valgrind/gtest_exclude

TODO(timurrrr): remove this in a couple of weeks
4 changes: 4 additions & 0 deletions chrome/test/data/valgrind/DIRECTORY_MOVED
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
For those who got a merge conflict in this directory on update:
The files from this dir has been moved to tools/valgrind/gtest_exclude

TODO(timurrrr): remove this in a couple of weeks
4 changes: 4 additions & 0 deletions ipc/data/valgrind/DIRECTORY_MOVED
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
For those who got a merge conflict in this directory on update:
The files from this dir has been moved to tools/valgrind/gtest_exclude

TODO(timurrrr): remove this in a couple of weeks
4 changes: 4 additions & 0 deletions net/data/valgrind/DIRECTORY_MOVED
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
For those who got a merge conflict in this directory on update:
The files from this dir has been moved to tools/valgrind/gtest_exclude

TODO(timurrrr): remove this in a couple of weeks
99 changes: 45 additions & 54 deletions tools/valgrind/chrome_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,19 +89,6 @@ def __init__(self, options, args, test):

def _DefaultCommand(self, tool, module, exe=None, valgrind_test_args=None):
'''Generates the default command array that most tests will use.'''
module_dir = os.path.join(self._source_dir, module)

# 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 = [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:
if common.IsWine():
Expand All @@ -119,19 +106,21 @@ def _DefaultCommand(self, tool, module, exe=None, valgrind_test_args=None):
self._options.build_dir = FindNewestDir(dirs)

cmd = list(self._command_preamble)
for directory in self._data_dirs:
tool_name = tool.ToolName();
suppression_file = os.path.join(directory,
"%s/suppressions.txt" % tool_name)
if os.path.exists(suppression_file):
cmd.append("--suppressions=%s" % suppression_file)
# Platform specific suppression
for suppression_platform in common.PlatformNames():
suppression_file_platform = \
os.path.join(directory,
'%s/suppressions_%s.txt' % (tool_name, suppression_platform))
if os.path.exists(suppression_file_platform):
cmd.append("--suppressions=%s" % suppression_file_platform)

# Find all suppressions matching the following pattern:
# tools/valgrind/TOOL/suppressions[_PLATFORM].txt
# and list them with --suppressions= prefix.
script_dir = path_utils.ScriptDir()
tool_name = tool.ToolName();
suppression_file = os.path.join(script_dir, tool_name, "suppressions.txt")
if os.path.exists(suppression_file):
cmd.append("--suppressions=%s" % suppression_file)
# Platform-specific suppression
for platform in common.PlatformNames():
platform_suppression_file = \
os.path.join(script_dir, tool_name, 'suppressions_%s.txt' % platform)
if os.path.exists(platform_suppression_file):
cmd.append("--suppressions=%s" % platform_suppression_file)

if self._options.valgrind_tool_flags:
cmd += self._options.valgrind_tool_flags.split(" ")
Expand Down Expand Up @@ -160,34 +149,36 @@ def _ReadGtestFilterFile(self, tool, name, cmd):
and append the command-line option to cmd.
'''
filters = []
for directory in self._data_dirs:
gtest_filter_files = [
os.path.join(directory, name + ".gtest.txt"),
os.path.join(directory, name + ".gtest-%s.txt" % \
tool.ToolName())]
for platform_suffix in common.PlatformNames():
gtest_filter_files += [
os.path.join(directory, name + ".gtest_%s.txt" % platform_suffix),
os.path.join(directory, name + ".gtest-%s_%s.txt" % \
(tool.ToolName(), platform_suffix))]
for filename in gtest_filter_files:
if os.path.exists(filename):
logging.info("reading gtest filters from %s" % filename)
f = open(filename, 'r')
for line in f.readlines():
if line.startswith("#") or line.startswith("//") or line.isspace():
continue
line = line.rstrip()
test_prefixes = ["FLAKY", "FAILS"]
for p in test_prefixes:
# Strip prefixes from the test names.
line = line.replace(".%s_" % p, ".")
# Exclude the original test name.
filters.append(line)
if line[-2:] != ".*":
# List all possible prefixes if line doesn't end with ".*".
for p in test_prefixes:
filters.append(line.replace(".", ".%s_" % p))
gtest_files_dir = os.path.join(path_utils.ScriptDir(), "gtest_exclude")

gtest_filter_files = [
os.path.join(gtest_files_dir, name + ".gtest.txt"),
os.path.join(gtest_files_dir, name + ".gtest-%s.txt" % tool.ToolName())]
for platform_suffix in common.PlatformNames():
gtest_filter_files += [
os.path.join(gtest_files_dir, name + ".gtest_%s.txt" % platform_suffix),
os.path.join(gtest_files_dir, name + ".gtest-%s_%s.txt" % \
(tool.ToolName(), platform_suffix))]
for filename in gtest_filter_files:
if not os.path.exists(filename):
logging.info("gtest filter file %s not found - skipping" % filename)
continue
logging.info("Reading gtest filters from %s" % filename)
f = open(filename, 'r')
for line in f.readlines():
if line.startswith("#") or line.startswith("//") or line.isspace():
continue
line = line.rstrip()
test_prefixes = ["FLAKY", "FAILS"]
for p in test_prefixes:
# Strip prefixes from the test names.
line = line.replace(".%s_" % p, ".")
# Exclude the original test name.
filters.append(line)
if line[-2:] != ".*":
# List all possible prefixes if line doesn't end with ".*".
for p in test_prefixes:
filters.append(line.replace(".", ".%s_" % p))
# Get rid of duplicates.
filters = set(filters)
gtest_filter = self._gtest_filter
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions webkit/data/valgrind/DIRECTORY_MOVED
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
For those who got a merge conflict in this directory on update:
The files from this dir has been moved to tools/valgrind/gtest_exclude

TODO(timurrrr): remove this in a couple of weeks

0 comments on commit e56c5cb

Please sign in to comment.