Commit 6bb0ee95 authored by Stefan Behnel's avatar Stefan Behnel

Fix some stats issues in the test runner.

parent 05abd2ba
...@@ -581,9 +581,10 @@ class Stats(object): ...@@ -581,9 +581,10 @@ class Stats(object):
self.add_time(metric, t) self.add_time(metric, t)
def print_stats(self, out=sys.stderr): def print_stats(self, out=sys.stderr):
lines = ['Times:'] lines = ['Times:\n']
for metric, t in sorted(self.test_times.items()): for metric, t in sorted(self.test_times.items()):
lines.append("%-12s: %5.2f sec (%.3f / run)\n" % (metric, t, t / self.test_counts[metric])) count = self.test_counts[metric]
lines.append("%-12s: %8.2f sec (%d, %.3f / run)\n" % (metric, t, count, t / count))
out.write(''.join(lines)) out.write(''.join(lines))
...@@ -1746,9 +1747,8 @@ class EmbedTest(unittest.TestCase): ...@@ -1746,9 +1747,8 @@ class EmbedTest(unittest.TestCase):
if sys.version_info[0] >=3 and CY3_DIR: if sys.version_info[0] >=3 and CY3_DIR:
cython = os.path.join(CY3_DIR, cython) cython = os.path.join(CY3_DIR, cython)
cython = os.path.abspath(os.path.join('..', '..', cython)) cython = os.path.abspath(os.path.join('..', '..', cython))
with self.stats.time('embed'): self.assertEqual(0, os.system(
self.assertTrue(os.system( "make PYTHON='%s' CYTHON='%s' LIBDIR1='%s' test > make.output" % (sys.executable, cython, libdir)))
"make PYTHON='%s' CYTHON='%s' LIBDIR1='%s' test > make.output" % (sys.executable, cython, libdir)) == 0)
try: try:
os.remove('make.output') os.remove('make.output')
except OSError: except OSError:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment