示例#1
0
文件: run_tests.py 项目: wlach/talos
def main(args=sys.argv[1:]):

  # parse command line options
  parser = optparse.OptionParser()
  parser.add_option('-d', '--debug', dest='debug',
                    action='store_true', default=False,
                    help="enable debug")
  parser.add_option('-n', '--noisy', dest='noisy',
                    action='store_true', default=False,
                    help="enable noisy output")
  parser.add_option('-s', '--screen', dest='screen',
                    action='store_true', default=False,
                    help="set screen")
  parser.add_option('--amo', dest='amo',
                    action='store_true', default=False,
                    help="set AMO")
  options, args = parser.parse_args(args)

  # set variables
  if options.debug:
    print 'setting debug'
    utils.setdebug(1)
  if options.noisy:
    utils.setnoisy(1)

  # Read in each config file and run the tests on it.
  for arg in args:
    utils.debug("running test file " + arg)
    test_file(arg, options.screen, options.amo)
示例#2
0
      print 'FAIL: Busted: ' + test
      print 'FAIL: ' + e.msg
      sys.exit(0)
    utils.debug("Received test results: " + " ".join(browser_dump))
    results[test] = [browser_dump, counter_dump]
    utils.stamped_msg("Completed test " + test, "Stopped")
  utils.stamped_msg(title, "Stopped")

  #process the results
  if (results_server != '') and (results_link != ''):
    #send results to the graph server
    utils.stamped_msg("Sending results", "Started")
    send_to_graph(results_server, results_link, title, date, browser_config, results)
    utils.stamped_msg("Completed sending results", "Stopped")
  if csv_dir != '':
    send_to_csv(csv_dir, results)
  
if __name__=='__main__':
  optlist, args = getopt.getopt(sys.argv[1:], 'dn', ['debug', 'noisy'])
  for o, a in optlist:
    if o in ('-d', "--debug"):
      print 'setting debug'
      utils.setdebug(1)
    if o in ('-n', "--noisy"):
      utils.setnoisy(1)
  # Read in each config file and run the tests on it.
  for arg in args:
    utils.debug("running test file " + arg)
    test_file(arg)

            print 'FAIL: ' + e.msg
            sys.exit(0)
        utils.debug("Received test results: " + " ".join(browser_dump))
        results[test] = [browser_dump, counter_dump]
        utils.stamped_msg("Completed test " + test, "Stopped")
    utils.stamped_msg(title, "Stopped")

    #process the results
    if (results_server != '') and (results_link != ''):
        #send results to the graph server
        utils.stamped_msg("Sending results", "Started")
        send_to_graph(results_server, results_link, title, date,
                      browser_config, results)
        utils.stamped_msg("Completed sending results", "Stopped")
    if csv_dir != '':
        send_to_csv(csv_dir, results)


if __name__ == '__main__':
    optlist, args = getopt.getopt(sys.argv[1:], 'dn', ['debug', 'noisy'])
    for o, a in optlist:
        if o in ('-d', "--debug"):
            print 'setting debug'
            utils.setdebug(1)
        if o in ('-n', "--noisy"):
            utils.setnoisy(1)
    # Read in each config file and run the tests on it.
    for arg in args:
        utils.debug("running test file " + arg)
        test_file(arg)