##// END OF EJS Templates
run-tests: move checkhglib into TestRunner
Gregory Szorc -
r21354:29629ef4 default
parent child Browse files
Show More
@@ -1041,16 +1041,6 b' def _gethgpath():'
1041 pipe.close()
1041 pipe.close()
1042 return _hgpath
1042 return _hgpath
1043
1043
1044 def _checkhglib(runner, verb):
1045 """Ensure that the 'mercurial' package imported by python is
1046 the one we expect it to be. If not, print a warning to stderr."""
1047 expecthg = os.path.join(runner.pythondir, 'mercurial')
1048 actualhg = _gethgpath()
1049 if os.path.abspath(actualhg) != os.path.abspath(expecthg):
1050 sys.stderr.write('warning: %s with unexpected mercurial lib: %s\n'
1051 ' (expected %s)\n'
1052 % (verb, actualhg, expecthg))
1053
1054 results = {'.':[], '!':[], '~': [], 's':[], 'i':[]}
1044 results = {'.':[], '!':[], '~': [], 's':[], 'i':[]}
1055 times = []
1045 times = []
1056 iolock = threading.Lock()
1046 iolock = threading.Lock()
@@ -1100,7 +1090,7 b' def runtests(runner, tests):'
1100 try:
1090 try:
1101 if runner.inst:
1091 if runner.inst:
1102 runner.installhg()
1092 runner.installhg()
1103 _checkhglib(runner, "Testing")
1093 runner.checkhglib("Testing")
1104 else:
1094 else:
1105 runner.usecorrectpython()
1095 runner.usecorrectpython()
1106
1096
@@ -1130,7 +1120,7 b' def runtests(runner, tests):'
1130 print "Warned %s: %s" % s
1120 print "Warned %s: %s" % s
1131 for s in results['!']:
1121 for s in results['!']:
1132 print "Failed %s: %s" % s
1122 print "Failed %s: %s" % s
1133 _checkhglib(runner, "Tested")
1123 runner.checkhglib("Tested")
1134 print "# Ran %d tests, %d skipped, %d warned, %d failed." % (
1124 print "# Ran %d tests, %d skipped, %d warned, %d failed." % (
1135 tested, skipped + ignored, warned, failed)
1125 tested, skipped + ignored, warned, failed)
1136 if results['!']:
1126 if results['!']:
@@ -1301,6 +1291,16 b' class TestRunner(object):'
1301 fn = os.path.join(self.inst, '..', '.coverage')
1291 fn = os.path.join(self.inst, '..', '.coverage')
1302 os.environ['COVERAGE_FILE'] = fn
1292 os.environ['COVERAGE_FILE'] = fn
1303
1293
1294 def checkhglib(self, verb):
1295 """Ensure that the 'mercurial' package imported by python is
1296 the one we expect it to be. If not, print a warning to stderr."""
1297 expecthg = os.path.join(self.pythondir, 'mercurial')
1298 actualhg = _gethgpath()
1299 if os.path.abspath(actualhg) != os.path.abspath(expecthg):
1300 sys.stderr.write('warning: %s with unexpected mercurial lib: %s\n'
1301 ' (expected %s)\n'
1302 % (verb, actualhg, expecthg))
1303
1304 def main(args, parser=None):
1304 def main(args, parser=None):
1305 runner = TestRunner()
1305 runner = TestRunner()
1306
1306
General Comments 0
You need to be logged in to leave comments. Login now