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