summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2002-11-26 21:44:56 (GMT)
committerFred Drake <fdrake@acm.org>2002-11-26 21:44:56 (GMT)
commit4dd0f7ef7a0a7e7abe2043bbf8804fde962a8de3 (patch)
tree147ef379287e09f061a808c2f09c92e091e298ce /Lib/test
parent8c8aa5d666726253b50e460c825ae3935d099c06 (diff)
downloadcpython-4dd0f7ef7a0a7e7abe2043bbf8804fde962a8de3.zip
cpython-4dd0f7ef7a0a7e7abe2043bbf8804fde962a8de3.tar.gz
cpython-4dd0f7ef7a0a7e7abe2043bbf8804fde962a8de3.tar.bz2
Add a way to say "use any resource except A". For example, to run
allow the use of any resource except bsddb, give the option "-uall,-bsddb".
Diffstat (limited to 'Lib/test')
-rwxr-xr-xLib/test/regrtest.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
index f870527..1590ab1 100755
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -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!")