]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Add a way to say "use any resource except A". For example, to run
authorFred Drake <fdrake@acm.org>
Tue, 26 Nov 2002 21:44:56 +0000 (21:44 +0000)
committerFred Drake <fdrake@acm.org>
Tue, 26 Nov 2002 21:44:56 +0000 (21:44 +0000)
allow the use of any resource except bsddb, give the option
"-uall,-bsddb".

Lib/test/regrtest.py
Misc/NEWS

index f870527088e98ef99a8fefb6000509c288ab1ee4..1590ab1e8424d165b31dfd687b9b331a8255bed3 100755 (executable)
@@ -58,6 +58,10 @@ resources to test.  Currently only the following are defined:
 
     bsddb -     It is okay to run the bsddb testsuite, which takes
                 a long time to complete.
+
+To enable all resources except one, use '-uall,-<resource>'.  For
+example, to run all the tests except for the bsddb tests, give the
+option '-uall,-bsddb'.
 """
 
 import sys
@@ -155,11 +159,18 @@ def main(tests=None, testdir=None, verbose=0, quiet=0, generate=0,
             u = [x.lower() for x in a.split(',')]
             for r in u:
                 if r == 'all':
-                    use_resources = RESOURCE_NAMES
-                    break
+                    use_resources[:] = RESOURCE_NAMES
+                    continue
+                remove = False
+                if r[0] == '-':
+                    remove = True
+                    r = r[1:]
                 if r not in RESOURCE_NAMES:
                     usage(1, 'Invalid -u/--use option: ' + a)
-                if r not in use_resources:
+                if remove:
+                    if r in use_resources:
+                        use_resources.remove(r)
+                elif r not in use_resources:
                     use_resources.append(r)
     if generate and verbose:
         usage(2, "-g and -v don't go together!")
index 248382c8ec2a6c34fd463d1032b460ff95121c7a..89303ba9f8ddbc86f587b062224cd5654a70c5eb 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -823,7 +823,9 @@ New platforms
 Tests
 -----
 
-Yet to be written.
+- The regrtest.py script's -u option now provides a way to say "allow
+  all resources except this one."  For example, to allow everything
+  except bsddb, give the option '-uall,-bsddb'.
 
 Windows
 -------