OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2015 The Chromium Authors. All rights reserved. | 2 # Copyright 2015 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """MB - the Meta-Build wrapper around GYP and GN | 6 """MB - the Meta-Build wrapper around GYP and GN |
7 | 7 |
8 MB is a wrapper script for GYP and GN that can be used to generate build files | 8 MB is a wrapper script for GYP and GN that can be used to generate build files |
9 for sets of canned configurations and analyze them. | 9 for sets of canned configurations and analyze them. |
10 """ | 10 """ |
(...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1053 self.PrintJSON(outp) | 1053 self.PrintJSON(outp) |
1054 self.Print() | 1054 self.Print() |
1055 | 1055 |
1056 return ret | 1056 return ret |
1057 | 1057 |
1058 def GetIsolateCommand(self, target, vals): | 1058 def GetIsolateCommand(self, target, vals): |
1059 isolate_map = self.ReadIsolateMap() | 1059 isolate_map = self.ReadIsolateMap() |
1060 | 1060 |
1061 android = 'target_os="android"' in vals['gn_args'] | 1061 android = 'target_os="android"' in vals['gn_args'] |
1062 ozone = 'use_ozone=true' in vals['gn_args'] | 1062 ozone = 'use_ozone=true' in vals['gn_args'] |
1063 ozone_x11 = (ozone and 'args' in isolate_map[target] and | 1063 chromeos = 'target_os="chromeos"' in vals['gn_args'] |
1064 '--ozone-platform=x11' in isolate_map[target]['args']) | |
1065 | 1064 |
1066 # This needs to mirror the settings in //build/config/ui.gni: | 1065 # This should be true if tests with type='windowed_test_launcher' are |
1067 # use_x11 = is_linux && !use_ozone || use_ozone && --ozone-platform=x11 | 1066 # expected to run using xvfb. For example, Linux Desktop, X11 CrOS and |
1068 use_x11 = (self.platform == 'linux2' and | 1067 # Ozone CrOS builds. |
| 1068 use_xvfb = (self.platform == 'linux2' and |
1069 not android and | 1069 not android and |
1070 (ozone_x11 or not ozone)) | 1070 ((not ozone) or (ozone and chromeos))) |
1071 | 1071 |
1072 asan = 'is_asan=true' in vals['gn_args'] | 1072 asan = 'is_asan=true' in vals['gn_args'] |
1073 msan = 'is_msan=true' in vals['gn_args'] | 1073 msan = 'is_msan=true' in vals['gn_args'] |
1074 tsan = 'is_tsan=true' in vals['gn_args'] | 1074 tsan = 'is_tsan=true' in vals['gn_args'] |
1075 | 1075 |
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 | 1080 |
(...skipping 15 matching lines...) Expand all Loading... |
1096 '--name', 'unified_logcats', | 1096 '--name', 'unified_logcats', |
1097 ] | 1097 ] |
1098 test_cmdline = [ | 1098 test_cmdline = [ |
1099 self.PathJoin('bin', 'run_%s' % target), | 1099 self.PathJoin('bin', 'run_%s' % target), |
1100 '--logcat-output-file', '${ISOLATED_OUTDIR}/logcats', | 1100 '--logcat-output-file', '${ISOLATED_OUTDIR}/logcats', |
1101 '--target-devices-file', '${SWARMING_BOT_FILE}', | 1101 '--target-devices-file', '${SWARMING_BOT_FILE}', |
1102 '-v' | 1102 '-v' |
1103 ] | 1103 ] |
1104 cmdline = (['./../../build/android/test_wrapper/logdog_wrapper.py'] | 1104 cmdline = (['./../../build/android/test_wrapper/logdog_wrapper.py'] |
1105 + logdog_command + test_cmdline) | 1105 + logdog_command + test_cmdline) |
1106 elif use_x11 and test_type == 'windowed_test_launcher': | 1106 elif use_xvfb and test_type == 'windowed_test_launcher': |
1107 extra_files = [ | 1107 extra_files = [ |
1108 '../../testing/test_env.py', | 1108 '../../testing/test_env.py', |
1109 '../../testing/xvfb.py', | 1109 '../../testing/xvfb.py', |
1110 ] | 1110 ] |
1111 cmdline = [ | 1111 cmdline = [ |
1112 '../../testing/xvfb.py', | 1112 '../../testing/xvfb.py', |
1113 './' + str(executable) + executable_suffix, | 1113 './' + str(executable) + executable_suffix, |
1114 '--brave-new-test-launcher', | 1114 '--brave-new-test-launcher', |
1115 '--test-launcher-bot-mode', | 1115 '--test-launcher-bot-mode', |
1116 '--asan=%d' % asan, | 1116 '--asan=%d' % asan, |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1569 # Then check to see if the arg contains any metacharacters other than | 1569 # Then check to see if the arg contains any metacharacters other than |
1570 # double quotes; if it does, quote everything (including the double | 1570 # double quotes; if it does, quote everything (including the double |
1571 # quotes) for safety. | 1571 # quotes) for safety. |
1572 if any(a in UNSAFE_FOR_CMD for a in arg): | 1572 if any(a in UNSAFE_FOR_CMD for a in arg): |
1573 arg = ''.join('^' + a if a in ALL_META_CHARS else a for a in arg) | 1573 arg = ''.join('^' + a if a in ALL_META_CHARS else a for a in arg) |
1574 return arg | 1574 return arg |
1575 | 1575 |
1576 | 1576 |
1577 if __name__ == '__main__': | 1577 if __name__ == '__main__': |
1578 sys.exit(main(sys.argv[1:])) | 1578 sys.exit(main(sys.argv[1:])) |
OLD | NEW |