def ReportTestResult(name, metadata):
  now = time.time()
  colorizer = Colorizer()

  if metadata["exit_code"] == 0:
    # Test completed successfully:
    result = colorizer.Render("GREEN", "PASSED")
  else:
    result = colorizer.Render("RED", "FAILED")
    result += open(metadata["output_path"], "rb").read()

  print "\t{0: <40} {1} in {2: >6.2f}s".format(
      name, result, now - metadata["start"])
Print statistics about the outcome of a test run.
dataset/ETHPy150Open google/grr/grr/tools/run_tests.py/ReportTestResult