OLD | NEW |
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 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1080 '../../tools-webrtc/valgrind/webrtc_tests.sh', | 1080 '../../tools-webrtc/valgrind/webrtc_tests.sh', |
1081 '--tool', | 1081 '--tool', |
1082 'memcheck', | 1082 'memcheck', |
1083 '--target', | 1083 '--target', |
1084 'Release', | 1084 'Release', |
1085 '--build-dir', | 1085 '--build-dir', |
1086 '..', | 1086 '..', |
1087 '--test', | 1087 '--test', |
1088 ] | 1088 ] |
1089 | 1089 |
1090 gtest_parallel = (test_type != 'non_parallel_console_test_launcher' and | 1090 if not memcheck: |
1091 not memcheck) | |
1092 if gtest_parallel: | |
1093 extra_files += [ | 1091 extra_files += [ |
1094 '../../third_party/gtest-parallel/gtest-parallel', | 1092 '../../third_party/gtest-parallel/gtest-parallel', |
1095 '../../tools-webrtc/gtest-parallel-wrapper.py', | 1093 '../../tools-webrtc/gtest-parallel-wrapper.py', |
1096 ] | 1094 ] |
1097 sep = '\\' if self.platform == 'win32' else '/' | 1095 sep = '\\' if self.platform == 'win32' else '/' |
1098 output_dir = '${ISOLATED_OUTDIR}' + sep + 'test_logs' | 1096 output_dir = '${ISOLATED_OUTDIR}' + sep + 'test_logs' |
1099 gtest_parallel_wrapper = [ | 1097 gtest_parallel_wrapper = [ |
1100 '../../tools-webrtc/gtest-parallel-wrapper.py', | 1098 '../../tools-webrtc/gtest-parallel-wrapper.py', |
1101 '--output_dir=%s' % output_dir, | 1099 '--output_dir=%s' % output_dir, |
1102 ] | 1100 ] |
1103 | 1101 |
1104 asan = 'is_asan=true' in vals['gn_args'] | 1102 asan = 'is_asan=true' in vals['gn_args'] |
1105 msan = 'is_msan=true' in vals['gn_args'] | 1103 msan = 'is_msan=true' in vals['gn_args'] |
1106 tsan = 'is_tsan=true' in vals['gn_args'] | 1104 tsan = 'is_tsan=true' in vals['gn_args'] |
1107 | 1105 |
1108 executable_prefix = '.\\' if self.platform == 'win32' else './' | 1106 executable_prefix = '.\\' if self.platform == 'win32' else './' |
1109 executable_suffix = '.exe' if self.platform == 'win32' else '' | 1107 executable_suffix = '.exe' if self.platform == 'win32' else '' |
1110 executable = executable_prefix + target + executable_suffix | 1108 executable = executable_prefix + target + executable_suffix |
1111 | 1109 |
1112 cmdline = (['../../testing/xvfb.py'] if xvfb else | 1110 cmdline = (['../../testing/xvfb.py'] if xvfb else |
1113 ['../../testing/test_env.py']) | 1111 ['../../testing/test_env.py']) |
1114 if memcheck: | 1112 cmdline += memcheck_cmdline if memcheck else gtest_parallel_wrapper |
1115 cmdline += memcheck_cmdline | 1113 cmdline.append(executable) |
1116 elif gtest_parallel: | 1114 if test_type == 'non_parallel_console_test_launcher' and not memcheck: |
1117 cmdline += gtest_parallel_wrapper | 1115 # Still use the gtest-parallel-wrapper.py script since we need it to |
1118 cmdline += [ | 1116 # run tests on swarming, but don't execute tests in parallel. |
1119 executable, | 1117 cmdline.append('--workers=1') |
| 1118 |
| 1119 cmdline.extend([ |
1120 '--', | 1120 '--', |
1121 '--asan=%d' % asan, | 1121 '--asan=%d' % asan, |
1122 '--msan=%d' % msan, | 1122 '--msan=%d' % msan, |
1123 '--tsan=%d' % tsan, | 1123 '--tsan=%d' % tsan, |
1124 ] | 1124 ]) |
1125 | 1125 |
1126 cmdline += isolate_map[target].get('args', []) | 1126 cmdline += isolate_map[target].get('args', []) |
1127 | 1127 |
1128 return cmdline, extra_files | 1128 return cmdline, extra_files |
1129 | 1129 |
1130 def ToAbsPath(self, build_path, *comps): | 1130 def ToAbsPath(self, build_path, *comps): |
1131 return self.PathJoin(self.src_dir, | 1131 return self.PathJoin(self.src_dir, |
1132 self.ToSrcRelPath(build_path), | 1132 self.ToSrcRelPath(build_path), |
1133 *comps) | 1133 *comps) |
1134 | 1134 |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1531 # Then check to see if the arg contains any metacharacters other than | 1531 # Then check to see if the arg contains any metacharacters other than |
1532 # double quotes; if it does, quote everything (including the double | 1532 # double quotes; if it does, quote everything (including the double |
1533 # quotes) for safety. | 1533 # quotes) for safety. |
1534 if any(a in UNSAFE_FOR_CMD for a in arg): | 1534 if any(a in UNSAFE_FOR_CMD for a in arg): |
1535 arg = ''.join('^' + a if a in ALL_META_CHARS else a for a in arg) | 1535 arg = ''.join('^' + a if a in ALL_META_CHARS else a for a in arg) |
1536 return arg | 1536 return arg |
1537 | 1537 |
1538 | 1538 |
1539 if __name__ == '__main__': | 1539 if __name__ == '__main__': |
1540 sys.exit(main(sys.argv[1:])) | 1540 sys.exit(main(sys.argv[1:])) |
OLD | NEW |