コード例 #1
0
def main():
    """CLI frontend to validate arguments."""
    run_test_cases.run_isolated.disable_buffering()
    parser = run_test_cases.OptionParserTestCases(
        usage='%prog <options> --isolated <.isolated>')
    parser.format_description = lambda *_: parser.description
    isolate.add_variable_option(parser)
    # TODO(maruel): Add support for options.timeout.
    parser.remove_option('--timeout')
    options, args = parser.parse_args()
    if args:
        parser.error('Unsupported arg: %s' % args)
    isolate.parse_isolated_option(parser, options, os.getcwd(), True)
    isolate.parse_variable_option(options)

    try:
        config, command, test_cases = safely_load_isolated(parser, options)
        if not command:
            parser.error('A command must be defined')
        if not test_cases:
            parser.error('No test case to run with command: %s' %
                         ' '.join(command))

        config.saved_state.variables.update(options.variables)
        return isolate_test_cases(command, test_cases, options.jobs,
                                  config.isolated_filepath,
                                  config.saved_state.isolate_filepath,
                                  config.root_dir,
                                  config.saved_state.relative_cwd,
                                  config.saved_state.variables)
    except isolate.ExecutionError, e:
        print >> sys.stderr, str(e)
        return 1
コード例 #2
0
ファイル: isolate_test_cases.py プロジェクト: hinike/opera
def main():
  """CLI frontend to validate arguments."""
  run_test_cases.run_isolated.disable_buffering()
  parser = run_test_cases.OptionParserTestCases(
      usage='%prog <options> --isolated <.isolated>')
  parser.format_description = lambda *_: parser.description
  isolate.add_variable_option(parser)
  # TODO(maruel): Add support for options.timeout.
  parser.remove_option('--timeout')
  options, args = parser.parse_args()
  if args:
    parser.error('Unsupported arg: %s' % args)
  isolate.parse_isolated_option(parser, options, os.getcwd(), True)
  isolate.parse_variable_option(options)

  try:
    config, command, test_cases = safely_load_isolated(parser, options)
    if not command:
      parser.error('A command must be defined')
    if not test_cases:
      parser.error('No test case to run with command: %s' % ' '.join(command))

    config.saved_state.variables.update(options.variables)
    return isolate_test_cases(
        command,
        test_cases,
        options.jobs,
        config.isolated_filepath,
        config.saved_state.isolate_filepath,
        config.root_dir,
        config.saved_state.relative_cwd,
        config.saved_state.variables)
  except isolate.ExecutionError, e:
    print >> sys.stderr, str(e)
    return 1
コード例 #3
0
ファイル: fix_test_cases.py プロジェクト: rzr/Tizen_Crosswalk
def main():
    tools.disable_buffering()
    parser = run_test_cases.OptionParserTestCases(usage="%prog <options> -s <something.isolated>")
    isolate.add_trace_option(parser)
    parser.add_option("-s", "--isolated", help="The isolated file")
    options, args = parser.parse_args()

    if args:
        parser.error("Unsupported arg: %s" % args)
    isolate.parse_isolated_option(parser, options, os.getcwd(), True)

    _, command, test_cases = isolate_test_cases.safely_load_isolated(parser, options)
    if not command:
        parser.error("A command must be defined")
    if not test_cases:
        parser.error("No test case to run")
    return not fix_all(options.isolated, test_cases, options.trace_blacklist, options.verbose)
コード例 #4
0
def main():
    run_test_cases.run_isolated.disable_buffering()
    parser = run_test_cases.OptionParserTestCases(
        usage='%prog <options> -s <something.isolated>')
    parser.add_option('-s', '--isolated', help='The isolated file')
    options, args = parser.parse_args()

    if args:
        parser.error('Unsupported arg: %s' % args)
    isolate.parse_isolated_option(parser, options, os.getcwd(), True)

    _, command, test_cases = isolate_test_cases.safely_load_isolated(
        parser, options)
    if not command:
        parser.error('A command must be defined')
    if not test_cases:
        parser.error('No test case to run')
    return not fix_all(options.isolated, test_cases, options.verbose)
コード例 #5
0
ファイル: fix_test_cases.py プロジェクト: hinike/opera
def main():
  run_test_cases.run_isolated.disable_buffering()
  parser = run_test_cases.OptionParserTestCases(
      usage='%prog <options> -s <something.isolated>')
  parser.add_option(
      '-s', '--isolated',
      help='The isolated file')
  options, args = parser.parse_args()

  if args:
    parser.error('Unsupported arg: %s' % args)
  isolate.parse_isolated_option(parser, options, os.getcwd(), True)

  _, command, test_cases = isolate_test_cases.safely_load_isolated(
      parser, options)
  if not command:
    parser.error('A command must be defined')
  if not test_cases:
    parser.error('No test case to run')
  return not fix_all(options.isolated, test_cases, options.verbose)