summaryrefslogtreecommitdiffstats
path: root/runtest.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2001-09-06 11:05:58 (GMT)
committerSteven Knight <knight@baldmt.com>2001-09-06 11:05:58 (GMT)
commit0e9a7dc0f7c041917cbbc273daf49ffcd315dfef (patch)
treef786a2afb3615eadf2d14aacc627fc6e42b64922 /runtest.py
parentdbe5a03db469ea8ba63feb94e62edce44d058c00 (diff)
downloadSCons-0e9a7dc0f7c041917cbbc273daf49ffcd315dfef.zip
SCons-0e9a7dc0f7c041917cbbc273daf49ffcd315dfef.tar.gz
SCons-0e9a7dc0f7c041917cbbc273daf49ffcd315dfef.tar.bz2
Add a find-the-tests flag to runtest.py.
Diffstat (limited to 'runtest.py')
-rw-r--r--runtest.py28
1 files changed, 24 insertions, 4 deletions
diff --git a/runtest.py b/runtest.py
index 9e51d76..3181757 100644
--- a/runtest.py
+++ b/runtest.py
@@ -7,21 +7,39 @@ import re
import string
import sys
+all = 0
build = None
debug = ''
+tests = []
version = None
-opts, tests = getopt.getopt(sys.argv[1:], "b:dv:",
- ['build=','debug','version='])
+opts, tests = getopt.getopt(sys.argv[1:], "ab:dv:",
+ ['all','build=','debug','version='])
for o, a in opts:
- if o == '-b' or o == '-build': build = a
+ if o == '-a' or o == '--all': all = 1
+ elif o == '-b' or o == '-build': build = a
elif o == '-d' or o == '--debug': debug = "/usr/lib/python1.5/pdb.py"
elif o == '-v' or o == '--version': version = a
cwd = os.getcwd()
-map(os.path.abspath, tests)
+if tests:
+ map(os.path.abspath, tests)
+elif all:
+ def find_Test_py(arg, dirname, names):
+ global tests
+ n = filter(lambda n: n[-8:] == "Tests.py", names)
+ n = map(lambda x,d=dirname: os.path.join(d, x), n)
+ tests = tests + n
+ os.path.walk('src', find_Test_py, 0)
+
+ def find_py(arg, dirname, names):
+ global tests
+ n = filter(lambda n: n[-3:] == ".py", names)
+ n = map(lambda x,d=dirname: os.path.join(d, x), n)
+ tests = tests + n
+ os.path.walk('test', find_py, 0)
if build == 'aegis':
if not version:
@@ -67,6 +85,8 @@ for path in tests:
else:
abs = os.path.join(cwd, path)
cmd = string.join(["python", debug, abs], " ")
+ if all:
+ print cmd
if os.system(cmd):
fail.append(path)