OLD | NEW |
---|---|
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 Loading... | |
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', | |
jbudorick
2015/06/24 17:46:39
If possible, I'd vastly prefer we supply the path
dgn
2015/06/24 21:29:50
Providing them based on the output directory was f
| |
336 help=('The name of the support apk to be installed ' | |
337 'alongside the test apk (without the .apk ' | |
338 'extension; e.g. "ContentShellSupportTest").')) | |
335 group.add_argument('--coverage-dir', | 339 group.add_argument('--coverage-dir', |
336 help=('Directory in which to place all generated ' | 340 help=('Directory in which to place all generated ' |
337 'EMMA coverage files.')) | 341 'EMMA coverage files.')) |
338 group.add_argument('--device-flags', dest='device_flags', default='', | 342 group.add_argument('--device-flags', dest='device_flags', default='', |
339 help='The relative filepath to a file containing ' | 343 help='The relative filepath to a file containing ' |
340 'command-line flags to set on the device') | 344 'command-line flags to set on the device') |
341 group.add_argument('--device-flags-file', default='', | 345 group.add_argument('--device-flags-file', default='', |
342 help='The relative filepath to a file containing ' | 346 help='The relative filepath to a file containing ' |
343 'command-line flags to set on the device') | 347 'command-line flags to set on the device') |
344 group.add_argument('--isolate_file_path', | 348 group.add_argument('--isolate_file_path', |
(...skipping 27 matching lines...) Expand all Loading... | |
372 args.run_python_tests = False | 376 args.run_python_tests = False |
373 | 377 |
374 args.test_apk_path = os.path.join( | 378 args.test_apk_path = os.path.join( |
375 constants.GetOutDirectory(), | 379 constants.GetOutDirectory(), |
376 constants.SDK_BUILD_APKS_DIR, | 380 constants.SDK_BUILD_APKS_DIR, |
377 '%s.apk' % args.test_apk) | 381 '%s.apk' % args.test_apk) |
378 args.test_apk_jar_path = os.path.join( | 382 args.test_apk_jar_path = os.path.join( |
379 constants.GetOutDirectory(), | 383 constants.GetOutDirectory(), |
380 constants.SDK_BUILD_TEST_JAVALIB_DIR, | 384 constants.SDK_BUILD_TEST_JAVALIB_DIR, |
381 '%s.jar' % args.test_apk) | 385 '%s.jar' % args.test_apk) |
382 args.test_support_apk_path = '%sSupport%s' % ( | 386 |
383 os.path.splitext(args.test_apk_path)) | 387 if args.support_apk: |
388 args.test_support_apk_path = os.path.join( | |
389 constants.GetOutDirectory(), | |
390 constants.SDK_BUILD_APKS_DIR, | |
391 '%s.apk' % 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 Loading... | |
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()) |
OLD | NEW |