[Zodb-checkins] CVS: StandaloneZODB - test.py:1.10.6.6

Guido van Rossum guido@python.org
Wed, 9 Jan 2002 22:57:27 -0500


Update of /cvs-repository/StandaloneZODB
In directory cvs.zope.org:/tmp/cvs-serv6798

Modified Files:
      Tag: Standby-branch
	test.py 
Log Message:
Add -d option.  This runs the tests without collecting the traceback
information in a testrunner object.  This is handy for debugging
hangs.  It doesn't print the test name or progress or any other fancy
stuff; but you usually don't care about that when you need this. :-)


=== StandaloneZODB/test.py 1.10.6.5 => 1.10.6.6 ===
             while 1:
                 for suite in suites:
-                    runner.run(suite)
+                    if debug:
+                        suite.debug()
+                    else:
+                        runner.run(suite)
                 gc.collect()
                 check_mem()
         else:
@@ -170,6 +173,9 @@
                 s = get_suite(file)
                 if s is not None:
                     suite.addTest(s)
+            if debug:
+                suite.debug()
+                return 0
             r = runner.run(suite)
             return len(r.errors) + len(r.failures)
         else:
@@ -178,8 +184,11 @@
                 suite = get_suite(file)
                 if suite is None:
                     continue
-                r = runner.run(suite)
-                bad += len(r.errors) + len(r.failures)
+                if debug:
+                    suite.debug()
+                else:
+                    r = runner.run(suite)
+                    bad += len(r.errors) + len(r.failures)
             return bad
 
 if __name__ == "__main__":
@@ -189,12 +198,15 @@
     VERBOSE = 0
     LOOP = 0
     MERGE_SUITES = 1
+    DEBUG = 0 # Don't collect test results; simply let tests crash
     build = 0
 
-    opts, args = getopt.getopt(sys.argv[1:], 'vLib')
+    opts, args = getopt.getopt(sys.argv[1:], 'vdLib')
     for k, v in opts:
         if k == '-v':
             VERBOSE = VERBOSE + 1
+        elif k == '-d':
+            debug = 1
         elif k == '-L':
             LOOP = 1
         elif k == '-i':