changeset 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
files tests/run-tests.py
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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)