##// END OF EJS Templates
run-tests: keep a list of passed tests
Matt Mackall -
r13992:ec4ae572 default
parent child Browse files
Show More
@@ -633,7 +633,7 b' def run(cmd, options, replacements):'
633 633 output = re.sub(s, r, output)
634 634 return ret, splitnewlines(output)
635 635
636 def runone(options, test, skips, fails, ignores):
636 def runone(options, test, skips, passes, fails, ignores):
637 637 '''tristate output:
638 638 None -> skipped
639 639 True -> passed
@@ -745,6 +745,8 b' def runone(options, test, skips, fails, '
745 745 signal.alarm(0)
746 746
747 747 mark = '.'
748 if ret == 0:
749 passes.append(test)
748 750
749 751 skipped = (ret == SKIPPED_STATUS)
750 752
@@ -935,10 +937,6 b' def runtests(options, tests):'
935 937 print 'WARNING: cannot run tests with timeouts'
936 938 options.timeout = 0
937 939
938 tested = 0
939 failed = 0
940 skipped = 0
941
942 940 if options.restart:
943 941 orig = list(tests)
944 942 while tests:
@@ -949,6 +947,7 b' def runtests(options, tests):'
949 947 print "running all tests"
950 948 tests = orig
951 949
950 passes = []
952 951 skips = []
953 952 fails = []
954 953 ignores = []
@@ -958,21 +957,15 b' def runtests(options, tests):'
958 957 filename = options.blacklist.get(test)
959 958 if filename is not None:
960 959 skipped.append((test, "blacklisted (%s)" % filename))
961 skipped += 1
962 960 continue
963 961
964 962 if options.retest and not os.path.exists(test + ".err"):
965 963 ignores.append((test, "not retesting"))
966 964 continue
967 965
968 ret = runone(options, test, skips, fails, ignores)
969 if ret is None:
970 skipped += 1
971 elif not ret:
972 failed += 1
973 if options.first:
974 break
975 tested += 1
966 ret = runone(options, test, skips, passes, fails, ignores)
967 if options.first and ret is not None and not ret:
968 break
976 969
977 970 if options.child:
978 971 fp = os.fdopen(options.child, 'w')
@@ -990,7 +983,7 b' def runtests(options, tests):'
990 983 print "Failed %s: %s" % s
991 984 _checkhglib("Tested")
992 985 print "# Ran %d tests, %d skipped, %d failed." % (
993 tested, len(skips) + len(ignores), failed)
986 len(passes) + len(fails), len(skips) + len(ignores), len(fails))
994 987
995 988 if options.anycoverage:
996 989 outputcoverage(options)
@@ -998,7 +991,7 b' def runtests(options, tests):'
998 991 failed = True
999 992 print "\ninterrupted!"
1000 993
1001 if failed:
994 if fails:
1002 995 sys.exit(1)
1003 996
1004 997 def main():
General Comments 0
You need to be logged in to leave comments. Login now