diff options
author | Steven Knight <knight@baldmt.com> | 2002-05-07 21:52:15 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2002-05-07 21:52:15 (GMT) |
commit | e9512cbcf8dc872b474f9e7990b60bb9db1924f3 (patch) | |
tree | 0ba2d9c0f3368e88cd306a6f988657979dd1cccf /test | |
parent | a2ceacbe77db1b308f26454477ae3b1f1139eac8 (diff) | |
download | SCons-e9512cbcf8dc872b474f9e7990b60bb9db1924f3.zip SCons-e9512cbcf8dc872b474f9e7990b60bb9db1924f3.tar.gz SCons-e9512cbcf8dc872b474f9e7990b60bb9db1924f3.tar.bz2 |
Add a better PATH search to the tests.
Diffstat (limited to 'test')
-rw-r--r-- | test/DVIPDF.py | 12 | ||||
-rw-r--r-- | test/DVIPDFFLAGS.py | 12 | ||||
-rw-r--r-- | test/DVIPS.py | 12 | ||||
-rw-r--r-- | test/DVIPSFLAGS.py | 12 | ||||
-rw-r--r-- | test/F77.py | 7 | ||||
-rw-r--r-- | test/F77FLAGS.py | 7 | ||||
-rw-r--r-- | test/LATEX.py | 12 | ||||
-rw-r--r-- | test/LATEXFLAGS.py | 12 | ||||
-rw-r--r-- | test/LEX.py | 7 | ||||
-rw-r--r-- | test/LEXFLAGS.py | 7 | ||||
-rw-r--r-- | test/PDFLATEX.py | 12 | ||||
-rw-r--r-- | test/PDFLATEXFLAGS.py | 12 | ||||
-rw-r--r-- | test/PDFTEX.py | 12 | ||||
-rw-r--r-- | test/PDFTEXFLAGS.py | 12 | ||||
-rw-r--r-- | test/RANLIB.py | 9 | ||||
-rw-r--r-- | test/RANLIBFLAGS.py | 9 | ||||
-rw-r--r-- | test/SHF77.py | 7 | ||||
-rw-r--r-- | test/SHF77FLAGS.py | 7 | ||||
-rw-r--r-- | test/TEX.py | 12 | ||||
-rw-r--r-- | test/TEXFLAGS.py | 12 | ||||
-rw-r--r-- | test/YACC.py | 7 | ||||
-rw-r--r-- | test/YACCFLAGS.py | 7 |
22 files changed, 24 insertions, 194 deletions
diff --git a/test/DVIPDF.py b/test/DVIPDF.py index 69108e1..d22cfd8 100644 --- a/test/DVIPDF.py +++ b/test/DVIPDF.py @@ -32,11 +32,6 @@ import TestSCons python = sys.executable -if sys.platform == 'win32': - _exe = '.exe' -else: - _exe = '' - test = TestSCons.TestSCons() @@ -104,12 +99,7 @@ test.fail_test(test.read('test2.pdf') != "This is a .tex test.\n") -dvipdf = None -for dir in string.split(os.environ['PATH'], os.pathsep): - l = os.path.join(dir, 'dvipdf' + _exe) - if os.path.exists(l): - dvipdf = l - break +dvipdf = test.where_is('dvipdf') if dvipdf: diff --git a/test/DVIPDFFLAGS.py b/test/DVIPDFFLAGS.py index 6d65318..e6f9146 100644 --- a/test/DVIPDFFLAGS.py +++ b/test/DVIPDFFLAGS.py @@ -32,11 +32,6 @@ import TestSCons python = sys.executable -if sys.platform == 'win32': - _exe = '.exe' -else: - _exe = '' - test = TestSCons.TestSCons() @@ -110,12 +105,7 @@ test.fail_test(test.read('test2.pdf') != " -x\nThis is a .tex test.\n") -dvipdf = None -for dir in string.split(os.environ['PATH'], os.pathsep): - l = os.path.join(dir, 'dvipdf' + _exe) - if os.path.exists(l): - dvipdf = l - break +dvipdf = test.where_is('dvipdf') if dvipdf: diff --git a/test/DVIPS.py b/test/DVIPS.py index 91900be..b3bdebc 100644 --- a/test/DVIPS.py +++ b/test/DVIPS.py @@ -32,11 +32,6 @@ import TestSCons python = sys.executable -if sys.platform == 'win32': - _exe = '.exe' -else: - _exe = '' - test = TestSCons.TestSCons() @@ -119,12 +114,7 @@ test.fail_test(test.read('test4.ps') != "This is a .latex test.\n") -dvips = None -for dir in string.split(os.environ['PATH'], os.pathsep): - l = os.path.join(dir, 'dvips' + _exe) - if os.path.exists(l): - dvips = l - break +dvips = test.where_is('dvips') if dvips: diff --git a/test/DVIPSFLAGS.py b/test/DVIPSFLAGS.py index e043e75..664b532 100644 --- a/test/DVIPSFLAGS.py +++ b/test/DVIPSFLAGS.py @@ -32,11 +32,6 @@ import TestSCons python = sys.executable -if sys.platform == 'win32': - _exe = '.exe' -else: - _exe = '' - test = TestSCons.TestSCons() @@ -126,12 +121,7 @@ test.fail_test(test.read('test4.ps') != " -x\nThis is a .latex test.\n") -dvips = None -for dir in string.split(os.environ['PATH'], os.pathsep): - l = os.path.join(dir, 'dvips' + _exe) - if os.path.exists(l): - dvips = l - break +dvips = test.where_is('dvips') if dvips: diff --git a/test/F77.py b/test/F77.py index 964682d..6548498 100644 --- a/test/F77.py +++ b/test/F77.py @@ -167,12 +167,7 @@ test.fail_test(test.read('test6' + _exe) != "This is a .FPP file.\n") -g77 = None -for dir in string.split(os.environ['PATH'], os.pathsep): - g = os.path.join(dir, 'g77' + _exe) - if os.path.exists(g): - g77 = g - break +g77 = test.where_is('g77') if g77: diff --git a/test/F77FLAGS.py b/test/F77FLAGS.py index 5241e7b..e4d1f8c 100644 --- a/test/F77FLAGS.py +++ b/test/F77FLAGS.py @@ -179,12 +179,7 @@ test.fail_test(test.read('test6' + _exe) != "%s\nThis is a .FPP file.\n" % o) -g77 = None -for dir in string.split(os.environ['PATH'], os.pathsep): - g = os.path.join(dir, 'g77' + _exe) - if os.path.exists(g): - g77 = g - break +g77 = test.where_is('g77') if g77: diff --git a/test/LATEX.py b/test/LATEX.py index 9ac74f5..440054d 100644 --- a/test/LATEX.py +++ b/test/LATEX.py @@ -32,11 +32,6 @@ import TestSCons python = sys.executable -if sys.platform == 'win32': - _exe = '.exe' -else: - _exe = '' - test = TestSCons.TestSCons() @@ -75,12 +70,7 @@ test.fail_test(test.read('test2.dvi') != "This is a .latex test.\n") -latex = None -for dir in string.split(os.environ['PATH'], os.pathsep): - l = os.path.join(dir, 'latex' + _exe) - if os.path.exists(l): - latex = l - break +latex = test.where_is('latex') if latex: diff --git a/test/LATEXFLAGS.py b/test/LATEXFLAGS.py index c366c8a..5ad4d95 100644 --- a/test/LATEXFLAGS.py +++ b/test/LATEXFLAGS.py @@ -32,11 +32,6 @@ import TestSCons python = sys.executable -if sys.platform == 'win32': - _exe = '.exe' -else: - _exe = '' - test = TestSCons.TestSCons() @@ -81,12 +76,7 @@ test.fail_test(test.read('test2.dvi') != " -t\nThis is a .latex test.\n") -latex = None -for dir in string.split(os.environ['PATH'], os.pathsep): - l = os.path.join(dir, 'latex' + _exe) - if os.path.exists(l): - latex = l - break +latex = test.where_is('latex') if latex: diff --git a/test/LEX.py b/test/LEX.py index 59a887d..88c0a2d 100644 --- a/test/LEX.py +++ b/test/LEX.py @@ -74,12 +74,7 @@ test.run(program = test.workpath('aaa' + _exe), stdout = "mylex.py\naaa.l\n") -lex = None -for dir in string.split(os.environ['PATH'], os.pathsep): - l = os.path.join(dir, 'lex' + _exe) - if os.path.exists(l): - lex = l - break +lex = test.where_is('lex') if lex: diff --git a/test/LEXFLAGS.py b/test/LEXFLAGS.py index b415495..e807774 100644 --- a/test/LEXFLAGS.py +++ b/test/LEXFLAGS.py @@ -77,12 +77,7 @@ test.run(program = test.workpath('aaa' + _exe), stdout = " -x -t\naaa.l\n") -lex = None -for dir in string.split(os.environ['PATH'], os.pathsep): - l = os.path.join(dir, 'lex' + _exe) - if os.path.exists(l): - lex = l - break +lex = test.where_is('lex') if lex: diff --git a/test/PDFLATEX.py b/test/PDFLATEX.py index a64f158..f665d0f 100644 --- a/test/PDFLATEX.py +++ b/test/PDFLATEX.py @@ -32,11 +32,6 @@ import TestSCons python = sys.executable -if sys.platform == 'win32': - _exe = '.exe' -else: - _exe = '' - test = TestSCons.TestSCons() @@ -75,12 +70,7 @@ test.fail_test(not os.path.exists(test.workpath('test2.pdf'))) -pdflatex = None -for dir in string.split(os.environ['PATH'], os.pathsep): - l = os.path.join(dir, 'pdflatex' + _exe) - if os.path.exists(l): - pdflatex = l - break +pdflatex = test.where_is('pdflatex') if pdflatex: diff --git a/test/PDFLATEXFLAGS.py b/test/PDFLATEXFLAGS.py index 1693b56..6ddd41a 100644 --- a/test/PDFLATEXFLAGS.py +++ b/test/PDFLATEXFLAGS.py @@ -32,11 +32,6 @@ import TestSCons python = sys.executable -if sys.platform == 'win32': - _exe = '.exe' -else: - _exe = '' - test = TestSCons.TestSCons() @@ -81,12 +76,7 @@ test.fail_test(not os.path.exists(test.workpath('test2.pdf'))) -pdflatex = None -for dir in string.split(os.environ['PATH'], os.pathsep): - l = os.path.join(dir, 'pdflatex' + _exe) - if os.path.exists(l): - pdflatex = l - break +pdflatex = test.where_is('pdflatex') if pdflatex: diff --git a/test/PDFTEX.py b/test/PDFTEX.py index 41024c4..4fe5341 100644 --- a/test/PDFTEX.py +++ b/test/PDFTEX.py @@ -32,11 +32,6 @@ import TestSCons python = sys.executable -if sys.platform == 'win32': - _exe = '.exe' -else: - _exe = '' - test = TestSCons.TestSCons() @@ -68,12 +63,7 @@ test.fail_test(not os.path.exists(test.workpath('test.pdf'))) -pdftex = None -for dir in string.split(os.environ['PATH'], os.pathsep): - t = os.path.join(dir, 'pdftex' + _exe) - if os.path.exists(t): - pdftex = t - break +pdftex = test.where_is('pdftex') if pdftex: diff --git a/test/PDFTEXFLAGS.py b/test/PDFTEXFLAGS.py index 59d67be..aa5cc9f 100644 --- a/test/PDFTEXFLAGS.py +++ b/test/PDFTEXFLAGS.py @@ -32,11 +32,6 @@ import TestSCons python = sys.executable -if sys.platform == 'win32': - _exe = '.exe' -else: - _exe = '' - test = TestSCons.TestSCons() @@ -74,12 +69,7 @@ test.fail_test(not os.path.exists(test.workpath('test.pdf'))) -pdftex = None -for dir in string.split(os.environ['PATH'], os.pathsep): - t = os.path.join(dir, 'pdftex' + _exe) - if os.path.exists(t): - pdftex = t - break +pdftex = test.where_is('pdftex') if pdftex: diff --git a/test/RANLIB.py b/test/RANLIB.py index 12ae212..14708e0 100644 --- a/test/RANLIB.py +++ b/test/RANLIB.py @@ -37,15 +37,10 @@ if sys.platform == 'win32': else: _exe = '' -ranlib = None -for dir in string.split(os.environ['PATH'], os.pathsep): - r = os.path.join(dir, 'ranlib' + _exe) - if os.path.exists(r): - ranlib = r - break - test = TestSCons.TestSCons() +ranlib = test.where_is('ranlib') + test.no_result(not ranlib) test.write("wrapper.py", diff --git a/test/RANLIBFLAGS.py b/test/RANLIBFLAGS.py index 752f685..b3e9451 100644 --- a/test/RANLIBFLAGS.py +++ b/test/RANLIBFLAGS.py @@ -36,15 +36,10 @@ if sys.platform == 'win32': else: _exe = '' -ranlib = None -for dir in string.split(os.environ['PATH'], os.pathsep): - r = os.path.join(dir, 'ranlib' + _exe) - if os.path.exists(r): - ranlib = r - break - test = TestSCons.TestSCons() +ranlib = test.where_is('ranlib') + test.no_result(not ranlib) test.write("wrapper.py", diff --git a/test/SHF77.py b/test/SHF77.py index 43c6485..cffd94d 100644 --- a/test/SHF77.py +++ b/test/SHF77.py @@ -169,12 +169,7 @@ test.fail_test(test.read('test6' + _exe) != "This is a .FPP file.\n") -g77 = None -for dir in string.split(os.environ['PATH'], os.pathsep): - g = os.path.join(dir, 'g77' + _exe) - if os.path.exists(g): - g77 = g - break +g77 = test.where_is('g77') if g77: diff --git a/test/SHF77FLAGS.py b/test/SHF77FLAGS.py index cb1e6f6..231fea2 100644 --- a/test/SHF77FLAGS.py +++ b/test/SHF77FLAGS.py @@ -185,12 +185,7 @@ test.fail_test(test.read('test6' + _exe) != "%s\nThis is a .FPP file.\n" % o) -g77 = None -for dir in string.split(os.environ['PATH'], os.pathsep): - g = os.path.join(dir, 'g77' + _exe) - if os.path.exists(g): - g77 = g - break +g77 = test.where_is('g77') if g77: diff --git a/test/TEX.py b/test/TEX.py index 9b442c9..bcdd62e 100644 --- a/test/TEX.py +++ b/test/TEX.py @@ -32,11 +32,6 @@ import TestSCons python = sys.executable -if sys.platform == 'win32': - _exe = '.exe' -else: - _exe = '' - test = TestSCons.TestSCons() @@ -68,12 +63,7 @@ test.fail_test(test.read('test.dvi') != "This is a test.\n") -tex = None -for dir in string.split(os.environ['PATH'], os.pathsep): - t = os.path.join(dir, 'tex' + _exe) - if os.path.exists(t): - tex = t - break +tex = test.where_is('tex') if tex: diff --git a/test/TEXFLAGS.py b/test/TEXFLAGS.py index 4cc08d3..1f7121f 100644 --- a/test/TEXFLAGS.py +++ b/test/TEXFLAGS.py @@ -32,11 +32,6 @@ import TestSCons python = sys.executable -if sys.platform == 'win32': - _exe = '.exe' -else: - _exe = '' - test = TestSCons.TestSCons() @@ -74,12 +69,7 @@ test.fail_test(test.read('test.dvi') != " -x\nThis is a test.\n") -tex = None -for dir in string.split(os.environ['PATH'], os.pathsep): - t = os.path.join(dir, 'tex' + _exe) - if os.path.exists(t): - tex = t - break +tex = test.where_is('tex') if tex: diff --git a/test/YACC.py b/test/YACC.py index 8fea904..2868085 100644 --- a/test/YACC.py +++ b/test/YACC.py @@ -80,12 +80,7 @@ test.run(program = test.workpath('aaa' + _exe), stdout = "myyacc.py\naaa.y\n") -yacc = None -for dir in string.split(os.environ['PATH'], os.pathsep): - y = os.path.join(dir, 'yacc' + _exe) - if os.path.exists(y): - yacc = y - break +yacc = test.where_is('yacc') if yacc: diff --git a/test/YACCFLAGS.py b/test/YACCFLAGS.py index 10c29ca..288696b 100644 --- a/test/YACCFLAGS.py +++ b/test/YACCFLAGS.py @@ -80,12 +80,7 @@ test.run(program = test.workpath('aaa' + _exe), stdout = " -x\naaa.y\n") -yacc = None -for dir in string.split(os.environ['PATH'], os.pathsep): - y = os.path.join(dir, 'yacc' + _exe) - if os.path.exists(y): - yacc = y - break +yacc = test.where_is('yacc') if yacc: |