diff options
author | Steven Knight <knight@baldmt.com> | 2002-10-04 22:04:27 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2002-10-04 22:04:27 (GMT) |
commit | bdf39335f8eff310c749fa5a9d08697aa81a003b (patch) | |
tree | 21343a3f090e72f244b310a2827f87789ffdaab0 /etc/TestSCons.py | |
parent | 313be3374d81ff22c10b8ec09c465cabd835062f (diff) | |
download | SCons-bdf39335f8eff310c749fa5a9d08697aa81a003b.zip SCons-bdf39335f8eff310c749fa5a9d08697aa81a003b.tar.gz SCons-bdf39335f8eff310c749fa5a9d08697aa81a003b.tar.bz2 |
win32 test portability fixes (Anthony Roach)
Diffstat (limited to 'etc/TestSCons.py')
-rw-r--r-- | etc/TestSCons.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/etc/TestSCons.py b/etc/TestSCons.py index 5d4d4a0..997104b 100644 --- a/etc/TestSCons.py +++ b/etc/TestSCons.py @@ -151,6 +151,20 @@ class TestSCons(TestCmd.TestCmd): print self.stderr() raise TestFailed + def detect(self, var, prog): + """ + 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. + """ + + import SCons.Environment + try: + return SCons.Environment.Environment()[var] == prog and self.where_is(prog) + except KeyError: + return None + def wrap_stdout(self, build_str = "", read_str = ""): """Wraps standard output string(s) in the normal "Reading ... done" and "Building ... done" strings |