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

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

Issue 10532106: add option to suport setting target device for test (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 months 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 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 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 """Runs all the native unit tests. 6 """Runs all the native unit tests.
7 7
8 1. Copy over test binary to /data/local on device. 8 1. Copy over test binary to /data/local on device.
9 2. Resources: chrome/unit_tests requires resources (chrome.pak and en-US.pak) 9 2. Resources: chrome/unit_tests requires resources (chrome.pak and en-US.pak)
10 to be deployed to the device (in /data/local/tmp). 10 to be deployed to the device (in /data/local/tmp).
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 for n in range(options.use_emulator): 314 for n in range(options.use_emulator):
315 t = TimeProfile('Emulator launch %d' % n) 315 t = TimeProfile('Emulator launch %d' % n)
316 buildbot_emulator = emulator.Emulator(options.fast_and_loose) 316 buildbot_emulator = emulator.Emulator(options.fast_and_loose)
317 buildbot_emulator.Launch(kill_all_emulators=n == 0) 317 buildbot_emulator.Launch(kill_all_emulators=n == 0)
318 t.Stop() 318 t.Stop()
319 buildbot_emulators.append(buildbot_emulator) 319 buildbot_emulators.append(buildbot_emulator)
320 attached_devices.append(buildbot_emulator.device) 320 attached_devices.append(buildbot_emulator.device)
321 # Wait for all emulators to become available. 321 # Wait for all emulators to become available.
322 map(lambda buildbot_emulator:buildbot_emulator.ConfirmLaunch(), 322 map(lambda buildbot_emulator:buildbot_emulator.ConfirmLaunch(),
323 buildbot_emulators) 323 buildbot_emulators)
324 elif options.test_device:
325 attached_devices = [options.test_device]
324 else: 326 else:
325 attached_devices = android_commands.GetAttachedDevices() 327 attached_devices = android_commands.GetAttachedDevices()
326 328
327 if not attached_devices: 329 if not attached_devices:
328 logging.critical('A device must be attached and online.') 330 logging.critical('A device must be attached and online.')
329 return 1 331 return 1
330 332
331 if (len(attached_devices) > 1 and options.test_suite and 333 if (len(attached_devices) > 1 and options.test_suite and
332 not options.gtest_filter and not options.performance_test): 334 not options.gtest_filter and not options.performance_test):
333 sharder = TestSharder(attached_devices, options.test_suite, 335 sharder = TestSharder(attached_devices, options.test_suite,
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 for test_suite in _TEST_SUITES: 405 for test_suite in _TEST_SUITES:
404 print test_suite 406 print test_suite
405 407
406 408
407 def main(argv): 409 def main(argv):
408 option_parser = run_tests_helper.CreateTestRunnerOptionParser(None, 410 option_parser = run_tests_helper.CreateTestRunnerOptionParser(None,
409 default_timeout=0) 411 default_timeout=0)
410 option_parser.add_option('-s', '--suite', dest='test_suite', 412 option_parser.add_option('-s', '--suite', dest='test_suite',
411 help='Executable name of the test suite to run ' 413 help='Executable name of the test suite to run '
412 '(use -s help to list them)') 414 '(use -s help to list them)')
415 option_parser.add_option('-d', '--device', dest='test_device',
416 help='Target device the test suite to run ')
413 option_parser.add_option('-r', dest='rebaseline', 417 option_parser.add_option('-r', dest='rebaseline',
414 help='Rebaseline and update *testsuite_disabled', 418 help='Rebaseline and update *testsuite_disabled',
415 action='store_true', 419 action='store_true',
416 default=False) 420 default=False)
417 option_parser.add_option('-f', '--gtest_filter', dest='gtest_filter', 421 option_parser.add_option('-f', '--gtest_filter', dest='gtest_filter',
418 help='gtest filter') 422 help='gtest filter')
419 option_parser.add_option('-a', '--test_arguments', dest='test_arguments', 423 option_parser.add_option('-a', '--test_arguments', dest='test_arguments',
420 help='Additional arguments to pass to the test') 424 help='Additional arguments to pass to the test')
421 option_parser.add_option('-p', dest='performance_test', 425 option_parser.add_option('-p', dest='performance_test',
422 help='Indicator of performance test', 426 help='Indicator of performance test',
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 # from all suites, but the buildbot associates the exit status only with the 470 # from all suites, but the buildbot associates the exit status only with the
467 # most recent step). 471 # most recent step).
468 if options.annotate: 472 if options.annotate:
469 return 0 473 return 0
470 else: 474 else:
471 return failed_tests_count 475 return failed_tests_count
472 476
473 477
474 if __name__ == '__main__': 478 if __name__ == '__main__':
475 sys.exit(main(sys.argv)) 479 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