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.
--- a/tests/run-tests.py Sun Apr 20 11:04:25 2014 -0700
+++ b/tests/run-tests.py Sat May 17 00:37:06 2014 -0700
@@ -473,18 +473,18 @@
else:
msg += 'output changed'
+ if (ret != 0 or out != self._refout) and not skipped \
+ and not options.debug:
+ f = open(self._errpath, 'wb')
+ for line in out:
+ f.write(line)
+ f.close()
res = self.fail(msg, ret)
elif ret:
res = self.fail(describe(ret), ret)
else:
res = self.success()
- if (ret != 0 or out != self._refout) and not skipped \
- and not options.debug:
- f = open(self._errpath, 'wb')
- for line in out:
- f.write(line)
- f.close()
vlog("# Ret was:", ret)