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

Side by Side Diff: tools/mb/mb.py

Issue 2503503002: MB: Run test with gtest-parallel on swarming. (Closed)
Patch Set: Fixed some bugs. 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 unified diff | Download patch
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 2 # Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
3 # 3 #
4 # Use of this source code is governed by a BSD-style license 4 # Use of this source code is governed by a BSD-style license
5 # that can be found in the LICENSE file in the root of the source 5 # that can be found in the LICENSE file in the root of the source
6 # tree. An additional intellectual property rights grant can be found 6 # tree. An additional intellectual property rights grant can be found
7 # in the file PATENTS. All contributing project authors may 7 # in the file PATENTS. All contributing project authors may
8 # be found in the AUTHORS file in the root of the source tree. 8 # be found in the AUTHORS file in the root of the source tree.
9 9
10 """MB - the Meta-Build wrapper around GYP and GN 10 """MB - the Meta-Build wrapper around GYP and GN
(...skipping 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after
1070 1070
1071 asan = 'is_asan=true' in vals['gn_args'] 1071 asan = 'is_asan=true' in vals['gn_args']
1072 msan = 'is_msan=true' in vals['gn_args'] 1072 msan = 'is_msan=true' in vals['gn_args']
1073 tsan = 'is_tsan=true' in vals['gn_args'] 1073 tsan = 'is_tsan=true' in vals['gn_args']
1074 1074
1075 isolate_map = self.ReadIsolateMap() 1075 isolate_map = self.ReadIsolateMap()
1076 test_type = isolate_map[target]['type'] 1076 test_type = isolate_map[target]['type']
1077 1077
1078 executable = isolate_map[target].get('executable', target) 1078 executable = isolate_map[target].get('executable', target)
1079 executable_suffix = '.exe' if self.platform == 'win32' else '' 1079 executable_suffix = '.exe' if self.platform == 'win32' else ''
1080 executable_preffix = '.\\' if self.platform == 'win32' else './'
1080 1081
1081 cmdline = [] 1082 cmdline = []
1082 extra_files = [] 1083 extra_files = []
1083 1084
1084 if test_type == 'nontest': 1085 if test_type == 'nontest':
1085 self.WriteFailureAndRaise('We should not be isolating %s.' % target, 1086 self.WriteFailureAndRaise('We should not be isolating %s.' % target,
1086 output_path=None) 1087 output_path=None)
1087 1088
1088 if android and test_type != "script": 1089 if android and test_type != "script":
1089 logdog_command = [ 1090 logdog_command = [
(...skipping 11 matching lines...) Expand all
1101 '--target-devices-file', '${SWARMING_BOT_FILE}', 1102 '--target-devices-file', '${SWARMING_BOT_FILE}',
1102 '-v' 1103 '-v'
1103 ] 1104 ]
1104 cmdline = (['./../../build/android/test_wrapper/logdog_wrapper.py'] 1105 cmdline = (['./../../build/android/test_wrapper/logdog_wrapper.py']
1105 + logdog_command + test_cmdline) 1106 + logdog_command + test_cmdline)
1106 elif use_x11 and test_type == 'windowed_test_launcher': 1107 elif use_x11 and test_type == 'windowed_test_launcher':
1107 extra_files = [ 1108 extra_files = [
1108 'xdisplaycheck', 1109 'xdisplaycheck',
1109 '../../testing/test_env.py', 1110 '../../testing/test_env.py',
1110 '../../testing/xvfb.py', 1111 '../../testing/xvfb.py',
1112 '../../third_party/gtest-parallel/gtest-parallel',
1111 ] 1113 ]
1112 cmdline = [ 1114 cmdline = [
1113 '../../testing/xvfb.py', 1115 '../../testing/xvfb.py',
1114 '.', 1116 '.',
1115 './' + str(executable) + executable_suffix, 1117 'python',
1116 '--brave-new-test-launcher', 1118 '../../third_party/gtest-parallel/gtest-parallel',
1117 '--test-launcher-bot-mode', 1119 executable_preffix + str(executable) + executable_suffix,
1120 '--',
1118 '--asan=%d' % asan, 1121 '--asan=%d' % asan,
1119 '--msan=%d' % msan, 1122 '--msan=%d' % msan,
1120 '--tsan=%d' % tsan, 1123 '--tsan=%d' % tsan,
1121 ] 1124 ]
1122 elif test_type in ('windowed_test_launcher', 'console_test_launcher'): 1125 elif test_type in ('windowed_test_launcher', 'console_test_launcher'):
1123 extra_files = [ 1126 extra_files = [
1124 '../../testing/test_env.py' 1127 '../../testing/test_env.py',
1128 '../../third_party/gtest-parallel/gtest-parallel',
1129 ]
1130 cmdline = [
1131 '../../testing/test_env.py',
1132 'python',
1133 '../../third_party/gtest-parallel/gtest-parallel',
1134 executable_preffix + str(executable) + executable_suffix,
kjellander_webrtc 2016/11/15 15:13:36 executable_preffix -> executable_prefix
1135 '--',
1136 '--asan=%d' % asan,
1137 '--msan=%d' % msan,
1138 '--tsan=%d' % tsan,
1139 ]
1140 elif test_type == 'non_parallel':
1141 extra_files = [
1142 '../../testing/test_env.py',
1125 ] 1143 ]
1126 cmdline = [ 1144 cmdline = [
1127 '../../testing/test_env.py', 1145 '../../testing/test_env.py',
1128 './' + str(executable) + executable_suffix, 1146 './' + str(executable) + executable_suffix,
kjellander_webrtc 2016/11/15 15:13:36 This line should be: executable_preffix + str(exec
1129 '--brave-new-test-launcher',
1130 '--test-launcher-bot-mode',
1131 '--asan=%d' % asan, 1147 '--asan=%d' % asan,
1132 '--msan=%d' % msan, 1148 '--msan=%d' % msan,
1133 '--tsan=%d' % tsan, 1149 '--tsan=%d' % tsan,
1134 ] 1150 ]
1135 elif test_type == 'gpu_browser_test':
1136 extra_files = [
1137 '../../testing/test_env.py'
1138 ]
1139 gtest_filter = isolate_map[target]['gtest_filter']
1140 cmdline = [
1141 '../../testing/test_env.py',
1142 './browser_tests' + executable_suffix,
1143 '--test-launcher-bot-mode',
1144 '--enable-gpu',
1145 '--test-launcher-jobs=1',
1146 '--gtest_filter=%s' % gtest_filter,
1147 ]
1148 elif test_type == 'script':
1149 extra_files = [
1150 '../../testing/test_env.py'
1151 ]
1152 cmdline = [
1153 '../../testing/test_env.py',
1154 '../../' + self.ToSrcRelPath(isolate_map[target]['script'])
1155 ]
1156 elif test_type in ('raw'):
1157 extra_files = []
1158 cmdline = [
1159 './' + str(target) + executable_suffix,
1160 ]
1161
1162 else: 1151 else:
1163 self.WriteFailureAndRaise('No command line for %s found (test type %s).' 1152 self.WriteFailureAndRaise('No command line for %s found (test type %s).'
1164 % (target, test_type), output_path=None) 1153 % (target, test_type), output_path=None)
1165 1154
1166 cmdline += isolate_map[target].get('args', []) 1155 cmdline += isolate_map[target].get('args', [])
1167 1156
1168 return cmdline, extra_files 1157 return cmdline, extra_files
1169 1158
1170 def ToAbsPath(self, build_path, *comps): 1159 def ToAbsPath(self, build_path, *comps):
1171 return self.PathJoin(self.chromium_src_dir, 1160 return self.PathJoin(self.chromium_src_dir,
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
1571 # Then check to see if the arg contains any metacharacters other than 1560 # Then check to see if the arg contains any metacharacters other than
1572 # double quotes; if it does, quote everything (including the double 1561 # double quotes; if it does, quote everything (including the double
1573 # quotes) for safety. 1562 # quotes) for safety.
1574 if any(a in UNSAFE_FOR_CMD for a in arg): 1563 if any(a in UNSAFE_FOR_CMD for a in arg):
1575 arg = ''.join('^' + a if a in ALL_META_CHARS else a for a in arg) 1564 arg = ''.join('^' + a if a in ALL_META_CHARS else a for a in arg)
1576 return arg 1565 return arg
1577 1566
1578 1567
1579 if __name__ == '__main__': 1568 if __name__ == '__main__':
1580 sys.exit(main(sys.argv[1:])) 1569 sys.exit(main(sys.argv[1:]))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698