Chromium Code Reviews| Index: tools/mb/mb.py | 
| diff --git a/tools/mb/mb.py b/tools/mb/mb.py | 
| index 19926c9803e4a95b4fd9cd123db8eaa32ebbc2b4..9008a34f58d15795ca1b47afc11dc80b682b9953 100755 | 
| --- a/tools/mb/mb.py | 
| +++ b/tools/mb/mb.py | 
| @@ -1061,12 +1061,14 @@ class MetaBuildWrapper(object): | 
| def GetIsolateCommand(self, target, vals): | 
| android = 'target_os="android"' in vals['gn_args'] | 
| + is_linux = self.platform == 'linux2' and not android | 
| + | 
| + # Memcheck is only supported for linux. Ignore in other platforms. | 
| + memcheck = is_linux and 'rtc_use_memcheck=true' 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']) | 
| + use_x11 = is_linux and not 'use_ozone=true' in vals['gn_args'] | 
| 
 
kjellander_webrtc
2016/11/21 08:33:59
Ouch, so there's logic in here that will change th
 
ehmaldonado_webrtc
2016/11/21 10:51:55
No, this doesn't override the logic in the GN vari
 
ehmaldonado_webrtc
2016/11/21 11:02:07
So, MB only has access to the GN flags that we pas
 
 | 
| asan = 'is_asan=true' in vals['gn_args'] | 
| msan = 'is_msan=true' in vals['gn_args'] | 
| @@ -1081,6 +1083,22 @@ class MetaBuildWrapper(object): | 
| cmdline = [] | 
| extra_files = [] | 
| + | 
| + gtest_cmdline = [ | 
| + 'python', | 
| + '../../third_party/gtest-parallel/gtest-parallel', | 
| + ] | 
| + memcheck_cmdline = [ | 
| + 'bash', | 
| + '../../tools/valgrind-webrtc/webrtc_tests.sh', | 
| + '--tool', | 
| + 'memcheck', | 
| + '--target', | 
| + 'Release', | 
| + '--build-dir', | 
| + '..', | 
| + '--test', | 
| + ] | 
| common_cmdline = [ | 
| executable_prefix + str(executable) + executable_suffix, | 
| '--', | 
| @@ -1121,26 +1139,33 @@ class MetaBuildWrapper(object): | 
| cmdline = [ | 
| '../../testing/xvfb.py', | 
| '.', | 
| - 'python', | 
| - '../../third_party/gtest-parallel/gtest-parallel', | 
| - ] + common_cmdline | 
| + ] | 
| + if memcheck: | 
| 
 
kjellander_webrtc
2016/11/21 08:33:58
There must be a way to avoid duplicating this sect
 
 | 
| + cmdline += memcheck_cmdline | 
| + else: | 
| + cmdline += gtest_cmdline | 
| + cmdline += common_cmdline | 
| elif test_type in ('windowed_test_launcher', 'console_test_launcher'): | 
| extra_files = [ | 
| '../../testing/test_env.py', | 
| '../../third_party/gtest-parallel/gtest-parallel', | 
| ] | 
| - cmdline = [ | 
| - '../../testing/test_env.py', | 
| - 'python', | 
| - '../../third_party/gtest-parallel/gtest-parallel', | 
| - ] + common_cmdline | 
| + cmdline = [ '../../testing/test_env.py' ] | 
| + if memcheck: | 
| 
 
kjellander_webrtc
2016/11/21 08:33:58
You could write this on just one line:
cmdline +=
 
 | 
| + cmdline += memcheck_cmdline | 
| + else: | 
| + cmdline += gtest_cmdline | 
| + cmdline += common_cmdline | 
| elif test_type == 'non_parallel_console_test_launcher': | 
| extra_files = [ | 
| '../../testing/test_env.py', | 
| ] | 
| cmdline = [ | 
| '../../testing/test_env.py', | 
| - ] + common_cmdline | 
| + ] | 
| + if memcheck: | 
| + cmdline += memcheck_cmdline | 
| + cmdline += common_cmdline | 
| else: | 
| self.WriteFailureAndRaise('No command line for %s found (test type %s).' | 
| % (target, test_type), output_path=None) |