[pypy-svn] r59237 - in pypy/build/testrunner: . test

pedronis at codespeak.net pedronis at codespeak.net
Sun Oct 19 17:11:29 CEST 2008


Author: pedronis
Date: Sun Oct 19 17:11:27 2008
New Revision: 59237

Modified:
   pypy/build/testrunner/runner.py
   pypy/build/testrunner/test/test_runner.py
Log:
print even more progress/debugging info



Modified: pypy/build/testrunner/runner.py
==============================================================================
--- pypy/build/testrunner/runner.py	(original)
+++ pypy/build/testrunner/runner.py	Sun Oct 19 17:11:27 2008
@@ -107,26 +107,36 @@
 
     N = run_param.parallel_runs
     failure = False
-    
-    result_queue =start_workers(N, run_param, testdirs)
+
+    for testname in testdirs:
+        out.write("-- %s\n" % testname)
+    out.write("-- %d to run\n" % len(testdirs))
+
+    result_queue = start_workers(N, run_param, testdirs)
 
     done = 0
+    started = 0
+
+    worker_done = 0
     while True:
         res = result_queue.get()
         if res is None:
-            done += 1
-            if done == N:
+            worker_done += 1
+            if worker_done == N:
                 break
             continue
 
         if res[0] == 'start':
-            out.write("++ starting %s\n" % res[1]) 
+            started += 1
+            out.write("++ starting %s [%d started in total]\n" % (res[1],
+                                                                  started)) 
             continue
         
         testname, somefailed, logdata, output = res[1:]
+        done += 1
         failure = failure or somefailed
 
-        heading = "__ %s " % testname
+        heading = "__ %s [%d done in total] " % (testname, done)
         
         out.write(heading + (79-len(heading))*'_'+'\n')
 
@@ -224,6 +234,7 @@
         if py.path.local(config_py_file).check(file=1):
             print >>out, "using config", config_py_file
             execfile(config_py_file, run_param.__dict__)
+    run_param.__dict__.pop('__builtins__', None)
     
     run_param.collect_testdirs(testdirs)
 

Modified: pypy/build/testrunner/test/test_runner.py
==============================================================================
--- pypy/build/testrunner/test/test_runner.py	(original)
+++ pypy/build/testrunner/test/test_runner.py	Sun Oct 19 17:11:27 2008
@@ -154,11 +154,11 @@
 
         out_lines = out.getvalue().splitlines()
 
-        assert len(out_lines) == 3
+        assert len(out_lines) == 5
 
-        assert out_lines[0].startswith("++ starting")
-        assert out_lines[2].startswith("run [")
-        for line in out_lines:
+        assert out_lines[2].startswith("++ starting")
+        assert out_lines[4].startswith("run [")
+        for line in out_lines[2:]:
             assert "test_normal" in line
 
     def test_many_dirs(self):



More information about the Pypy-commit mailing list