##// END OF EJS Templates
run-tests: move results global into TestRunner
Gregory Szorc -
r21359:7982475d default
parent child Browse files
Show More
@@ -991,7 +991,6 b' def _gethgpath():'
991 pipe.close()
991 pipe.close()
992 return _hgpath
992 return _hgpath
993
993
994 results = {'.':[], '!':[], '~': [], 's':[], 'i':[]}
995 iolock = threading.Lock()
994 iolock = threading.Lock()
996 abort = False
995 abort = False
997
996
@@ -1018,7 +1017,7 b' def scheduletests(runner, tests):'
1018 if not done.empty() or running == jobs or not tests:
1017 if not done.empty() or running == jobs or not tests:
1019 try:
1018 try:
1020 code, test, msg = done.get(True, 1)
1019 code, test, msg = done.get(True, 1)
1021 results[code].append((test, msg))
1020 runner.results[code].append((test, msg))
1022 if runner.options.first and code not in '.si':
1021 if runner.options.first and code not in '.si':
1023 break
1022 break
1024 except queue.Empty:
1023 except queue.Empty:
@@ -1055,24 +1054,24 b' def runtests(runner, tests):'
1055
1054
1056 scheduletests(runner, tests)
1055 scheduletests(runner, tests)
1057
1056
1058 failed = len(results['!'])
1057 failed = len(runner.results['!'])
1059 warned = len(results['~'])
1058 warned = len(runner.results['~'])
1060 tested = len(results['.']) + failed + warned
1059 tested = len(runner.results['.']) + failed + warned
1061 skipped = len(results['s'])
1060 skipped = len(runner.results['s'])
1062 ignored = len(results['i'])
1061 ignored = len(runner.results['i'])
1063
1062
1064 print
1063 print
1065 if not runner.options.noskips:
1064 if not runner.options.noskips:
1066 for s in results['s']:
1065 for s in runner.results['s']:
1067 print "Skipped %s: %s" % s
1066 print "Skipped %s: %s" % s
1068 for s in results['~']:
1067 for s in runner.results['~']:
1069 print "Warned %s: %s" % s
1068 print "Warned %s: %s" % s
1070 for s in results['!']:
1069 for s in runner.results['!']:
1071 print "Failed %s: %s" % s
1070 print "Failed %s: %s" % s
1072 runner.checkhglib("Tested")
1071 runner.checkhglib("Tested")
1073 print "# Ran %d tests, %d skipped, %d warned, %d failed." % (
1072 print "# Ran %d tests, %d skipped, %d warned, %d failed." % (
1074 tested, skipped + ignored, warned, failed)
1073 tested, skipped + ignored, warned, failed)
1075 if results['!']:
1074 if runner.results['!']:
1076 print 'python hash seed:', os.environ['PYTHONHASHSEED']
1075 print 'python hash seed:', os.environ['PYTHONHASHSEED']
1077 if runner.options.time:
1076 if runner.options.time:
1078 runner.outputtimes()
1077 runner.outputtimes()
@@ -1109,6 +1108,13 b' class TestRunner(object):'
1109 self.pythondir = None
1108 self.pythondir = None
1110 self.coveragefile = None
1109 self.coveragefile = None
1111 self.times = [] # Holds execution times of tests.
1110 self.times = [] # Holds execution times of tests.
1111 self.results = {
1112 '.': [],
1113 '!': [],
1114 '~': [],
1115 's': [],
1116 'i': [],
1117 }
1112 self._createdfiles = []
1118 self._createdfiles = []
1113
1119
1114 def gettest(self, test, count):
1120 def gettest(self, test, count):
General Comments 0
You need to be logged in to leave comments. Login now