summaryrefslogtreecommitdiffstats
path: root/runtest.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2002-05-04 08:45:22 (GMT)
committerSteven Knight <knight@baldmt.com>2002-05-04 08:45:22 (GMT)
commite6e85a842cb066639048a6344db51b747eaf4245 (patch)
treed959f8cb0215104cae873ca9a9024b550fc5e05e /runtest.py
parenta79fc1da313aa09ed0007b8c797ab080b038fee8 (diff)
downloadSCons-e6e85a842cb066639048a6344db51b747eaf4245.zip
SCons-e6e85a842cb066639048a6344db51b747eaf4245.tar.gz
SCons-e6e85a842cb066639048a6344db51b747eaf4245.tar.bz2
Fix runtest.py so that it tests the correct SCons even if you have another version of SCons installed. (Anthony Roach)
Diffstat (limited to 'runtest.py')
-rw-r--r--runtest.py21
1 files changed, 14 insertions, 7 deletions
diff --git a/runtest.py b/runtest.py
index b9e52ce..21f5172 100644
--- a/runtest.py
+++ b/runtest.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# runtests.py - wrapper script for running SCons tests
+# runtest.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.
@@ -126,18 +126,25 @@ else:
lib_dir = os.path.join(cwd, 'src', 'engine')
-os.environ['PYTHONPATH'] = lib_dir + \
- os.pathsep + \
- os.path.join(cwd, 'build', 'etc') + \
- os.pathsep + \
- os.path.join(cwd, 'etc')
-
if scons:
+ # Let the version of SCons that the -x option pointed to find
+ # its own modules.
os.environ['SCONS'] = scons
+else:
+ # Because SCons is really aggressive about finding its modules,
+ # it sometimes finds SCons modules elsewhere on the system.
+ # This forces SCons to use the modules that are being tested.
+ os.environ['SCONS_LIB_DIR'] = lib_dir
if scons_exec:
os.environ['SCONS_EXEC'] = '1'
+os.environ['PYTHONPATH'] = lib_dir + \
+ os.pathsep + \
+ os.path.join(cwd, 'build', 'etc') + \
+ os.pathsep + \
+ os.path.join(cwd, 'etc')
+
os.chdir(scons_dir)
fail = []