]> granicus.if.org Git - python/commitdiff
Added the resource name "all" to enable all of the optional resource uses.
authorFred Drake <fdrake@acm.org>
Thu, 11 Apr 2002 16:39:16 +0000 (16:39 +0000)
committerFred Drake <fdrake@acm.org>
Thu, 11 Apr 2002 16:39:16 +0000 (16:39 +0000)
This is nice for use with "make TESTOPTS='-u all' test".

Lib/test/regrtest.py

index 9e2bc25e13b386457c6644dbff0951a6b3fb737c..826ac607b5e359d87d5f1a7e7dffc9102f0f5a26 100755 (executable)
@@ -36,6 +36,8 @@ those requiring large file support or network connectivity.  The argument is a
 comma-separated list of words indicating the resources to test.  Currently
 only the following are defined:
 
+    all -       Enable all special resources.
+
     curses -    Tests that use curses and will modify the terminal's
                 state and output modes.
 
@@ -56,6 +58,10 @@ import StringIO
 
 import test_support
 
+
+RESOURCE_NAMES = ('curses', 'largefile', 'network')
+
+
 def usage(code, msg=''):
     print __doc__
     if msg: print msg
@@ -121,8 +127,11 @@ def main(tests=None, testdir=None, verbose=0, quiet=0, generate=0,
         elif o in ('-u', '--use'):
             u = [x.lower() for x in a.split(',')]
             for r in u:
-                if r not in ('curses', 'largefile', 'network'):
-                    usage(1, 'Invalid -u/--use option: %s' % a)
+                if r == 'all':
+                    use_resources = RESOURCE_NAMES
+                    break
+                if r not in RESOURCE_NAMES:
+                    usage(1, 'Invalid -u/--use option: ' + a)
             use_resources.extend(u)
     if generate and verbose:
         usage(2, "-g and -v don't go together!")