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

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

Issue 1208483004: Make instrumentation test dependency on a support APK explicit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 5 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/test_runner.gypi ('k') | build/config/android/internal_rules.gni » ('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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 help='Root of the host-driven tests.') 325 help='Root of the host-driven tests.')
326 group.add_argument('-w', '--wait_debugger', dest='wait_for_debugger', 326 group.add_argument('-w', '--wait_debugger', dest='wait_for_debugger',
327 action='store_true', 327 action='store_true',
328 help='Wait for debugger.') 328 help='Wait for debugger.')
329 group.add_argument('--apk-under-test', dest='apk_under_test', 329 group.add_argument('--apk-under-test', dest='apk_under_test',
330 help=('the name of the apk under test.')) 330 help=('the name of the apk under test.'))
331 group.add_argument('--test-apk', dest='test_apk', required=True, 331 group.add_argument('--test-apk', dest='test_apk', required=True,
332 help=('The name of the apk containing the tests ' 332 help=('The name of the apk containing the tests '
333 '(without the .apk extension; ' 333 '(without the .apk extension; '
334 'e.g. "ContentShellTest").')) 334 'e.g. "ContentShellTest").'))
335 group.add_argument('--support-apk', dest='test_support_apk_path',
336 help=('The path to an optional support apk to be '
337 'installed alongside the test apk. The '
338 'path should be relative to the output '
339 'directory (--output-directory).'))
335 group.add_argument('--coverage-dir', 340 group.add_argument('--coverage-dir',
336 help=('Directory in which to place all generated ' 341 help=('Directory in which to place all generated '
337 'EMMA coverage files.')) 342 'EMMA coverage files.'))
338 group.add_argument('--device-flags', dest='device_flags', default='', 343 group.add_argument('--device-flags', dest='device_flags', default='',
339 help='The relative filepath to a file containing ' 344 help='The relative filepath to a file containing '
340 'command-line flags to set on the device') 345 'command-line flags to set on the device')
341 group.add_argument('--device-flags-file', default='', 346 group.add_argument('--device-flags-file', default='',
342 help='The relative filepath to a file containing ' 347 help='The relative filepath to a file containing '
343 'command-line flags to set on the device') 348 'command-line flags to set on the device')
344 group.add_argument('--isolate_file_path', 349 group.add_argument('--isolate_file_path',
(...skipping 27 matching lines...) Expand all
372 args.run_python_tests = False 377 args.run_python_tests = False
373 378
374 args.test_apk_path = os.path.join( 379 args.test_apk_path = os.path.join(
375 constants.GetOutDirectory(), 380 constants.GetOutDirectory(),
376 constants.SDK_BUILD_APKS_DIR, 381 constants.SDK_BUILD_APKS_DIR,
377 '%s.apk' % args.test_apk) 382 '%s.apk' % args.test_apk)
378 args.test_apk_jar_path = os.path.join( 383 args.test_apk_jar_path = os.path.join(
379 constants.GetOutDirectory(), 384 constants.GetOutDirectory(),
380 constants.SDK_BUILD_TEST_JAVALIB_DIR, 385 constants.SDK_BUILD_TEST_JAVALIB_DIR,
381 '%s.jar' % args.test_apk) 386 '%s.jar' % args.test_apk)
382 args.test_support_apk_path = '%sSupport%s' % (
383 os.path.splitext(args.test_apk_path))
384 387
385 args.test_runner = apk_helper.GetInstrumentationName(args.test_apk_path) 388 args.test_runner = apk_helper.GetInstrumentationName(args.test_apk_path)
386 389
387 # TODO(jbudorick): Get rid of InstrumentationOptions. 390 # TODO(jbudorick): Get rid of InstrumentationOptions.
388 return instrumentation_test_options.InstrumentationOptions( 391 return instrumentation_test_options.InstrumentationOptions(
389 args.tool, 392 args.tool,
390 args.annotations, 393 args.annotations,
391 args.exclude_annotations, 394 args.exclude_annotations,
392 args.test_filter, 395 args.test_filter,
393 args.test_data, 396 args.test_data,
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after
1052 if e.is_infra_error: 1055 if e.is_infra_error:
1053 return constants.INFRA_EXIT_CODE 1056 return constants.INFRA_EXIT_CODE
1054 return constants.ERROR_EXIT_CODE 1057 return constants.ERROR_EXIT_CODE
1055 except: # pylint: disable=W0702 1058 except: # pylint: disable=W0702
1056 logging.exception('Unrecognized error occurred.') 1059 logging.exception('Unrecognized error occurred.')
1057 return constants.ERROR_EXIT_CODE 1060 return constants.ERROR_EXIT_CODE
1058 1061
1059 1062
1060 if __name__ == '__main__': 1063 if __name__ == '__main__':
1061 sys.exit(main()) 1064 sys.exit(main())
OLDNEW
« no previous file with comments | « build/android/test_runner.gypi ('k') | build/config/android/internal_rules.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698