run-tests: don't print results in unittest mode
A subsequent patch will have unittest print tests for us. Don't perform
old-style printing when in unittest mode.
--- a/tests/run-tests.py Sun Apr 20 15:53:25 2014 -0700
+++ b/tests/run-tests.py Sun Apr 20 16:17:18 2014 -0700
@@ -1315,6 +1315,9 @@
tests = [self._gettest(t, i, asunit=self.options.unittest)
for i, t in enumerate(tests)]
+ failed = False
+ warned = False
+
if self.options.unittest:
suite = TestSuite(self, tests=tests)
verbosity = 1
@@ -1325,27 +1328,27 @@
else:
self._executetests(tests)
- failed = len(self.results['!'])
- warned = len(self.results['~'])
- tested = len(self.results['.']) + failed + warned
- skipped = len(self.results['s'])
- ignored = len(self.results['i'])
+ failed = len(self.results['!'])
+ warned = len(self.results['~'])
+ tested = len(self.results['.']) + failed + warned
+ skipped = len(self.results['s'])
+ ignored = len(self.results['i'])
- print
- if not self.options.noskips:
- for s in self.results['s']:
- print "Skipped %s: %s" % s
- for s in self.results['~']:
- print "Warned %s: %s" % s
- for s in self.results['!']:
- print "Failed %s: %s" % s
- self._checkhglib("Tested")
- print "# Ran %d tests, %d skipped, %d warned, %d failed." % (
- tested, skipped + ignored, warned, failed)
- if self.results['!']:
- print 'python hash seed:', os.environ['PYTHONHASHSEED']
- if self.options.time:
- self._outputtimes()
+ print
+ if not self.options.noskips:
+ for s in self.results['s']:
+ print "Skipped %s: %s" % s
+ for s in self.results['~']:
+ print "Warned %s: %s" % s
+ for s in self.results['!']:
+ print "Failed %s: %s" % s
+ self._checkhglib("Tested")
+ print "# Ran %d tests, %d skipped, %d warned, %d failed." % (
+ tested, skipped + ignored, warned, failed)
+ if self.results['!']:
+ print 'python hash seed:', os.environ['PYTHONHASHSEED']
+ if self.options.time:
+ self._outputtimes()
if self.options.anycoverage:
self._outputcoverage()