@@ -439,26 +439,30 @@ def checkLoad(task, results, browser):
439
439
440
440
def processResults ():
441
441
print ''
442
- numErrors , numEqFailures , numEqNoSnapshot , numFBFFailures = State .numErrors , State .numEqFailures , State .numEqNoSnapshot , State .numFBFFailures
443
- numFatalFailures = (numErrors + numFBFFailures )
444
- if 0 == numEqFailures and 0 == numFatalFailures :
442
+ numFatalFailures = (State .numErrors + State .numFBFFailures )
443
+ if 0 == State .numEqFailures and 0 == numFatalFailures :
445
444
print 'All tests passed.'
446
445
else :
447
446
print 'OHNOES! Some tests failed!'
448
- if 0 < numErrors :
449
- print ' errors:' , numErrors
450
- if 0 < numEqFailures :
451
- print ' different ref/snapshot:' , numEqFailures
452
- if 0 < numFBFFailures :
453
- print ' different first/second rendering:' , numFBFFailures
454
-
455
- 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 ):
456
457
print "Some eq tests failed or didn't have snapshots."
457
458
print 'Checking to see if master references can be updated...'
459
+ numFatalFailures = (State .numErrors + State .numFBFFailures )
458
460
if 0 < numFatalFailures :
459
461
print ' No. Some non-eq tests failed.'
460
462
else :
461
- ' 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 )
462
466
if not prompt ('Would you like to update the master copy in ref/?' ):
463
467
print ' OK, not updating.'
464
468
else :
@@ -507,7 +511,9 @@ def main():
507
511
t2 = time .time ()
508
512
print "Runtime was" , int (t2 - t1 ), "seconds"
509
513
510
- if options .reftest and State .numEqFailures > 0 :
514
+ if options .masterMode :
515
+ maybeUpdateRefImages (options , browsers [0 ])
516
+ elif options .reftest and State .numEqFailures > 0 :
511
517
print "\n Starting reftest harness to examine %d eq test failures." % State .numEqFailures
512
518
startReftest (browsers [0 ])
513
519
0 commit comments