Пример #1
0
def _RunTest(options, cmd, suite):
    """Run test command with runtest.py.

  Args:
    options: options object.
    cmd: the command to run.
    suite: test name.
  """
    property_args = bb_utils.EncodeProperties(options)
    args = [os.path.join(SLAVE_SCRIPTS_DIR, 'runtest.py')] + property_args
    args += ['--test-platform', 'android']
    if options.factory_properties.get('generate_gtest_json'):
        args.append('--generate-json-file')
        args += [
            '-o',
            'gtest-results/%s' % suite, '--annotate', 'gtest',
            '--build-number',
            str(options.build_properties.get('buildnumber',
                                             '')), '--builder-name',
            options.build_properties.get('buildername', '')
        ]
    if options.target == 'Release':
        args += ['--target', 'Release']
    else:
        args += ['--target', 'Debug']
    if options.flakiness_server:
        args += ['--flakiness-dashboard-server=%s' % options.flakiness_server]
    args += cmd
    RunCmd(args, cwd=DIR_BUILD_ROOT)
def GetCommands(options, bot_config):
    """Get a formatted list of commands.

  Args:
    options: Options object.
    bot_config: A BotConfig named tuple.
    host_step_script: Host step script.
    device_step_script: Device step script.
  Returns:
    list of Command objects.
  """
    property_args = bb_utils.EncodeProperties(options)
    commands = [[
        bot_config.host_obj.script,
        '--steps=%s' % ','.join(bot_config.host_obj.host_steps)
    ] + property_args + (bot_config.host_obj.extra_args or [])]

    test_obj = bot_config.test_obj
    if test_obj:
        run_test_cmd = [test_obj.script, '--reboot'] + property_args
        for test in test_obj.tests:
            run_test_cmd.extend(['-f', test])
        if test_obj.extra_args:
            run_test_cmd.extend(test_obj.extra_args)
        commands.append(run_test_cmd)
    return commands
def ZipBuild(options):
  bb_annotations.PrintNamedStep('zip_build')
  RunCmd([
      os.path.join(SLAVE_SCRIPTS_DIR, 'zip_build.py'),
      '--src-dir', host_paths.DIR_SOURCE_ROOT,
      '--exclude-files', 'lib.target,gen,android_webview,jingle_unittests']
      + bb_utils.EncodeProperties(options), cwd=DIR_BUILD_ROOT)
Пример #4
0
def ExtractBuild(options):
  bb_annotations.PrintNamedStep('extract_build')
  RunCmd(
      [os.path.join(SLAVE_SCRIPTS_DIR, 'extract_build.py'),
       '--build-dir', SrcPath('build'), '--build-output-dir',
       SrcPath('out')] + bb_utils.EncodeProperties(options),
       warning_code=1)
Пример #5
0
def ZipBuild(options):
    buildbot_report.PrintNamedStep('zip_build')
    RunCmd([
        os.path.join(SLAVE_SCRIPTS_DIR, 'zip_build.py'), '--src-dir',
        constants.DIR_SOURCE_ROOT, '--build-dir',
        SrcPath('out'), '--exclude-files',
        'lib.target,gen,android_webview,jingle_unittests'
    ] + bb_utils.EncodeProperties(options))
Пример #6
0
def ExtractBuild(options):
    bb_annotations.PrintNamedStep('extract_build')
    RunCmd([os.path.join(SLAVE_SCRIPTS_DIR, 'extract_build.py')] +
           bb_utils.EncodeProperties(options),
           warning_code=1,
           cwd=DIR_BUILD_ROOT)