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

Unified Diff: tools/mb/mb.py

Issue 2510033004: Add rtc_use_memcheck flag, update MB and GN to handle it, and add gni files listing the runtime deps (Closed)
Patch Set: Fixed android and added unittest. Created 4 years, 1 month 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 | tools/mb/mb_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/mb/mb.py
diff --git a/tools/mb/mb.py b/tools/mb/mb.py
index 02070c52dbe22d7e2d16ce83006cf8d8b7b63e0f..bf3e1f6f0b88229cd501d08e212bae7538a23c95 100755
--- a/tools/mb/mb.py
+++ b/tools/mb/mb.py
@@ -1060,40 +1060,25 @@ class MetaBuildWrapper(object):
return ret
def GetIsolateCommand(self, target, vals):
- android = 'target_os="android"' in vals['gn_args']
-
- # This needs to mirror the settings in //build/config/ui.gni:
- # use_x11 = is_linux && !use_ozone.
- use_x11 = (self.platform == 'linux2' and
- not android and
- not 'use_ozone=true' in vals['gn_args'])
-
- asan = 'is_asan=true' in vals['gn_args']
- msan = 'is_msan=true' in vals['gn_args']
- tsan = 'is_tsan=true' in vals['gn_args']
-
isolate_map = self.ReadIsolateMap()
test_type = isolate_map[target]['type']
- executable = isolate_map[target].get('executable', target)
- executable_suffix = '.exe' if self.platform == 'win32' else ''
- executable_prefix = '.\\' if self.platform == 'win32' else './'
-
- cmdline = []
- extra_files = []
- common_cmdline = [
- executable_prefix + str(executable) + executable_suffix,
- '--',
- '--asan=%d' % asan,
- '--msan=%d' % msan,
- '--tsan=%d' % tsan,
- ]
+ android = 'target_os="android"' in vals['gn_args']
+ is_linux = self.platform == 'linux2' and not android
if test_type == 'nontest':
self.WriteFailureAndRaise('We should not be isolating %s.' % target,
output_path=None)
+ if test_type not in ('console_test_launcher', 'windowed_test_launcher',
+ 'non_parallel_console_test_launcher',
+ 'additional_compile_target', 'junit_test'):
+ self.WriteFailureAndRaise('No command line for %s found (test type %s).'
+ % (target, test_type), output_path=None)
- if android and test_type != "script":
+ cmdline = []
+ extra_files = []
+
+ if android:
logdog_command = [
'--logdog-bin-cmd', './../../bin/logdog_butler',
'--project', 'chromium',
@@ -1107,45 +1092,70 @@ class MetaBuildWrapper(object):
self.PathJoin('bin', 'run_%s' % target),
'--logcat-output-file', '${ISOLATED_OUTDIR}/logcats',
'--target-devices-file', '${SWARMING_BOT_FILE}',
- '-v'
+ '-v',
]
cmdline = (['./../../build/android/test_wrapper/logdog_wrapper.py']
+ logdog_command + test_cmdline)
- elif use_x11 and test_type == 'windowed_test_launcher':
- extra_files = [
- 'xdisplaycheck',
- '../../testing/test_env.py',
- '../../testing/xvfb.py',
- '../../third_party/gtest-parallel/gtest-parallel',
- '../../third_party/gtest-parallel/gtest-parallel-wrapper.py',
+ else:
+ extra_files = ['../../testing/test_env.py']
+
+ # This needs to mirror the settings in //build/config/ui.gni:
+ # use_x11 = is_linux && !use_ozone.
+ use_x11 = is_linux and not 'use_ozone=true' in vals['gn_args']
+
+ xvfb = use_x11 and test_type == 'windowed_test_launcher'
+ if xvfb:
+ extra_files += [
+ 'xdisplaycheck',
+ '../../testing/xvfb.py',
+ ]
+
+ # Memcheck is only supported for linux. Ignore in other platforms.
+ memcheck = is_linux and 'rtc_use_memcheck=true' in vals['gn_args']
+ memcheck_cmdline = [
+ 'bash',
+ '../../tools/valgrind-webrtc/webrtc_tests.sh',
+ '--tool',
+ 'memcheck',
+ '--target',
+ 'Release',
+ '--build-dir',
+ '..',
+ '--test',
]
- cmdline = [
- '../../testing/xvfb.py',
- '.',
- '../../third_party/gtest-parallel/gtest-parallel-wrapper.py',
- ] + common_cmdline
- elif test_type in ('windowed_test_launcher', 'console_test_launcher'):
- extra_files = [
- '../../testing/test_env.py',
- '../../third_party/gtest-parallel/gtest-parallel',
- '../../third_party/gtest-parallel/gtest-parallel-wrapper.py',
+
+ gtest_parallel = (test_type != 'non_parallel_console_test_launcher' and
+ not memcheck)
+ gtest_parallel_wrapper = [
+ '../../third_party/gtest-parallel/gtest-parallel-wrapper.py'
]
- cmdline = [
- '../../testing/test_env.py',
- '../../third_party/gtest-parallel/gtest-parallel-wrapper.py',
- ] + common_cmdline
- elif test_type == 'non_parallel_console_test_launcher':
- extra_files = [
- '../../testing/test_env.py',
+ if gtest_parallel:
+ extra_files += [
+ '../../third_party/gtest-parallel/gtest-parallel',
+ '../../third_party/gtest-parallel/gtest-parallel-wrapper.py',
+ ]
+
+ asan = 'is_asan=true' in vals['gn_args']
+ msan = 'is_msan=true' in vals['gn_args']
+ tsan = 'is_tsan=true' in vals['gn_args']
+
+ executable_prefix = '.\\' if self.platform == 'win32' else './'
+ executable_suffix = '.exe' if self.platform == 'win32' else ''
+ executable = executable_prefix + target + executable_suffix
+
+ cmdline = (['../../testing/xvfb.py', '.'] if xvfb else
+ ['../../testing/test_env.py'])
+ if memcheck:
+ cmdline += memcheck_cmdline
+ elif gtest_parallel:
+ cmdline += gtest_parallel_wrapper
+ cmdline += [
+ executable,
+ '--',
+ '--asan=%d' % asan,
+ '--msan=%d' % msan,
+ '--tsan=%d' % tsan,
]
- cmdline = [
- '../../testing/test_env.py',
- ] + common_cmdline
- else:
- self.WriteFailureAndRaise('No command line for %s found (test type %s).'
- % (target, test_type), output_path=None)
-
- cmdline += isolate_map[target].get('args', [])
return cmdline, extra_files
« no previous file with comments | « no previous file | tools/mb/mb_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698