tests/run-tests.py
changeset 21754 7e14d026c4c4
parent 21753 b7baef94a333
child 21763 84cd5ee787ed
--- a/tests/run-tests.py	Fri Jun 13 14:33:02 2014 +0530
+++ b/tests/run-tests.py	Fri Jun 13 14:45:23 2014 +0530
@@ -1083,6 +1083,20 @@
         else:
             if not self._options.nodiff:
                 self.stream.write('\nERROR: %s output changed\n' % test)
+
+            if self._options.interactive:
+                iolock.acquire()
+                self.stream.write('Accept this change? [n] ')
+                answer = sys.stdin.readline().strip()
+                iolock.release()
+                if answer.lower() in ('y', 'yes'):
+                    if test.name.endswith('.t'):
+                        rename(test.errpath, test.path)
+                    else:
+                        rename(test.errpath, '%s.out' % test.path)
+                    self.failures.pop()
+                    return 1
+
             self.stream.write('!')
 
     def addError(self, *args, **kwargs):
@@ -1146,16 +1160,6 @@
             not os.path.exists(test.errpath):
             return
 
-        iolock.acquire()
-        print 'Accept this change? [n] ',
-        answer = sys.stdin.readline().strip()
-        iolock.release()
-        if answer.lower() in ('y', 'yes'):
-            if test.name.endswith('.t'):
-                rename(test.errpath, test.path)
-            else:
-                rename(test.errpath, '%s.out' % test.path)
-
     def startTest(self, test):
         super(TestResult, self).startTest(test)