##// END OF EJS Templates
run-tests: move interactive handling into runone
Matt Mackall -
r13988:994ad067 default
parent child Browse files
Show More
@@ -646,11 +646,19 b' def runone(options, test, skips, fails):'
646 646 print "\nSkipping %s: %s" % (testpath, msg)
647 647 return None
648 648
649 def fail(msg):
650 fails.append((test, msg))
649 def fail(msg, ret):
651 650 if not options.nodiff:
652 651 print "\nERROR: %s %s" % (testpath, msg)
653 return None
652 if not ret and options.interactive:
653 print "Accept this change? [n] ",
654 answer = sys.stdin.readline().strip()
655 if answer.lower() in "y yes".split():
656 if test.endswith(".t"):
657 rename(test + ".err", test)
658 else:
659 rename(test + ".err", test + ".out")
660 return
661 fails.append((test, msg))
654 662
655 663 vlog("# Test", test)
656 664
@@ -747,18 +755,18 b' def runone(options, test, skips, fails):'
747 755 if not missing:
748 756 missing = ['irrelevant']
749 757 if failed:
750 fail("hghave failed checking for %s" % failed[-1])
758 fail("hghave failed checking for %s" % failed[-1], ret)
751 759 skipped = False
752 760 else:
753 761 skip(missing[-1])
754 762 elif out != refout:
755 763 mark = '!'
756 764 if ret == 'timeout':
757 fail("timed out")
765 fail("timed out", ret)
758 766 elif ret:
759 fail("output changed and returned error code %d" % ret)
767 fail("output changed and returned error code %d" % ret, ret)
760 768 else:
761 fail("output changed")
769 fail("output changed", ret)
762 770 if ret != 'timeout' and not options.nodiff:
763 771 if options.view:
764 772 os.system("%s %s %s" % (options.view, ref, err))
@@ -767,7 +775,7 b' def runone(options, test, skips, fails):'
767 775 ret = 1
768 776 elif ret:
769 777 mark = '!'
770 fail("returned error code %d" % ret)
778 fail("returned error code %d" % ret, ret)
771 779
772 780 if not options.verbose:
773 781 sys.stdout.write(mark)
@@ -950,17 +958,6 b' def runtests(options, tests):'
950 958 if ret is None:
951 959 skipped += 1
952 960 elif not ret:
953 if options.interactive:
954 print "Accept this change? [n] ",
955 answer = sys.stdin.readline().strip()
956 if answer.lower() in "y yes".split():
957 if test.endswith(".t"):
958 rename(test + ".err", test)
959 else:
960 rename(test + ".err", test + ".out")
961 tested += 1
962 fails.pop()
963 continue
964 961 failed += 1
965 962 if options.first:
966 963 break
General Comments 0
You need to be logged in to leave comments. Login now