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

Side by Side Diff: build/android/run_tests.py

Issue 11574036: Fix build/android/run_tests.py (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """Runs all the native unit tests. 7 """Runs all the native unit tests.
8 8
9 1. Copy over test binary to /data/local on device. 9 1. Copy over test binary to /data/local on device.
10 2. Resources: chrome/unit_tests requires resources (chrome.pak and en-US.pak) 10 2. Resources: chrome/unit_tests requires resources (chrome.pak and en-US.pak)
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 then filters it again using the diabled list on the host. 213 then filters it again using the diabled list on the host.
214 214
215 Raises Exception if all devices failed. 215 Raises Exception if all devices failed.
216 """ 216 """
217 available_devices = list(self.attached_devices) 217 available_devices = list(self.attached_devices)
218 while available_devices: 218 while available_devices:
219 try: 219 try:
220 return self._GetTestsFromDevice(available_devices[-1]) 220 return self._GetTestsFromDevice(available_devices[-1])
221 except Exception as e: 221 except Exception as e:
222 logging.warning('Failed obtaining tests from %s %s', 222 logging.warning('Failed obtaining tests from %s %s',
223 current_device, e) 223 available_devices[-1], e)
224 available_devices.pop() 224 available_devices.pop()
225 225
226 raise Exception('No device available to get the list of tests.') 226 raise Exception('No device available to get the list of tests.')
227 227
228 def _GetTestsFromDevice(self, device): 228 def _GetTestsFromDevice(self, device):
229 logging.info('Obtaining tests from %s', device) 229 logging.info('Obtaining tests from %s', device)
230 test_runner = SingleTestRunner( 230 test_runner = SingleTestRunner(
231 device, 231 device,
232 self.test_suite, 232 self.test_suite,
233 self.gtest_filter, 233 self.gtest_filter,
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 # the batch (this happens because the exit status is a sum of all failures 483 # the batch (this happens because the exit status is a sum of all failures
484 # from all suites, but the buildbot associates the exit status only with the 484 # from all suites, but the buildbot associates the exit status only with the
485 # most recent step). 485 # most recent step).
486 if options.exit_code: 486 if options.exit_code:
487 return failed_tests_count 487 return failed_tests_count
488 return 0 488 return 0
489 489
490 490
491 if __name__ == '__main__': 491 if __name__ == '__main__':
492 sys.exit(main(sys.argv)) 492 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698