summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2003-05-02 04:09:02 (GMT)
committerSteven Knight <knight@baldmt.com>2003-05-02 04:09:02 (GMT)
commit77568a787451a72ef62198db424ac62bbaf50294 (patch)
tree1c9a820e32ea1a4eb89d70d9ef895ed6557cb2a4 /etc
parent8adc0857c2ebd976314a29ca338d6ce82ece251f (diff)
downloadSCons-77568a787451a72ef62198db424ac62bbaf50294.zip
SCons-77568a787451a72ef62198db424ac62bbaf50294.tar.gz
SCons-77568a787451a72ef62198db424ac62bbaf50294.tar.bz2
Fix regression tests that use test.whereis(). (Anthony Roach)
Diffstat (limited to 'etc')
-rw-r--r--etc/TestSCons.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/etc/TestSCons.py b/etc/TestSCons.py
index 4fe8b5b..a87b55a 100644
--- a/etc/TestSCons.py
+++ b/etc/TestSCons.py
@@ -182,17 +182,22 @@ class TestSCons(TestCmd.TestCmd):
print self.stderr()
raise TestFailed
- def detect(self, var, prog):
+ def detect(self, var, prog=None):
"""
- Detect a program named 'prog' by first checking the construction
- variable named 'var' and finally searching the path. If either method
- fails to detect the program, then false is returned, otherwise
- the programs full path is returned.
+ Detect a program named 'prog' by first checking the construction
+ variable named 'var' and finally searching the path used by
+ SCons. If either method fails to detect the program, then false
+ is returned, otherwise the full path to prog is returned. If
+ prog is None, then the value of the environment variable will be
+ used as prog.
"""
import SCons.Environment
+ env = SCons.Environment.Environment()
try:
- return SCons.Environment.Environment()[var] == prog and self.where_is(prog)
+ if prog is None:
+ prog = env[var]
+ return env[var] == prog and env.WhereIs(prog)
except KeyError:
return None