From: stevenknight Date: Sun, 25 Apr 2004 20:00:25 +0000 (+0000) Subject: Add a -f option to the runtest.py script. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=11e516b40dd83966b160e4c03f690187d75b6009;p=scons.git Add a -f option to the runtest.py script. git-svn-id: http://scons.tigris.org/svn/scons/trunk@960 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/runtest.py b/runtest.py index 9a0cadd4..7b08b084 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.