OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2013 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 import collections | 6 import collections |
7 import glob | 7 import glob |
8 import json | 8 import json |
9 import optparse | 9 import optparse |
10 import os | 10 import os |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 '--builder-name', options.build_properties.get('buildername', ''), | 146 '--builder-name', options.build_properties.get('buildername', ''), |
147 '--build-number', options.build_properties.get('buildnumber', ''), | 147 '--build-number', options.build_properties.get('buildnumber', ''), |
148 '--master-name', options.build_properties.get('mastername', ''), | 148 '--master-name', options.build_properties.get('mastername', ''), |
149 '--build-name', options.build_properties.get('buildername', ''), | 149 '--build-name', options.build_properties.get('buildername', ''), |
150 '--platform=chromium-android', | 150 '--platform=chromium-android', |
151 '--test-results-server', | 151 '--test-results-server', |
152 options.factory_properties.get('test_results_server', '')]) | 152 options.factory_properties.get('test_results_server', '')]) |
153 | 153 |
154 | 154 |
155 def MainTestWrapper(options): | 155 def MainTestWrapper(options): |
| 156 # Device check and alert emails |
| 157 RunCmd(['build/android/device_status_check.py'], flunk_on_failure=False) |
| 158 |
156 if options.install: | 159 if options.install: |
157 test_obj = INSTRUMENTATION_TESTS[options.install] | 160 test_obj = INSTRUMENTATION_TESTS[options.install] |
158 InstallApk(test_obj.apk, test_obj.apk_package, options.target) | 161 InstallApk(test_obj.apk, test_obj.apk_package, options.target) |
159 | 162 |
160 if not options.test_filter: | 163 if not options.test_filter: |
161 return | 164 return |
162 | 165 |
163 # Device check and alert emails | |
164 RunCmd(['build/android/device_status_check.py'], flunk_on_failure=False) | |
165 | |
166 # Spawn logcat monitor | 166 # Spawn logcat monitor |
167 logcat_dir = os.path.join(CHROME_SRC, 'out/logcat') | 167 logcat_dir = os.path.join(CHROME_SRC, 'out/logcat') |
168 shutil.rmtree(logcat_dir, ignore_errors=True) | 168 shutil.rmtree(logcat_dir, ignore_errors=True) |
169 if not TESTING: | 169 if not TESTING: |
170 subprocess.Popen( | 170 subprocess.Popen( |
171 ['build/android/adb_logcat_monitor.py', logcat_dir], cwd=CHROME_SRC) | 171 ['build/android/adb_logcat_monitor.py', logcat_dir], cwd=CHROME_SRC) |
172 | 172 |
173 if 'unit' in options.test_filter: | 173 if 'unit' in options.test_filter: |
174 RunTestSuites(options, None) | 174 RunTestSuites(options, None) |
175 if 'ui' in options.test_filter: | 175 if 'ui' in options.test_filter: |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 if unknown_tests: | 235 if unknown_tests: |
236 return ParserError('Unknown tests %s' % list(unknown_tests)) | 236 return ParserError('Unknown tests %s' % list(unknown_tests)) |
237 | 237 |
238 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) | 238 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) |
239 | 239 |
240 MainTestWrapper(options) | 240 MainTestWrapper(options) |
241 | 241 |
242 | 242 |
243 if __name__ == '__main__': | 243 if __name__ == '__main__': |
244 sys.exit(main(sys.argv)) | 244 sys.exit(main(sys.argv)) |
OLD | NEW |