Merge pull request #151 from sayrer/master
This makes reftest analyzer popup in masterMode
This commit is contained in:
commit
a77292846c
31
test/test.py
31
test/test.py
@ -248,6 +248,7 @@ def makeBrowserCommand(browser):
|
|||||||
if (name and name.find(key) > -1) or path.find(key) > -1:
|
if (name and name.find(key) > -1) or path.find(key) > -1:
|
||||||
command = types[key](browser)
|
command = types[key](browser)
|
||||||
command.name = command.name or key
|
command.name = command.name or key
|
||||||
|
break
|
||||||
|
|
||||||
if command is None:
|
if command is None:
|
||||||
raise Exception("Unrecognized browser: %s" % browser)
|
raise Exception("Unrecognized browser: %s" % browser)
|
||||||
@ -438,26 +439,30 @@ def checkLoad(task, results, browser):
|
|||||||
|
|
||||||
def processResults():
|
def processResults():
|
||||||
print ''
|
print ''
|
||||||
numErrors, numEqFailures, numEqNoSnapshot, numFBFFailures = State.numErrors, State.numEqFailures, State.numEqNoSnapshot, State.numFBFFailures
|
numFatalFailures = (State.numErrors + State.numFBFFailures)
|
||||||
numFatalFailures = (numErrors + numFBFFailures)
|
if 0 == State.numEqFailures and 0 == numFatalFailures:
|
||||||
if 0 == numEqFailures and 0 == numFatalFailures:
|
|
||||||
print 'All tests passed.'
|
print 'All tests passed.'
|
||||||
else:
|
else:
|
||||||
print 'OHNOES! Some tests failed!'
|
print 'OHNOES! Some tests failed!'
|
||||||
if 0 < numErrors:
|
if 0 < State.numErrors:
|
||||||
print ' errors:', numErrors
|
print ' errors:', State.numErrors
|
||||||
if 0 < numEqFailures:
|
if 0 < State.numEqFailures:
|
||||||
print ' different ref/snapshot:', numEqFailures
|
print ' different ref/snapshot:', State.numEqFailures
|
||||||
if 0 < numFBFFailures:
|
if 0 < State.numFBFFailures:
|
||||||
print ' different first/second rendering:', numFBFFailures
|
print ' different first/second rendering:', State.numFBFFailures
|
||||||
|
|
||||||
if State.masterMode and (0 < numEqFailures or 0 < numEqNoSnapshot):
|
|
||||||
|
def maybeUpdateRefImages(options, browser):
|
||||||
|
if options.masterMode and (0 < State.numEqFailures or 0 < State.numEqNoSnapshot):
|
||||||
print "Some eq tests failed or didn't have snapshots."
|
print "Some eq tests failed or didn't have snapshots."
|
||||||
print 'Checking to see if master references can be updated...'
|
print 'Checking to see if master references can be updated...'
|
||||||
|
numFatalFailures = (State.numErrors + State.numFBFFailures)
|
||||||
if 0 < numFatalFailures:
|
if 0 < numFatalFailures:
|
||||||
print ' No. Some non-eq tests failed.'
|
print ' No. Some non-eq tests failed.'
|
||||||
else:
|
else:
|
||||||
' Yes! The references in tmp/ can be synced with ref/.'
|
print ' Yes! The references in tmp/ can be synced with ref/.'
|
||||||
|
if options.reftest:
|
||||||
|
startReftest(browser)
|
||||||
if not prompt('Would you like to update the master copy in ref/?'):
|
if not prompt('Would you like to update the master copy in ref/?'):
|
||||||
print ' OK, not updating.'
|
print ' OK, not updating.'
|
||||||
else:
|
else:
|
||||||
@ -506,7 +511,9 @@ def main():
|
|||||||
t2 = time.time()
|
t2 = time.time()
|
||||||
print "Runtime was", int(t2 - t1), "seconds"
|
print "Runtime was", int(t2 - t1), "seconds"
|
||||||
|
|
||||||
if options.reftest and State.numEqFailures > 0:
|
if options.masterMode:
|
||||||
|
maybeUpdateRefImages(options, browsers[0])
|
||||||
|
elif options.reftest and State.numEqFailures > 0:
|
||||||
print "\nStarting reftest harness to examine %d eq test failures." % State.numEqFailures
|
print "\nStarting reftest harness to examine %d eq test failures." % State.numEqFailures
|
||||||
startReftest(browsers[0])
|
startReftest(browsers[0])
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user