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

Unified Diff: scripts/slave/runtest.py

Issue 9949032: Read in gtest_exclude files before running ASAN. (Closed) Base URL: svn://chrome-svn/chrome/trunk/tools/build/
Patch Set: Created 8 years, 8 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/slave/runtest.py
===================================================================
--- scripts/slave/runtest.py (revision 130995)
+++ scripts/slave/runtest.py (working copy)
@@ -129,6 +129,51 @@
except: # pylint: disable=W0702
print 'Unexpected error while generating JSON'
+def _GetGtestFilterForAsan(build_dir, test_name):
+ """Returns an appropriate --gtest_filter flag for googletest binary
+ invocation. A cheap knock off of _AppendGtestFilter() from
+ src/tools/valgrind/chrome_test.py just for ASAN.
+
+ Args:
+ build_dir: the path to the src/build directory.
+ test_name: the name of the test, e.g. browser_tests.
+ """
+ print 'Reading gtest exclude filter files for ASAN:'
+ test_files = [
+ '%s.gtest-asan.txt' % test_name,
+ '%s.gtest-asan_%s.txt' % (test_name, chromium_utils.PlatformName())]
+ gtest_dir = os.path.join(
+ build_dir, '..', 'tools', 'valgrind', 'gtest_exclude')
+ filters = []
+ for test_file in test_files:
+ test_path = os.path.join(gtest_dir, test_file)
+ if not os.path.exists(test_path):
+ print ' "%s" - not found' % test_file
+ continue
+ print ' "%s" - OK' % test_file
+ f = open(test_path, 'r')
+ for line in f.readlines():
+ if line.startswith('#') or line.startswith('//') or line.isspace():
Alexander Potapenko 2012/04/06 07:32:53 I don't mind treating '//' as a comment line, but
+ 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)
+ if not filters:
+ return None
+ gtest_filter = '-'
Alexander Potapenko 2012/04/06 07:32:53 How about joining lines 173 and 174? (and maybe 17
+ gtest_filter += ':'.join(filters)
+ return gtest_filter
+
def start_http_server(platform, build_dir, test_exe_path, document_root):
# pylint: disable=F0401
import google.httpd_utils
@@ -235,6 +280,9 @@
test_exe_path=test_exe_path,
document_root=options.document_root)
if options.factory_properties.get('asan', False):
+ gtest_filter = _GetGtestFilterForAsan(build_dir, args[0])
+ if gtest_filter:
+ command.append('--gtest_filter=%s' % gtest_filter)
symbolize = os.path.abspath(os.path.join('src', 'third_party', 'asan',
'scripts', 'asan_symbolize.py'))
pipes = [[sys.executable, symbolize], ['c++filt']]
@@ -357,6 +405,9 @@
with_wm=options.factory_properties.get('window_manager', True),
server_dir=special_xvfb_dir)
if options.factory_properties.get('asan', False):
+ gtest_filter = _GetGtestFilterForAsan(build_dir, args[0])
+ if gtest_filter:
+ command.append('--gtest_filter=%s' % gtest_filter)
symbolize = os.path.abspath(os.path.join('src', 'third_party', 'asan',
'scripts', 'asan_symbolize.py'))
pipes = [[sys.executable, symbolize], ['c++filt']]
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698