diff options
author | Steven Knight <knight@baldmt.com> | 2003-05-02 04:09:02 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2003-05-02 04:09:02 (GMT) |
commit | 77568a787451a72ef62198db424ac62bbaf50294 (patch) | |
tree | 1c9a820e32ea1a4eb89d70d9ef895ed6557cb2a4 /etc | |
parent | 8adc0857c2ebd976314a29ca338d6ce82ece251f (diff) | |
download | SCons-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.py | 17 |
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 |