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='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).')) | |
340 group.add_argument('--coverage-dir', | 335 group.add_argument('--coverage-dir', |
341 help=('Directory in which to place all generated ' | 336 help=('Directory in which to place all generated ' |
342 'EMMA coverage files.')) | 337 'EMMA coverage files.')) |
343 group.add_argument('--device-flags', dest='device_flags', default='', | 338 group.add_argument('--device-flags', dest='device_flags', default='', |
344 help='The relative filepath to a file containing ' | 339 help='The relative filepath to a file containing ' |
345 'command-line flags to set on the device') | 340 'command-line flags to set on the device') |
346 group.add_argument('--device-flags-file', default='', | 341 group.add_argument('--device-flags-file', default='', |
347 help='The relative filepath to a file containing ' | 342 help='The relative filepath to a file containing ' |
348 'command-line flags to set on the device') | 343 'command-line flags to set on the device') |
349 group.add_argument('--isolate_file_path', | 344 group.add_argument('--isolate_file_path', |
(...skipping 27 matching lines...) Expand all Loading... |
377 args.run_python_tests = False | 372 args.run_python_tests = False |
378 | 373 |
379 args.test_apk_path = os.path.join( | 374 args.test_apk_path = os.path.join( |
380 constants.GetOutDirectory(), | 375 constants.GetOutDirectory(), |
381 constants.SDK_BUILD_APKS_DIR, | 376 constants.SDK_BUILD_APKS_DIR, |
382 '%s.apk' % args.test_apk) | 377 '%s.apk' % args.test_apk) |
383 args.test_apk_jar_path = os.path.join( | 378 args.test_apk_jar_path = os.path.join( |
384 constants.GetOutDirectory(), | 379 constants.GetOutDirectory(), |
385 constants.SDK_BUILD_TEST_JAVALIB_DIR, | 380 constants.SDK_BUILD_TEST_JAVALIB_DIR, |
386 '%s.jar' % args.test_apk) | 381 '%s.jar' % args.test_apk) |
| 382 args.test_support_apk_path = '%sSupport%s' % ( |
| 383 os.path.splitext(args.test_apk_path)) |
387 | 384 |
388 args.test_runner = apk_helper.GetInstrumentationName(args.test_apk_path) | 385 args.test_runner = apk_helper.GetInstrumentationName(args.test_apk_path) |
389 | 386 |
390 # TODO(jbudorick): Get rid of InstrumentationOptions. | 387 # TODO(jbudorick): Get rid of InstrumentationOptions. |
391 return instrumentation_test_options.InstrumentationOptions( | 388 return instrumentation_test_options.InstrumentationOptions( |
392 args.tool, | 389 args.tool, |
393 args.annotations, | 390 args.annotations, |
394 args.exclude_annotations, | 391 args.exclude_annotations, |
395 args.test_filter, | 392 args.test_filter, |
396 args.test_data, | 393 args.test_data, |
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1055 if e.is_infra_error: | 1052 if e.is_infra_error: |
1056 return constants.INFRA_EXIT_CODE | 1053 return constants.INFRA_EXIT_CODE |
1057 return constants.ERROR_EXIT_CODE | 1054 return constants.ERROR_EXIT_CODE |
1058 except: # pylint: disable=W0702 | 1055 except: # pylint: disable=W0702 |
1059 logging.exception('Unrecognized error occurred.') | 1056 logging.exception('Unrecognized error occurred.') |
1060 return constants.ERROR_EXIT_CODE | 1057 return constants.ERROR_EXIT_CODE |
1061 | 1058 |
1062 | 1059 |
1063 if __name__ == '__main__': | 1060 if __name__ == '__main__': |
1064 sys.exit(main()) | 1061 sys.exit(main()) |
OLD | NEW |