Always write eq.log, and optionally start reftest.

This commit is contained in:
Rob Sayre 2011-06-27 12:37:12 -07:00
parent 04dadb0f8f
commit 4b96c06c27

View File

@ -28,6 +28,9 @@ class TestOptions(OptionParser):
self.add_option("--browserManifestFile", action="store", type="string",
dest="browserManifestFile",
help="A JSON file in the form of those found in resources/browser_manifests")
self.add_option("--reftest", action="store_true", dest="reftest",
help="Automatically start reftest showing comparison test failures, if there are any.",
default=False)
self.set_usage(USAGE_EXAMPLE)
def verifyOptions(self, options):
@ -121,8 +124,6 @@ class PDFTestHandler(BaseHTTPRequestHandler):
self.sendFile(path, ext)
def do_POST(self):
numBytes = int(self.headers['Content-Length'])
@ -327,9 +328,7 @@ def checkEq(task, results, browser):
eq = (ref == snapshot)
if not eq:
print 'TEST-UNEXPECTED-FAIL | eq', taskId, '| in', browser, '| rendering of page', page + 1, '!= reference rendering'
# XXX need to dump this always, somehow, when we have
# the reference repository
if State.masterMode:
if not State.eqLog:
State.eqLog = open(EQLOG_FILE, 'w')
eqLog = State.eqLog
@ -416,6 +415,15 @@ def processResults():
print 'done'
def startReftest(browser):
try:
browser.setup()
browser.start("resources/reftest-analyzer.xhtml")
print "Waiting for browser..."
browser.process.wait()
finally:
teardownBrowsers([browser])
print "Completed reftest usage."
def main():
t1 = time.time()
@ -441,5 +449,9 @@ def main():
t2 = time.time()
print "Runtime was", int(t2 - t1), "seconds"
if options.reftest and State.numEqFailures > 0:
print "\nStarting reftest harness to examine %d eq test failures." % State.numEqFailures
startReftest(browsers[0])
if __name__ == '__main__':
main()