summaryrefslogtreecommitdiffstats
path: root/runtest.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2004-04-25 20:00:25 (GMT)
committerSteven Knight <knight@baldmt.com>2004-04-25 20:00:25 (GMT)
commit910350e1e0511a6017b2c4a5c303d03e52b64c0f (patch)
tree87c103547cc2a790e41aaeb4a1b011ecc655eac9 /runtest.py
parentb208faa0ddd78bdc78d1fb4cdc1953b799b193ee (diff)
downloadSCons-910350e1e0511a6017b2c4a5c303d03e52b64c0f.zip
SCons-910350e1e0511a6017b2c4a5c303d03e52b64c0f.tar.gz
SCons-910350e1e0511a6017b2c4a5c303d03e52b64c0f.tar.bz2
Add a -f option to the runtest.py script.
Diffstat (limited to 'runtest.py')
-rw-r--r--runtest.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/runtest.py b/runtest.py
index 9a0cadd..7b08b08 100644
--- a/runtest.py
+++ b/runtest.py
@@ -73,6 +73,7 @@ package = None
scons = None
scons_exec = None
output = None
+testlistfile = None
version = ''
if os.name == 'java':
@@ -94,6 +95,7 @@ Usage: runtest.py [OPTIONS] [TEST ...]
Options:
-a, --all Run all tests.
-d, --debug Run test scripts under the Python debugger.
+ -f FILE, --file FILE Run tests in specified FILE.
-h, --help Print this message and exit.
-o FILE, --output FILE Print test results to FILE (Aegis format).
-P Python Use the specified Python interpreter.
@@ -113,8 +115,8 @@ Options:
-x SCRIPT, --exec SCRIPT Test SCRIPT.
"""
-opts, args = getopt.getopt(sys.argv[1:], "adho:P:p:qv:Xx:",
- ['all', 'debug', 'help', 'output=',
+opts, args = getopt.getopt(sys.argv[1:], "adf:ho:P:p:qv:Xx:",
+ ['all', 'debug', 'file=', 'help', 'output=',
'package=', 'python=', 'quiet',
'version=', 'exec='])
@@ -123,6 +125,10 @@ for o, a in opts:
all = 1
elif o == '-d' or o == '--debug':
debug = os.path.join(lib_dir, "pdb.py")
+ elif o == '-f' or o == '--file':
+ if not os.path.isabs(a):
+ a = os.path.join(cwd, a)
+ testlistfile = a
elif o == '-h' or o == '--help':
print helpstr
sys.exit(0)
@@ -234,6 +240,8 @@ elif all:
keys = tdict.keys()
keys.sort()
tests = map(tdict.get, keys)
+elif testlistfile:
+ tests = map(Test, map(lambda x: x[:-1], open(testlistfile, 'r').readlines()))
else:
sys.stderr.write("""\
runtest.py: No tests were specified on the command line.