Exemple #1
0
def main():
    """CLI frontend to validate arguments."""
    tools.disable_buffering()
    parser = run_test_cases.OptionParserTestCases(
        usage='%prog <options> --isolated <.isolated>')
    parser.format_description = lambda *_: parser.description
    isolate.add_variable_option(parser)
    isolate.add_trace_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,
            options.trace_blacklist)
    except isolate.ExecutionError, e:
        print >> sys.stderr, str(e)
        return 1
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)
def main():
  """CLI frontend to validate arguments."""
  tools.disable_buffering()
  parser = run_test_cases.OptionParserTestCases(
      usage='%prog <options> --isolated <.isolated>')
  parser.format_description = lambda *_: parser.description
  isolate.add_variable_option(parser)
  isolate.add_trace_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.config_variables.update(options.config_variables)
    config.saved_state.extra_variables.update(options.extra_variables)
    config.saved_state.path_variables.update(options.path_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.path_variables,
        config.saved_state.config_variables,
        config.saved_state.extra_variables,
        options.trace_blacklist)
  except isolate.ExecutionError, e:
    print >> sys.stderr, str(e)
    return 1
Exemple #4
0
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)
def main():
  run_isolated.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)