def MainTestWrapper(options):
    try:
        # Spawn logcat monitor
        SpawnLogcatMonitor()

        # Run all device setup steps
        for _, cmd in GetDeviceSetupStepCmds():
            cmd(options)

        if options.install:
            test_obj = INSTRUMENTATION_TESTS[options.install]
            InstallApk(options, test_obj, print_step=True)

        if options.test_filter:
            bb_utils.RunSteps(options.test_filter, GetTestStepCmds(), options)

        if options.coverage_bucket:
            coverage_html = GenerateJavaCoverageReport(options)
            UploadHTML(options, '%s/java' % options.coverage_bucket,
                       coverage_html, 'Coverage Report')

        if options.experimental:
            RunTestSuites(options, gtest_config.EXPERIMENTAL_TEST_SUITES)

    finally:
        # Run all post test steps
        LogcatDump(options)
        GenerateTestReport(options)
        # KillHostHeartbeat() has logic to check if heartbeat process is running,
        # and kills only if it finds the process is running on the host.
        provision_devices.KillHostHeartbeat()
Ejemplo n.º 2
0
def main(argv):
  parser = GetHostStepsOptParser()
  options, args = parser.parse_args(argv[1:])
  if args:
    return sys.exit('Unused args %s' % args)

  setattr(options, 'target', options.factory_properties.get('target', 'Debug'))

  if options.steps:
    bb_utils.RunSteps(options.steps.split(','), GetHostStepCmds(), options)
Ejemplo n.º 3
0
def main(argv):
    parser = bb_utils.GetParser()
    parser.add_option('--steps', help='Comma separated list of host tests.')
    parser.add_option('--build-targets',
                      default='All',
                      help='Comma separated list of build targets.')
    parser.add_option('--experimental',
                      action='store_true',
                      help='Indicate whether to compile experimental targets.')

    options, args = parser.parse_args(argv[1:])
    if args:
        return sys.exit('Unused args %s' % args)

    setattr(options, 'target',
            options.factory_properties.get('target', 'Debug'))

    bb_utils.RunSteps(GetHostSteps(), options)
Ejemplo n.º 4
0
def MainTestWrapper(options):
    exit_code = 0
    try:
        # Spawn logcat monitor
        SpawnLogcatMonitor()

        # Run all device setup steps
        for _, cmd in GetDeviceSetupStepCmds():
            cmd(options)

        if options.install:
            for i in options.install:
                install_obj = INSTALLABLE_PACKAGES[i]
                InstallApk(options, install_obj, print_step=True)

        if options.test_filter:
            exit_code = bb_utils.RunSteps(
                options.test_filter, GetTestStepCmds(), options) or exit_code

        if options.coverage_bucket:
            coverage_html = GenerateJavaCoverageReport(options)
            UploadHTML(options, '%s/java' % options.coverage_bucket,
                       coverage_html, 'Coverage Report')
            shutil.rmtree(coverage_html, ignore_errors=True)

        if options.experimental:
            exit_code = RunTestSuites(
                options, gtest_config.EXPERIMENTAL_TEST_SUITES) or exit_code

        return exit_code

    finally:
        # Run all post test steps
        LogcatDump(options)
        if not options.disable_stack_tool:
            RunStackToolSteps(options)
        GenerateTestReport(options)
        # KillHostHeartbeat() has logic to check if heartbeat process is running,
        # and kills only if it finds the process is running on the host.
        provision_devices.KillHostHeartbeat()
        if options.cleanup:
            shutil.rmtree(os.path.join(CHROME_OUT_DIR, options.target),
                          ignore_errors=True)