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

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: make paths relative to the output directory Created 5 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
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='support_apk',
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' % ( 387
383 os.path.splitext(args.test_apk_path)) 388 if args.support_apk:
389 args.test_support_apk_path = os.path.join(
390 constants.GetOutDirectory(),
391 args.support_apk)
392 else:
393 args.test_support_apk_path = None
384 394
385 args.test_runner = apk_helper.GetInstrumentationName(args.test_apk_path) 395 args.test_runner = apk_helper.GetInstrumentationName(args.test_apk_path)
386 396
387 # TODO(jbudorick): Get rid of InstrumentationOptions. 397 # TODO(jbudorick): Get rid of InstrumentationOptions.
388 return instrumentation_test_options.InstrumentationOptions( 398 return instrumentation_test_options.InstrumentationOptions(
389 args.tool, 399 args.tool,
390 args.annotations, 400 args.annotations,
391 args.exclude_annotations, 401 args.exclude_annotations,
392 args.test_filter, 402 args.test_filter,
393 args.test_data, 403 args.test_data,
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
1047 if e.is_infra_error: 1057 if e.is_infra_error:
1048 return constants.INFRA_EXIT_CODE 1058 return constants.INFRA_EXIT_CODE
1049 return constants.ERROR_EXIT_CODE 1059 return constants.ERROR_EXIT_CODE
1050 except: # pylint: disable=W0702 1060 except: # pylint: disable=W0702
1051 logging.exception('Unrecognized error occurred.') 1061 logging.exception('Unrecognized error occurred.')
1052 return constants.ERROR_EXIT_CODE 1062 return constants.ERROR_EXIT_CODE
1053 1063
1054 1064
1055 if __name__ == '__main__': 1065 if __name__ == '__main__':
1056 sys.exit(main()) 1066 sys.exit(main())
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698