From: stevenknight Date: Thu, 6 Sep 2001 11:05:58 +0000 (+0000) Subject: Add a find-the-tests flag to runtest.py. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ef809ab2d122a7b89c51567cb3b91c74d03dd09b;p=scons.git Add a find-the-tests flag to runtest.py. git-svn-id: http://scons.tigris.org/svn/scons/trunk@30 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/runtest.py b/runtest.py index 9e51d765..3181757f 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)