示例#1
0
            options.tests = json.loads(urllib2.urlopen(tests_url + test_extra_params).read())
        except urllib2.HTTPError, e:
            sys.stderr.write('Could not get test list: %s\n' % e)
            sys.exit(errno.EPERM)
        except urllib2.URLError, e:
            sys.stderr.write('Could not get test list: %s\n' % e.reason)
            sys.exit(e.reason.errno)

    browsers = args

    conf_browsers = config.get_str(config.platform, "browsers")
    if browsers is None or len(browsers) == 0 and conf_browsers is not None:
        browsers = conf_browsers.split()

    global runner
    runner = BrowserRunner(evt, browsers, options.tests, testconfig)
    print 'Starting HTTP server...'
    trs = TestRunnerHTTPServer(('', config.local_port), runner)
    server_thread = threading.Thread(target=trs.serve_forever)
    server_thread.daemon = True
    server_thread.start()

    cycle_count = 0

    global report
    report = TestReport()

    runner.cycle_count = cycle_count
    runner.cycles = options.cycles

    while options.cycles == -1 or cycle_count < options.cycles:
示例#2
0
            options.tests = json.loads(urllib2.urlopen(tests_url + test_extra_params).read())
        except urllib2.HTTPError, e:
            sys.stderr.write('Could not get test list: %s\n' % e)
            sys.exit(errno.EPERM)
        except urllib2.URLError, e:
            sys.stderr.write('Could not get test list: %s\n' % e.reason)
            sys.exit(e.reason.errno)

    browsers = args

    conf_browsers = config.get_str(config.platform, "browsers")
    if browsers is None or len(browsers) == 0 and conf_browsers is not None:
        browsers = conf_browsers.split()

    global runner
    runner = BrowserRunner(evt, browsers, options.tests, testconfig)
    print 'Starting HTTP server...'
    trs = TestRunnerHTTPServer(('', config.local_port), runner)
    server_thread = threading.Thread(target=trs.serve_forever)
    server_thread.daemon = True
    server_thread.start()

    cycle_count = 0

    global report
    report = TestReport()

    while options.cycles == -1 or cycle_count < options.cycles:
        try:
            start = datetime.datetime.now()
            print '==== Starting test cycle %d ====' % (cycle_count+1)