From: stevenknight Date: Sat, 4 May 2002 08:45:22 +0000 (+0000) Subject: Fix runtest.py so that it tests the correct SCons even if you have another version... X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=99c502c4956217a2dc38adf9d6b635da8ff0bbd8;p=scons.git Fix runtest.py so that it tests the correct SCons even if you have another version of SCons installed. (Anthony Roach) git-svn-id: http://scons.tigris.org/svn/scons/trunk@363 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/runtest.py b/runtest.py index b9e52cee..21f5172d 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 = []