summaryrefslogtreecommitdiffstats
path: root/runtest.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2001-09-10 16:17:42 (GMT)
committerSteven Knight <knight@baldmt.com>2001-09-10 16:17:42 (GMT)
commit9010e91ac2831db0ff7f58d209c8f54a7f807afa (patch)
tree7acaa7c47cf9bc139cd9d43deabec50da48fcb53 /runtest.py
parentc4edab17c52b6c26ade78727890dc9de56675f2f (diff)
downloadSCons-9010e91ac2831db0ff7f58d209c8f54a7f807afa.zip
SCons-9010e91ac2831db0ff7f58d209c8f54a7f807afa.tar.gz
SCons-9010e91ac2831db0ff7f58d209c8f54a7f807afa.tar.bz2
runtest.py follow-on fixes
Diffstat (limited to 'runtest.py')
-rw-r--r--runtest.py50
1 files changed, 45 insertions, 5 deletions
diff --git a/runtest.py b/runtest.py
index 3181757..965e24c 100644
--- a/runtest.py
+++ b/runtest.py
@@ -1,4 +1,38 @@
#!/usr/bin/env python
+#
+# runtests.py - wrapper script for running SCons tests
+#
+# This script mainly exists to set PYTHONPATH to the right list of
+# directories to test the SCons modules.
+#
+# By default, it directly uses the modules in the local tree:
+# ./src/ (source files we ship) and ./etc/ (other modules we don't)
+#
+# When "-b aegis" is specified, it assumes it's in a directory
+# in which an Aegis build (aeb) has been performed, and sets
+# PYTHONPATH so that it *only* references the modules that have
+# unpacked from the built packages, to test whether the packages
+# are good.
+#
+# Options:
+#
+# -a Run all tests; does a virtual 'find' for
+# all SCons tests under the current directory.
+#
+# -b system Assume you're in the specified built system.
+# 'aegis' is the only one currently defined.
+#
+# -d Debug. Runs the script under the Python
+# debugger (pdb.py) so you don't have to
+# muck with PYTHONPATH yourself.
+#
+# -q Quiet. By default, runtest.py prints the
+# command line it will execute before
+# executing it. This suppresses that print.
+#
+# -v Version. Specifies the version number to
+# be used for Aegis interaction.
+#
import getopt
import os
@@ -11,15 +45,21 @@ all = 0
build = None
debug = ''
tests = []
+printcmd = 1
version = None
-opts, tests = getopt.getopt(sys.argv[1:], "ab:dv:",
- ['all','build=','debug','version='])
+opts, tests = getopt.getopt(sys.argv[1:], "ab:dqv:",
+ ['all','build=','debug','quiet','version='])
for o, a in opts:
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 == '-b' or o == '--build': build = a
+ elif o == '-d' or o == '--debug': debug = os.path.join(
+ sys.exec_prefix,
+ "lib",
+ "python" + sys.version[0:3],
+ "pdb.py")
+ elif o == '-q' or o == '--quiet': printcmd = 0
elif o == '-v' or o == '--version': version = a
cwd = os.getcwd()
@@ -85,7 +125,7 @@ for path in tests:
else:
abs = os.path.join(cwd, path)
cmd = string.join(["python", debug, abs], " ")
- if all:
+ if printcmd:
print cmd
if os.system(cmd):
fail.append(path)