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

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

Issue 1049993003: Revert of [Android] Clean up old_interface in build/android/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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/utils/test_environment.py ('k') | build/android/update_verification.py » ('j') | 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 import argparse 9 import argparse
10 import collections 10 import collections
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 api_key_group = group.add_mutually_exclusive_group() 168 api_key_group = group.add_mutually_exclusive_group()
169 api_key_group.add_argument('--api-key', default='', 169 api_key_group.add_argument('--api-key', default='',
170 help='API key for remote devices.') 170 help='API key for remote devices.')
171 api_key_group.add_argument('--api-key-file', default='', 171 api_key_group.add_argument('--api-key-file', default='',
172 help='Path to file that contains API key.') 172 help='Path to file that contains API key.')
173 173
174 174
175 def AddDeviceOptions(parser): 175 def AddDeviceOptions(parser):
176 """Adds device options to |parser|.""" 176 """Adds device options to |parser|."""
177 group = parser.add_argument_group(title='Device Options') 177 group = parser.add_argument_group(title='Device Options')
178 group.add_argument('-c', dest='cleanup_test_files',
179 help='Cleanup test files on the device after run',
180 action='store_true')
178 group.add_argument('--tool', 181 group.add_argument('--tool',
179 dest='tool', 182 dest='tool',
180 help=('Run the test under a tool ' 183 help=('Run the test under a tool '
181 '(use --tool help to list them)')) 184 '(use --tool help to list them)'))
182 group.add_argument('-d', '--device', dest='test_device', 185 group.add_argument('-d', '--device', dest='test_device',
183 help=('Target device for the test suite ' 186 help=('Target device for the test suite '
184 'to run on.')) 187 'to run on.'))
185 188
186 189
187 def AddGTestOptions(parser): 190 def AddGTestOptions(parser):
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 constants.SDK_BUILD_TEST_JAVALIB_DIR, 365 constants.SDK_BUILD_TEST_JAVALIB_DIR,
363 '%s.jar' % args.test_apk) 366 '%s.jar' % args.test_apk)
364 args.test_support_apk_path = '%sSupport%s' % ( 367 args.test_support_apk_path = '%sSupport%s' % (
365 os.path.splitext(args.test_apk_path)) 368 os.path.splitext(args.test_apk_path))
366 369
367 args.test_runner = apk_helper.GetInstrumentationName(args.test_apk_path) 370 args.test_runner = apk_helper.GetInstrumentationName(args.test_apk_path)
368 371
369 # TODO(jbudorick): Get rid of InstrumentationOptions. 372 # TODO(jbudorick): Get rid of InstrumentationOptions.
370 return instrumentation_test_options.InstrumentationOptions( 373 return instrumentation_test_options.InstrumentationOptions(
371 args.tool, 374 args.tool,
375 args.cleanup_test_files,
372 args.annotations, 376 args.annotations,
373 args.exclude_annotations, 377 args.exclude_annotations,
374 args.test_filter, 378 args.test_filter,
375 args.test_data, 379 args.test_data,
376 args.save_perf_json, 380 args.save_perf_json,
377 args.screenshot_failures, 381 args.screenshot_failures,
378 args.wait_for_debugger, 382 args.wait_for_debugger,
379 args.coverage_dir, 383 args.coverage_dir,
380 args.test_apk, 384 args.test_apk,
381 args.test_apk_path, 385 args.test_apk_path,
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 args.uiautomator_jar = os.path.join( 430 args.uiautomator_jar = os.path.join(
427 constants.GetOutDirectory(), 431 constants.GetOutDirectory(),
428 constants.SDK_BUILD_JAVALIB_DIR, 432 constants.SDK_BUILD_JAVALIB_DIR,
429 '%s.dex.jar' % args.test_jar) 433 '%s.dex.jar' % args.test_jar)
430 args.uiautomator_info_jar = ( 434 args.uiautomator_info_jar = (
431 args.uiautomator_jar[:args.uiautomator_jar.find('.dex.jar')] + 435 args.uiautomator_jar[:args.uiautomator_jar.find('.dex.jar')] +
432 '_java.jar') 436 '_java.jar')
433 437
434 return uiautomator_test_options.UIAutomatorOptions( 438 return uiautomator_test_options.UIAutomatorOptions(
435 args.tool, 439 args.tool,
440 args.cleanup_test_files,
436 args.annotations, 441 args.annotations,
437 args.exclude_annotations, 442 args.exclude_annotations,
438 args.test_filter, 443 args.test_filter,
439 args.test_data, 444 args.test_data,
440 args.save_perf_json, 445 args.save_perf_json,
441 args.screenshot_failures, 446 args.screenshot_failures,
442 args.uiautomator_jar, 447 args.uiautomator_jar,
443 args.uiautomator_info_jar, 448 args.uiautomator_info_jar,
444 args.package, 449 args.package,
445 args.set_asserts) 450 args.set_asserts)
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 629
625 630
626 def _RunGTests(args, devices): 631 def _RunGTests(args, devices):
627 """Subcommand of RunTestsCommands which runs gtests.""" 632 """Subcommand of RunTestsCommands which runs gtests."""
628 exit_code = 0 633 exit_code = 0
629 for suite_name in args.suite_name: 634 for suite_name in args.suite_name:
630 # TODO(jbudorick): Either deprecate multi-suite or move its handling down 635 # TODO(jbudorick): Either deprecate multi-suite or move its handling down
631 # into the gtest code. 636 # into the gtest code.
632 gtest_options = gtest_test_options.GTestOptions( 637 gtest_options = gtest_test_options.GTestOptions(
633 args.tool, 638 args.tool,
639 args.cleanup_test_files,
634 args.test_filter, 640 args.test_filter,
635 args.run_disabled, 641 args.run_disabled,
636 args.test_arguments, 642 args.test_arguments,
637 args.timeout, 643 args.timeout,
638 args.isolate_file_path, 644 args.isolate_file_path,
639 suite_name) 645 suite_name)
640 runner_factory, tests = gtest_setup.Setup(gtest_options, devices) 646 runner_factory, tests = gtest_setup.Setup(gtest_options, devices)
641 647
642 results, test_exit_code = test_dispatcher.RunTests( 648 results, test_exit_code = test_dispatcher.RunTests(
643 tests, runner_factory, devices, shard=True, test_timeout=None, 649 tests, runner_factory, devices, shard=True, test_timeout=None,
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
1017 return constants.INFRA_EXIT_CODE 1023 return constants.INFRA_EXIT_CODE
1018 else: 1024 else:
1019 return constants.ERROR_EXIT_CODE 1025 return constants.ERROR_EXIT_CODE
1020 except: # pylint: disable=W0702 1026 except: # pylint: disable=W0702
1021 logging.exception('Unrecognized error occurred.') 1027 logging.exception('Unrecognized error occurred.')
1022 return constants.ERROR_EXIT_CODE 1028 return constants.ERROR_EXIT_CODE
1023 1029
1024 1030
1025 if __name__ == '__main__': 1031 if __name__ == '__main__':
1026 sys.exit(main()) 1032 sys.exit(main())
OLDNEW
« no previous file with comments | « build/android/pylib/utils/test_environment.py ('k') | build/android/update_verification.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698