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

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

Issue 22445005: Fixes exit code when there are no host-driven tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 4 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
« no previous file with comments | « build/android/pylib/base/test_dispatcher.py ('k') | 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 2013 The Chromium Authors. All rights reserved. 3 # Copyright 2013 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 types of tests from one unified interface. 7 """Runs all types of tests from one unified interface.
8 8
9 TODO(gkanwar): 9 TODO(gkanwar):
10 * Add options to run Monkey tests. 10 * Add options to run Monkey tests.
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 test_timeout=None, 429 test_timeout=None,
430 num_retries=options.num_retries) 430 num_retries=options.num_retries)
431 431
432 results.AddTestRunResults(test_results) 432 results.AddTestRunResults(test_results)
433 433
434 if options.run_python_tests: 434 if options.run_python_tests:
435 runner_factory, tests = host_driven_setup.InstrumentationSetup( 435 runner_factory, tests = host_driven_setup.InstrumentationSetup(
436 options.python_test_root, options.official_build, 436 options.python_test_root, options.official_build,
437 instrumentation_options) 437 instrumentation_options)
438 438
439 test_results, test_exit_code = test_dispatcher.RunTests( 439 if tests:
440 tests, runner_factory, False, 440 test_results, test_exit_code = test_dispatcher.RunTests(
441 options.test_device, 441 tests, runner_factory, False,
442 shard=True, 442 options.test_device,
443 build_type=options.build_type, 443 shard=True,
444 test_timeout=None, 444 build_type=options.build_type,
445 num_retries=options.num_retries) 445 test_timeout=None,
446 num_retries=options.num_retries)
446 447
447 results.AddTestRunResults(test_results) 448 results.AddTestRunResults(test_results)
448 449
449 # Only allow exit code escalation 450 # Only allow exit code escalation
450 if test_exit_code and exit_code != constants.ERROR_EXIT_CODE: 451 if test_exit_code and exit_code != constants.ERROR_EXIT_CODE:
451 exit_code = test_exit_code 452 exit_code = test_exit_code
452 453
453 report_results.LogFull( 454 report_results.LogFull(
454 results=results, 455 results=results,
455 test_type='Instrumentation', 456 test_type='Instrumentation',
456 test_package=os.path.basename(options.test_apk), 457 test_package=os.path.basename(options.test_apk),
457 annotation=options.annotations, 458 annotation=options.annotations,
458 build_type=options.build_type, 459 build_type=options.build_type,
459 flakiness_server=options.flakiness_dashboard_server) 460 flakiness_server=options.flakiness_dashboard_server)
460 461
461 return exit_code 462 return exit_code
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 return 0 617 return 0
617 command = argv[1] 618 command = argv[1]
618 VALID_COMMANDS[command].add_options_func(option_parser) 619 VALID_COMMANDS[command].add_options_func(option_parser)
619 options, args = option_parser.parse_args(argv) 620 options, args = option_parser.parse_args(argv)
620 return VALID_COMMANDS[command].run_command_func( 621 return VALID_COMMANDS[command].run_command_func(
621 command, options, args, option_parser) 622 command, options, args, option_parser)
622 623
623 624
624 if __name__ == '__main__': 625 if __name__ == '__main__':
625 sys.exit(main(sys.argv)) 626 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « build/android/pylib/base/test_dispatcher.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698