diff options
author | Steven Knight <knight@baldmt.com> | 2002-05-04 08:45:22 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2002-05-04 08:45:22 (GMT) |
commit | e6e85a842cb066639048a6344db51b747eaf4245 (patch) | |
tree | d959f8cb0215104cae873ca9a9024b550fc5e05e /runtest.py | |
parent | a79fc1da313aa09ed0007b8c797ab080b038fee8 (diff) | |
download | SCons-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.py | 21 |
1 files changed, 14 insertions, 7 deletions
@@ -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 = [] |