(1) Allow multiple -u options to extend each other (and the initial
value of use_resources passed into regrtest.main()).
(2) When a test is run stand-alone (not via regrtest.py), needed
resources are always granted.
elif o in ('-l', '--findleaks'):
findleaks = 1
elif o in ('-u', '--use'):
- use_resources = [x.lower() for x in a.split(',')]
- for r in use_resources:
+ u = [x.lower() for x in a.split(',')]
+ for r in u:
if r not in ('largefile', 'network'):
usage(1, 'Invalid -u/--use option: %s' % a)
+ use_resources.extend(u)
if generate and verbose:
usage(2, "-g and -v don't go together!")
"""
verbose = 1 # Flag set to 0 by regrtest.py
-use_resources = [] # Flag set to [] by regrtest.py
+use_resources = None # Flag set to [] by regrtest.py
def unload(name):
try:
pass
def requires(resource, msg=None):
- if resource not in use_resources:
+ if use_resources is not None and resource not in use_resources:
if msg is None:
msg = "Use of the `%s' resource not enabled" % resource
raise TestSkipped(msg)