Anonymous committed 935763c

Add a -f option to the script.

Comments (0)

Files changed (1)

 scons = None
 scons_exec = None
 output = None
+testlistfile = None
 version = ''
 if == 'java':
   -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.
   -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='])
         all = 1
     elif o == '-d' or o == '--debug':
         debug = os.path.join(lib_dir, "")
+    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
     keys = tdict.keys()
     tests = map(tdict.get, keys)
+elif testlistfile:
+    tests = map(Test, map(lambda x: x[:-1], open(testlistfile, 'r').readlines()))
     sys.stderr.write("""\  No tests were specified on the command line.