@@ -248,6 +248,7 @@ def makeBrowserCommand(browser):
248
248
if (name and name .find (key ) > - 1 ) or path .find (key ) > - 1 :
249
249
command = types [key ](browser )
250
250
command .name = command .name or key
251
+ break
251
252
252
253
if command is None :
253
254
raise Exception ("Unrecognized browser: %s" % browser )
@@ -438,26 +439,30 @@ def checkLoad(task, results, browser):
438
439
439
440
def processResults ():
440
441
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 :
444
444
print 'All tests passed.'
445
445
else :
446
446
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 ):
455
457
print "Some eq tests failed or didn't have snapshots."
456
458
print 'Checking to see if master references can be updated...'
459
+ numFatalFailures = (State .numErrors + State .numFBFFailures )
457
460
if 0 < numFatalFailures :
458
461
print ' No. Some non-eq tests failed.'
459
462
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 )
461
466
if not prompt ('Would you like to update the master copy in ref/?' ):
462
467
print ' OK, not updating.'
463
468
else :
@@ -506,7 +511,9 @@ def main():
506
511
t2 = time .time ()
507
512
print "Runtime was" , int (t2 - t1 ), "seconds"
508
513
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 :
510
517
print "\n Starting reftest harness to examine %d eq test failures." % State .numEqFailures
511
518
startReftest (browsers [0 ])
512
519
0 commit comments