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)
commita5aa1648378901edeb346289abe1a62e4776e5b1 (patch)
tree87c103547cc2a790e41aaeb4a1b011ecc655eac9 /runtest.py
parentae9f03ddef2d4a346bd49e10e8b033ddbf7b852a (diff)
downloadSCons-a5aa1648378901edeb346289abe1a62e4776e5b1.zip
SCons-a5aa1648378901edeb346289abe1a62e4776e5b1.tar.gz
SCons-a5aa1648378901edeb346289abe1a62e4776e5b1.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.