run-tests: fix --interactive (after 994ad067ac6e) stable
authorPatrick Mezard <pmezard@gmail.com>
Sun, 24 Apr 2011 23:33:48 +0200
branchstable
changeset 910 b8ae2e290420
parent 909 5ec26580cbb2
child 911 f3ab526d8761
child 912 17e4691cc491
run-tests: fix --interactive (after 994ad067ac6e) - Do not prompt if there is no .err file - Fix source and target paths [ original upstream message ]
tests/run-tests.py
--- a/tests/run-tests.py	Fri Apr 22 14:04:34 2011 -0500
+++ b/tests/run-tests.py	Sun Apr 24 23:33:48 2011 +0200
@@ -651,14 +651,15 @@
     def fail(msg, ret):
         if not options.nodiff:
             print "\nERROR: %s %s" % (testpath, msg)
-        if not ret and options.interactive:
+        if (not ret and options.interactive
+            and os.path.exists(testpath + ".err")):
             print "Accept this change? [n] ",
             answer = sys.stdin.readline().strip()
             if answer.lower() in "y yes".split():
                 if test.endswith(".t"):
-                    rename(test + ".err", test)
+                    rename(testpath + ".err", testpath)
                 else:
-                    rename(test + ".err", test + ".out")
+                    rename(testpath + ".err", testpath + ".out")
                 return
         results['f'].append((test, msg))