Skip to content

Commit a772928

Browse files
committed
Merge pull request mozilla#151 from sayrer/master
This makes reftest analyzer popup in masterMode
2 parents 30bf683 + 53dcb85 commit a772928

File tree

1 file changed

+20
-13
lines changed

1 file changed

+20
-13
lines changed

test/test.py

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ def makeBrowserCommand(browser):
248248
if (name and name.find(key) > -1) or path.find(key) > -1:
249249
command = types[key](browser)
250250
command.name = command.name or key
251+
break
251252

252253
if command is None:
253254
raise Exception("Unrecognized browser: %s" % browser)
@@ -438,26 +439,30 @@ def checkLoad(task, results, browser):
438439

439440
def processResults():
440441
print ''
441-
numErrors, numEqFailures, numEqNoSnapshot, numFBFFailures = State.numErrors, State.numEqFailures, State.numEqNoSnapshot, State.numFBFFailures
442-
numFatalFailures = (numErrors + numFBFFailures)
443-
if 0 == numEqFailures and 0 == numFatalFailures:
442+
numFatalFailures = (State.numErrors + State.numFBFFailures)
443+
if 0 == State.numEqFailures and 0 == numFatalFailures:
444444
print 'All tests passed.'
445445
else:
446446
print 'OHNOES! Some tests failed!'
447-
if 0 < numErrors:
448-
print ' errors:', numErrors
449-
if 0 < numEqFailures:
450-
print ' different ref/snapshot:', numEqFailures
451-
if 0 < numFBFFailures:
452-
print ' different first/second rendering:', numFBFFailures
453-
454-
if State.masterMode and (0 < numEqFailures or 0 < numEqNoSnapshot):
447+
if 0 < State.numErrors:
448+
print ' errors:', State.numErrors
449+
if 0 < State.numEqFailures:
450+
print ' different ref/snapshot:', State.numEqFailures
451+
if 0 < State.numFBFFailures:
452+
print ' different first/second rendering:', State.numFBFFailures
453+
454+
455+
def maybeUpdateRefImages(options, browser):
456+
if options.masterMode and (0 < State.numEqFailures or 0 < State.numEqNoSnapshot):
455457
print "Some eq tests failed or didn't have snapshots."
456458
print 'Checking to see if master references can be updated...'
459+
numFatalFailures = (State.numErrors + State.numFBFFailures)
457460
if 0 < numFatalFailures:
458461
print ' No. Some non-eq tests failed.'
459462
else:
460-
' Yes! The references in tmp/ can be synced with ref/.'
463+
print ' Yes! The references in tmp/ can be synced with ref/.'
464+
if options.reftest:
465+
startReftest(browser)
461466
if not prompt('Would you like to update the master copy in ref/?'):
462467
print ' OK, not updating.'
463468
else:
@@ -506,7 +511,9 @@ def main():
506511
t2 = time.time()
507512
print "Runtime was", int(t2 - t1), "seconds"
508513

509-
if options.reftest and State.numEqFailures > 0:
514+
if options.masterMode:
515+
maybeUpdateRefImages(options, browsers[0])
516+
elif options.reftest and State.numEqFailures > 0:
510517
print "\nStarting reftest harness to examine %d eq test failures." % State.numEqFailures
511518
startReftest(browsers[0])
512519

0 commit comments

Comments
 (0)