Пример #1
0
def main():
  formatter = Tap(Stdout())
  global_env = init(formatter)

  agg = Aggregator()
  agg.add_files(option.targets)


  runner = ScenarioRunner(agg, formatter)
  runner.run(global_env)
Пример #2
0
def main():
  formatter = Tap(Stdout())
  global_env = init(formatter)
  if option.targets:
    agg = Aggregator()
    agg.add_files(option.targets)
    runner = ScenarioRunner(agg, formatter)
    failed = runner.run(global_env)
  else:
    import console
    console.run(global_env)
  teardown()
  if failed:
      sys.exit(1)
Пример #3
0
def run_scenario(global_env):
  formatter = global_env['formatter']
  failed = False
  try:
    agg = Aggregator()
    agg.add_filter(TagFilter(option.tags))
    agg.add_files(option.targets)
  except ScenarioLoadError as e:
    formatter.writer.write("{0}({1}):\n  {2}\n\n".format(e.__class__.__name__, e.error, e.filename))
    formatter.writer.write(util.unicode(e) + "\n")
    failed = True

  runner = ScenarioRunner(agg, formatter)
  failed = failed or runner.run(global_env)

  return int(failed)