comparison tests/run-tests.py @ 22361:eb6adf750954

run-tests: make --interactive work with --view
author Gregory Szorc <gregory.szorc@gmail.com>
date Sun, 31 Aug 2014 12:22:44 +0200
parents 102f0e926668
children c42e69268f5b
comparison
equal deleted inserted replaced
22360:3e483253213e 22361:eb6adf750954
1199 self.stream.write('\n') 1199 self.stream.write('\n')
1200 for line in lines: 1200 for line in lines:
1201 self.stream.write(line) 1201 self.stream.write(line)
1202 self.stream.flush() 1202 self.stream.flush()
1203 1203
1204 # handle interactive prompt without releasing iolock 1204 # handle interactive prompt without releasing iolock
1205 if self._options.interactive: 1205 if self._options.interactive:
1206 self.stream.write('Accept this change? [n] ') 1206 self.stream.write('Accept this change? [n] ')
1207 answer = sys.stdin.readline().strip() 1207 answer = sys.stdin.readline().strip()
1208 if answer.lower() in ('y', 'yes'): 1208 if answer.lower() in ('y', 'yes'):
1209 if test.name.endswith('.t'): 1209 if test.name.endswith('.t'):
1210 rename(test.errpath, test.path) 1210 rename(test.errpath, test.path)
1211 else: 1211 else:
1212 rename(test.errpath, '%s.out' % test.path) 1212 rename(test.errpath, '%s.out' % test.path)
1213 accepted = True 1213 accepted = True
1214 if not accepted and not failed: 1214 if not accepted and not failed:
1215 self.faildata[test.name] = ''.join(lines) 1215 self.faildata[test.name] = ''.join(lines)
1216 iolock.release() 1216 iolock.release()
1217 1217
1218 return accepted 1218 return accepted
1219 1219
1220 def startTest(self, test): 1220 def startTest(self, test):