From c85d1746a1c3af99574582e175d3afe5f8b1603f Mon Sep 17 00:00:00 2001 From: stevenknight Date: Mon, 10 Sep 2001 16:17:42 +0000 Subject: [PATCH] runtest.py follow-on fixes git-svn-id: http://scons.tigris.org/svn/scons/trunk@35 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- README | 12 +++++------- config | 2 +- runtest.py | 50 +++++++++++++++++++++++++++++++++++++++++++++----- 3 files changed, 51 insertions(+), 13 deletions(-) diff --git a/README b/README index 132abcdc..0ce7716b 100644 --- a/README +++ b/README @@ -27,13 +27,11 @@ etc/ their own just to help out with SCons development. runtest.py -runtest.sh - Scripts for running our tests. The Python version is used - by Aegis for running tests against a copy of the source as - extracted from an archive. The shell version runs tests against - the local src/ tree, so you don't have to do a build before - testing your changes. (Hmm, that should probably just be an - option to runtest.py...) + Script for running our tests. By default, this will run a + test against the code in the local src/ tree, so you don't + have to do a build before testing your changes. Aegis uses + it with an option that requires that you've done a build + (aeb) before running tests. src/ Where the actual source code is kept, of course. diff --git a/config b/config index d653bb2d..9618a967 100644 --- a/config +++ b/config @@ -242,7 +242,7 @@ diff_command = * written to conform to Perl conventions) and Aegis' expectations. * See the comments in the test.pl script itself for details. */ -test_command = "python runtest.py -b aegis -v ${VERsion} ${File_Name}"; +test_command = "python runtest.py -b aegis -q -v ${VERsion} ${File_Name}"; new_test_filename = "test/CHANGETHIS.py"; diff --git a/runtest.py b/runtest.py index 3181757f..965e24c9 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) -- 2.26.2