summaryrefslogtreecommitdiffstats
path: root/test
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 /test
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 'test')
-rw-r--r--test/BuildDir.py12
-rw-r--r--test/F77.py2
-rw-r--r--test/F77FLAGS.py2
-rw-r--r--test/F77PATH.py2
-rw-r--r--test/SHF77.py2
-rw-r--r--test/SHF77FLAGS.py2
-rw-r--r--test/build-errors.py12
7 files changed, 13 insertions, 21 deletions
diff --git a/test/BuildDir.py b/test/BuildDir.py
index 1f04c92..c10ef3e 100644
--- a/test/BuildDir.py
+++ b/test/BuildDir.py
@@ -37,15 +37,7 @@ else:
test = TestSCons.TestSCons()
-test.write('SConstruct', """
-try:
- print Environment()['F77']
-except:
- print 'There is no fortran compiler.'
-""")
-test.run(arguments = ".")
-f77 = test.where_is(test.stdout()[:-1])
-test.unlink('SConstruct')
+f77 = test.detect('F77')
foo11 = test.workpath('test', 'build', 'var1', 'foo1' + _exe)
foo12 = test.workpath('test', 'build', 'var1', 'foo2' + _exe)
@@ -139,7 +131,7 @@ try:
except:
f77 = None
-if f77 and WhereIs(env['F77']):
+if f77 and env.Detect(env['F77']):
env.Command(target='b2.f', source='b2.in', action=buildIt)
env.Copy(LIBS = [r'%s']).Program(target='bar2', source='b2.f')
env.Copy(LIBS = [r'%s']).Program(target='bar1', source='b1.f')
diff --git a/test/F77.py b/test/F77.py
index 0346765..b4ef9bf 100644
--- a/test/F77.py
+++ b/test/F77.py
@@ -144,7 +144,7 @@ test.fail_test(test.read('test6' + _exe) != "This is a .FPP file.\n")
-g77 = test.where_is('g77')
+g77 = test.detect('F77', 'g77')
FTN_LIB = TestSCons.fortran_lib
if g77:
diff --git a/test/F77FLAGS.py b/test/F77FLAGS.py
index b72c618..6b9253b 100644
--- a/test/F77FLAGS.py
+++ b/test/F77FLAGS.py
@@ -147,7 +147,7 @@ test.fail_test(test.read('test6' + _exe) != " -x -c\nThis is a .FPP file.\n")
-g77 = test.where_is('g77')
+g77 = test.detect('F77', 'g77')
FTN_LIB = TestSCons.fortran_lib
if g77:
diff --git a/test/F77PATH.py b/test/F77PATH.py
index f64abb0..f3dd483 100644
--- a/test/F77PATH.py
+++ b/test/F77PATH.py
@@ -43,7 +43,7 @@ args = prog + ' ' + subdir_prog + ' ' + variant_prog
test = TestSCons.TestSCons()
-if not test.where_is('g77'):
+if not test.detect('F77', 'g77'):
test.pass_test()
test.subdir('include', 'subdir', ['subdir', 'include'], 'inc2')
diff --git a/test/SHF77.py b/test/SHF77.py
index d78ef82..24ab0ec 100644
--- a/test/SHF77.py
+++ b/test/SHF77.py
@@ -102,7 +102,7 @@ test.fail_test(test.read('test6' + _obj) != "This is a .FPP file.\n")
-g77 = test.where_is('g77')
+g77 = test.detect('F77', 'g77')
if g77:
diff --git a/test/SHF77FLAGS.py b/test/SHF77FLAGS.py
index 444f106..27c6603 100644
--- a/test/SHF77FLAGS.py
+++ b/test/SHF77FLAGS.py
@@ -113,7 +113,7 @@ test.fail_test(test.read('test6' + _obj) != " -x -c\nThis is a .FPP file.\n")
-g77 = test.where_is('g77')
+g77 = test.detect('F77', 'g77')
FTN_LIB = TestSCons.fortran_lib
if g77:
diff --git a/test/build-errors.py b/test/build-errors.py
index ac6e066..e4e1666 100644
--- a/test/build-errors.py
+++ b/test/build-errors.py
@@ -77,9 +77,9 @@ elif string.find(sys.platform, 'irix') != -1:
scons: *** [f1] Error 127
""" % no_such_file)
else:
- test.fail_test(test.stderr() != """sh: %s: No such file or directory
+ test.fail_test(string.find(test.stderr(), """%s: No such file or directory
scons: *** [f1] Error 127
-""" % no_such_file)
+""" % no_such_file) == -1)
test.write('SConstruct2', r"""
@@ -106,9 +106,9 @@ elif string.find(sys.platform, 'irix') != -1:
scons: *** [f2] Error 126
""" % not_executable)
else:
- test.fail_test(test.stderr() != """sh: %s: Permission denied
+ test.fail_test(string.find(test.stderr(), """%s: Permission denied
scons: *** [f2] Error 126
-""" % not_executable)
+""" % not_executable) == -1)
test.write('SConstruct3', r"""
bld = Builder(action = '%s $SOURCES $TARGET')
@@ -134,8 +134,8 @@ elif string.find(sys.platform, 'irix') != -1:
scons: *** [f3] Error 126
""" % test.workdir)
else:
- test.fail_test(test.stderr() != """sh: %s: is a directory
+ test.fail_test(string.find(test.stderr(), """%s: is a directory
scons: *** [f3] Error 126
-""" % test.workdir)
+""" % test.workdir) == -1)
test.pass_test()