summaryrefslogtreecommitdiffstats
path: root/Lib/test/regrtest.py
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2002-04-11 16:39:16 (GMT)
committerFred Drake <fdrake@acm.org>2002-04-11 16:39:16 (GMT)
commit3a15dace3606d6ea9d59486c5d080a1cb4192ff4 (patch)
treed360f8d938088df1bc82e7dd1be36e96e8c1942f /Lib/test/regrtest.py
parent2a519f8fe6ddb59e8c9ae14d3b7adccce22efa6e (diff)
downloadcpython-3a15dace3606d6ea9d59486c5d080a1cb4192ff4.zip
cpython-3a15dace3606d6ea9d59486c5d080a1cb4192ff4.tar.gz
cpython-3a15dace3606d6ea9d59486c5d080a1cb4192ff4.tar.bz2
Added the resource name "all" to enable all of the optional resource uses.
This is nice for use with "make TESTOPTS='-u all' test".
Diffstat (limited to 'Lib/test/regrtest.py')
-rwxr-xr-xLib/test/regrtest.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
index 9e2bc25..826ac60 100755
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -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!")