Mercurial > hg
comparison tests/run-tests.py @ 21386:3b0c522f04aa
run-test: restore the -i prompt by write .err before checking if it exists
The `--interactive` flag workis by overwriting the original test file by its
`.err` version. So we need to write it before calling `self.fail`. Otherwise the
`.err` file does not exists and `--interactive` is ignored.
We can move that block code around because it is dedicated to write changed
output and we moves it in the try-except dedicated to handling changed output.
Note that the flog is still badly broken after this change. But at least it crash
instead of being ignored.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Sat, 17 May 2014 00:37:06 -0700 |
parents | 28414e5ac9ec |
children | 82f8d4e95c87 |
comparison
equal
deleted
inserted
replaced
21385:28414e5ac9ec | 21386:3b0c522f04aa |
---|---|
471 if ret: | 471 if ret: |
472 msg += 'output changed and ' + describe(ret) | 472 msg += 'output changed and ' + describe(ret) |
473 else: | 473 else: |
474 msg += 'output changed' | 474 msg += 'output changed' |
475 | 475 |
476 if (ret != 0 or out != self._refout) and not skipped \ | |
477 and not options.debug: | |
478 f = open(self._errpath, 'wb') | |
479 for line in out: | |
480 f.write(line) | |
481 f.close() | |
476 res = self.fail(msg, ret) | 482 res = self.fail(msg, ret) |
477 elif ret: | 483 elif ret: |
478 res = self.fail(describe(ret), ret) | 484 res = self.fail(describe(ret), ret) |
479 else: | 485 else: |
480 res = self.success() | 486 res = self.success() |
481 | 487 |
482 if (ret != 0 or out != self._refout) and not skipped \ | |
483 and not options.debug: | |
484 f = open(self._errpath, 'wb') | |
485 for line in out: | |
486 f.write(line) | |
487 f.close() | |
488 | 488 |
489 vlog("# Ret was:", ret) | 489 vlog("# Ret was:", ret) |
490 | 490 |
491 if not options.verbose: | 491 if not options.verbose: |
492 iolock.acquire() | 492 iolock.acquire() |