From a925fbfbbecd978b6275ba0592e3bd21b0bd7781 Mon Sep 17 00:00:00 2001 From: Steven Knight Date: Sat, 26 Apr 2003 13:02:02 +0000 Subject: Portability fixes for test. (Chad Austin) --- etc/TestSCons.py | 5 +++++ src/CHANGES.txt | 2 ++ test/BuildDir.py | 3 +++ test/CPPFLAGS.py | 5 ++++- test/DVIPDFFLAGS.py | 6 ++++-- test/DVIPS.py | 6 ++++-- test/DVIPSFLAGS.py | 6 ++++-- test/F77.py | 6 ++++-- test/F77FLAGS.py | 6 ++++-- test/F77PATH.py | 22 +++++++++++++--------- test/GSFLAGS.py | 4 +++- test/LATEX.py | 6 ++++-- test/LATEXFLAGS.py | 6 ++++-- test/LIBPATH.py | 7 ++++++- test/LIBS.py | 12 +++++++----- test/Library.py | 1 + test/PDFLATEX.py | 6 ++++-- test/PDFLATEXFLAGS.py | 6 ++++-- test/PDFTEX.py | 6 ++++-- test/PDFTEXFLAGS.py | 6 ++++-- test/RCS.py | 9 +++++++-- test/SHCCFLAGS.py | 7 +++++-- test/SHCXXFLAGS.py | 3 +++ test/SHF77.py | 5 ++++- test/SHF77FLAGS.py | 10 +++++++--- test/SharedLibrary.py | 4 +++- test/TAR.py | 4 +++- test/TEX.py | 6 ++++-- test/TEXFLAGS.py | 6 ++++-- test/ZIP.py | 4 +++- test/redirection.py | 10 ++++++---- test/subdir.py | 6 ++++-- 32 files changed, 141 insertions(+), 60 deletions(-) diff --git a/etc/TestSCons.py b/etc/TestSCons.py index e8bac90..f9c4edf 100644 --- a/etc/TestSCons.py +++ b/etc/TestSCons.py @@ -24,6 +24,11 @@ import TestCmd python = TestCmd.python_executable +if string.find(sys.platform, 'irix') != -1: + fortran_lib = 'ftn' +else: + fortran_lib = 'g2c' + class TestFailed(Exception): def __init__(self, args=None): self.args = args diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 0e22ea7..b77f6a1 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -26,6 +26,8 @@ RELEASE 0.14 - XXX - Using MSVC long command-line linking when running Cygwin. + - Portability fixes for a lot of tests. + From Allen Bierbaum: - Pass an Environment to the Options validator method, and diff --git a/test/BuildDir.py b/test/BuildDir.py index f0e889a..1f04c92 100644 --- a/test/BuildDir.py +++ b/test/BuildDir.py @@ -102,6 +102,9 @@ SConscript('../build/var6/SConscript', "env") if string.find(sys.platform, 'irix') != -1: fortran_runtime = 'ftn' + + # f77 does NOT work on cruncher + test.no_result() else: fortran_runtime = 'g2c' diff --git a/test/CPPFLAGS.py b/test/CPPFLAGS.py index 352ed7d..d8587c6 100644 --- a/test/CPPFLAGS.py +++ b/test/CPPFLAGS.py @@ -38,7 +38,10 @@ if sys.platform == 'win32': else: _exe = '' _obj = '.o' - _shobj = '.os' + if string.find(sys.platform, 'irix') > -1: + _shobj = '.o' + else: + _shobj = '.os' test = TestSCons.TestSCons() diff --git a/test/DVIPDFFLAGS.py b/test/DVIPDFFLAGS.py index 7890be1..e9bd8ba 100644 --- a/test/DVIPDFFLAGS.py +++ b/test/DVIPDFFLAGS.py @@ -120,9 +120,11 @@ os.system(cmd) """ % string.replace(test.workpath('wrapper.out'), '\\', '\\\\')) test.write('SConstruct', """ -foo = Environment(DVIPDFFLAGS = '-N') +import os +ENV = {'PATH' : os.environ['PATH']} +foo = Environment(DVIPDFFLAGS = '-N', ENV = ENV) dvipdf = foo.Dictionary('DVIPDF') -bar = Environment(DVIPDF = r'%s wrapper.py ' + dvipdf) +bar = Environment(DVIPDF = r'%s wrapper.py ' + dvipdf, ENV = ENV) foo.PDF(target = 'foo.pdf', source = foo.DVI(target = 'foo.dvi', source = 'foo.tex')) bar.PDF(target = 'bar.pdf', diff --git a/test/DVIPS.py b/test/DVIPS.py index aa5750e..2ae856a 100644 --- a/test/DVIPS.py +++ b/test/DVIPS.py @@ -128,9 +128,11 @@ os.system(cmd) """ % string.replace(test.workpath('wrapper.out'), '\\', '\\\\')) test.write('SConstruct', """ -foo = Environment() +import os +ENV = { 'PATH' : os.environ['PATH'] } +foo = Environment(ENV = ENV) dvips = foo.Dictionary('DVIPS') -bar = Environment(DVIPS = r'%s wrapper.py ' + dvips) +bar = Environment(ENV = ENV, DVIPS = r'%s wrapper.py ' + dvips) foo.PostScript(target = 'foo.ps', source = 'foo.tex') bar.PostScript(target = 'bar1', source = 'bar1.tex') bar.PostScript(target = 'bar2', source = 'bar2.ltx') diff --git a/test/DVIPSFLAGS.py b/test/DVIPSFLAGS.py index 49ccd02..82e57c5 100644 --- a/test/DVIPSFLAGS.py +++ b/test/DVIPSFLAGS.py @@ -135,9 +135,11 @@ os.system(cmd) """ % string.replace(test.workpath('wrapper.out'), '\\', '\\\\')) test.write('SConstruct', """ -foo = Environment(DVIPSFLAGS = '-N') +import os +ENV = {'PATH' : os.environ['PATH']} +foo = Environment(ENV = ENV, DVIPSFLAGS = '-N') dvips = foo.Dictionary('DVIPS') -bar = Environment(DVIPS = r'%s wrapper.py ' + dvips) +bar = Environment(ENV = ENV,DVIPS = r'%s wrapper.py ' + dvips) foo.PostScript(target = 'foo.ps', source = 'foo.tex') bar.PostScript(target = 'bar1', source = 'bar1.tex') bar.PostScript(target = 'bar2', source = 'bar2.ltx') diff --git a/test/F77.py b/test/F77.py index bf799c0..f95dee9 100644 --- a/test/F77.py +++ b/test/F77.py @@ -92,6 +92,7 @@ sys.exit(0) test.write('SConstruct', """ env = Environment(LINK = r'%s mylink.py', + LINKFLAGS = [], F77 = r'%s myg77.py') env.Program(target = 'test1', source = 'test1.f') env.Program(target = 'test2', source = 'test2.for') @@ -148,6 +149,7 @@ test.fail_test(test.read('test6' + _exe) != "This is a .FPP file.\n") g77 = test.where_is('g77') +FTN_LIB = TestSCons.fortran_lib if g77: @@ -160,12 +162,12 @@ os.system(string.join(sys.argv[1:], " ")) """ % string.replace(test.workpath('wrapper.out'), '\\', '\\\\')) test.write('SConstruct', """ -foo = Environment(LIBS = 'g2c') +foo = Environment(LIBS = r'%s') f77 = foo.Dictionary('F77') bar = foo.Copy(F77 = r'%s wrapper.py ' + f77) foo.Program(target = 'foo', source = 'foo.f') bar.Program(target = 'bar', source = 'bar.f') -""" % python) +""" % (FTN_LIB, python)) test.write('foo.f', r""" PROGRAM FOO diff --git a/test/F77FLAGS.py b/test/F77FLAGS.py index 256ab7e..b914701 100644 --- a/test/F77FLAGS.py +++ b/test/F77FLAGS.py @@ -95,6 +95,7 @@ sys.exit(0) test.write('SConstruct', """ env = Environment(LINK = r'%s mylink.py', + LINKFLAGS = [], F77 = r'%s myg77.py', F77FLAGS = '-x') env.Program(target = 'test1', source = 'test1.f') env.Program(target = 'test2', source = 'test2.for') @@ -151,6 +152,7 @@ test.fail_test(test.read('test6' + _exe) != " -x -c\nThis is a .FPP file.\n") g77 = test.where_is('g77') +FTN_LIB = TestSCons.fortran_lib if g77: @@ -163,12 +165,12 @@ os.system(string.join(sys.argv[1:], " ")) """ % string.replace(test.workpath('wrapper.out'), '\\', '\\\\')) test.write('SConstruct', """ -foo = Environment(LIBS = 'g2c') +foo = Environment(LIBS = r'%s') f77 = foo.Dictionary('F77') bar = foo.Copy(F77 = r'%s wrapper.py ' + f77, F77FLAGS = '-Ix') foo.Program(target = 'foo', source = 'foo.f') bar.Program(target = 'bar', source = 'bar.f') -""" % python) +""" % (FTN_LIB, python)) test.write('foo.f', r""" PROGRAM FOO diff --git a/test/F77PATH.py b/test/F77PATH.py index 2e99b90..f64abb0 100644 --- a/test/F77PATH.py +++ b/test/F77PATH.py @@ -33,6 +33,8 @@ if sys.platform == 'win32': else: _exe = '' +FTN_LIB = TestSCons.fortran_lib + prog = 'prog' + _exe subdir_prog = os.path.join('subdir', 'prog' + _exe) variant_prog = os.path.join('variant', 'prog' + _exe) @@ -47,16 +49,16 @@ if not test.where_is('g77'): test.subdir('include', 'subdir', ['subdir', 'include'], 'inc2') test.write('SConstruct', """ -env = Environment(F77PATH = ['$FOO'], LIBS = 'g2c', FOO='include') +env = Environment(F77PATH = ['$FOO'], LIBS = r'%s', FOO='include') obj = env.Object(target='foobar/prog', source='subdir/prog.f') env.Program(target='prog', source=obj) SConscript('subdir/SConscript', "env") BuildDir('variant', 'subdir', 0) include = Dir('include') -env = Environment(F77PATH=[include], LIBS = 'g2c') +env = Environment(F77PATH=[include], LIBS = r'%s') SConscript('variant/SConscript', "env") -""") +""" % (FTN_LIB, FTN_LIB)) test.write(['subdir', 'SConscript'], """ @@ -159,16 +161,16 @@ test.up_to_date(arguments = args) # Change F77PATH and make sure we don't rebuild because of it. test.write('SConstruct', """ -env = Environment(F77PATH = Split('inc2 include'), LIBS = 'g2c') +env = Environment(F77PATH = Split('inc2 include'), LIBS = r'%s') obj = env.Object(target='foobar/prog', source='subdir/prog.f') env.Program(target='prog', source=obj) SConscript('subdir/SConscript', "env") BuildDir('variant', 'subdir', 0) include = Dir('include') -env = Environment(F77PATH=['inc2', include], LIBS = 'g2c') +env = Environment(F77PATH=['inc2', include], LIBS = r'%s') SConscript('variant/SConscript', "env") -""") +""" % (FTN_LIB, FTN_LIB)) test.up_to_date(arguments = args) @@ -194,9 +196,11 @@ test.up_to_date(arguments = args) # Check that a null-string F77PATH doesn't blow up. test.write('SConstruct', """ -env = Environment(F77PATH = '', LIBS = 'g2c') -env.Library('foo', source = '') -""") +env = Environment(F77PATH = '', LIBS = r'%s') +env.Library('foo', source = 'empty.f') +""" % FTN_LIB) + +test.write('empty.f', '') test.run(arguments = '.') diff --git a/test/GSFLAGS.py b/test/GSFLAGS.py index 2ea02a9..114d5c9 100644 --- a/test/GSFLAGS.py +++ b/test/GSFLAGS.py @@ -92,7 +92,9 @@ os.system(cmd) """ % string.replace(test.workpath('wrapper.out'), '\\', '\\\\')) test.write('SConstruct', """\ -foo = Environment() +import os +ENV = { 'PATH' : os.environ['PATH'] } +foo = Environment(ENV = ENV) foo.Append(GSFLAGS = ' -q') foo.PDF(target = 'foo.pdf', source = 'foo.ps') """) diff --git a/test/LATEX.py b/test/LATEX.py index 6636a9a..4ed080f 100644 --- a/test/LATEX.py +++ b/test/LATEX.py @@ -82,9 +82,11 @@ os.system(string.join(sys.argv[1:], " ")) """ % string.replace(test.workpath('wrapper.out'), '\\', '\\\\')) test.write('SConstruct', """ -foo = Environment() +import os +ENV = { 'PATH' : os.environ['PATH'] } +foo = Environment(ENV = ENV) latex = foo.Dictionary('LATEX') -bar = Environment(LATEX = r'%s wrapper.py ' + latex) +bar = Environment(ENV = ENV, LATEX = r'%s wrapper.py ' + latex) foo.DVI(target = 'foo.dvi', source = 'foo.ltx') bar.DVI(target = 'bar', source = 'bar.latex') """ % python) diff --git a/test/LATEXFLAGS.py b/test/LATEXFLAGS.py index 1bae970..badf85e 100644 --- a/test/LATEXFLAGS.py +++ b/test/LATEXFLAGS.py @@ -88,9 +88,11 @@ os.system(string.join(sys.argv[1:], " ")) """ % string.replace(test.workpath('wrapper.out'), '\\', '\\\\')) test.write('SConstruct', """ -foo = Environment(LATEXFLAGS = '--output-comment Commentary') +import os +ENV = { 'PATH' : os.environ['PATH'] } +foo = Environment(ENV = ENV, LATEXFLAGS = '--output-comment Commentary') latex = foo.Dictionary('LATEX') -bar = Environment(LATEX = r'%s wrapper.py ' + latex) +bar = Environment(ENV = ENV, LATEX = r'%s wrapper.py ' + latex) foo.DVI(target = 'foo.dvi', source = 'foo.ltx') bar.DVI(target = 'bar', source = 'bar.latex') """ % python) diff --git a/test/LIBPATH.py b/test/LIBPATH.py index c886627..2730be3 100644 --- a/test/LIBPATH.py +++ b/test/LIBPATH.py @@ -75,6 +75,7 @@ int test() { f1(); + return 0; } """) @@ -148,10 +149,14 @@ test.run(program = prog1, test.up_to_date(arguments = '.') +# We need at least one file for some implementations of the Library +# builder, notably the SGI one. +test.write('empty.c', '') + # Check that a null-string LIBPATH doesn't blow up. test.write('SConstruct', """ env = Environment(LIBPATH = '') -env.Library('foo', source = '') +env.Library('foo', source = 'empty.c') """) test.run(arguments = '.') diff --git a/test/LIBS.py b/test/LIBS.py index ac5676c..7a99f68 100644 --- a/test/LIBS.py +++ b/test/LIBS.py @@ -120,7 +120,11 @@ SConscript('sub1/SConscript', 'env') SConscript('sub2/SConscript', 'env') """) -test.run(arguments = '.') +test.run(arguments = '.', stderr=None) + +# on IRIX, ld32 prints out a warning saying that libbaz.a isn't used +sw = 'ld32: WARNING 84 : ./libbaz.a is not used for resolving any symbol.' +test.fail_test(not test.stderr() in ['', sw]) test.run(program=foo_exe, stdout='sub1/bar.c\nsub1/baz.c\n') @@ -145,11 +149,9 @@ void baz() } """) -test.run(arguments = '.') +test.run(arguments = '.', stderr=None) +test.fail_test(not test.stderr() in ['', sw]) test.run(program=foo_exe, stdout='sub1/bar.c\nsub1/baz.c 2\n') test.pass_test() - - - diff --git a/test/Library.py b/test/Library.py index 1a71586..980e7c5 100644 --- a/test/Library.py +++ b/test/Library.py @@ -86,6 +86,7 @@ f3b(void) """) test.write('f3c.c', r""" +void f3c(void) { printf("f3c.c\n"); diff --git a/test/PDFLATEX.py b/test/PDFLATEX.py index 8dc5238..4c6f84d 100644 --- a/test/PDFLATEX.py +++ b/test/PDFLATEX.py @@ -82,9 +82,11 @@ os.system(string.join(sys.argv[1:], " ")) """ % string.replace(test.workpath('wrapper.out'), '\\', '\\\\')) test.write('SConstruct', """ -foo = Environment() +import os +ENV = { 'PATH' : os.environ['PATH'] } +foo = Environment(ENV = ENV) pdflatex = foo.Dictionary('PDFLATEX') -bar = Environment(PDFLATEX = r'%s wrapper.py ' + pdflatex) +bar = Environment(ENV = ENV, PDFLATEX = r'%s wrapper.py ' + pdflatex) foo.PDF(target = 'foo.pdf', source = 'foo.ltx') bar.PDF(target = 'bar', source = 'bar.latex') """ % python) diff --git a/test/PDFLATEXFLAGS.py b/test/PDFLATEXFLAGS.py index ba07b7f..880d6d0 100644 --- a/test/PDFLATEXFLAGS.py +++ b/test/PDFLATEXFLAGS.py @@ -88,9 +88,11 @@ os.system(string.join(sys.argv[1:], " ")) """ % string.replace(test.workpath('wrapper.out'), '\\', '\\\\')) test.write('SConstruct', """ -foo = Environment(PDFLATEXFLAGS = '--output-comment Commentary') +import os +ENV = { 'PATH' : os.environ['PATH'] } +foo = Environment(ENV = ENV, PDFLATEXFLAGS = '--output-comment Commentary') pdflatex = foo.Dictionary('PDFLATEX') -bar = Environment(PDFLATEX = r'%s wrapper.py ' + pdflatex) +bar = Environment(ENV = ENV, PDFLATEX = r'%s wrapper.py ' + pdflatex) foo.PDF(target = 'foo.pdf', source = 'foo.ltx') bar.PDF(target = 'bar', source = 'bar.latex') """ % python) diff --git a/test/PDFTEX.py b/test/PDFTEX.py index e21c8c6..2015c33 100644 --- a/test/PDFTEX.py +++ b/test/PDFTEX.py @@ -75,9 +75,11 @@ os.system(string.join(sys.argv[1:], " ")) """ % string.replace(test.workpath('wrapper.out'), '\\', '\\\\')) test.write('SConstruct', """ -foo = Environment() +import os +ENV = { 'PATH' : os.environ['PATH'] } +foo = Environment(ENV = ENV) pdftex = foo.Dictionary('PDFTEX') -bar = Environment(PDFTEX = r'%s wrapper.py ' + pdftex) +bar = Environment(ENV = ENV, PDFTEX = r'%s wrapper.py ' + pdftex) foo.PDF(target = 'foo.pdf', source = 'foo.tex') bar.PDF(target = 'bar', source = 'bar.tex') """ % python) diff --git a/test/PDFTEXFLAGS.py b/test/PDFTEXFLAGS.py index fe1f5fc..fb1fbf0 100644 --- a/test/PDFTEXFLAGS.py +++ b/test/PDFTEXFLAGS.py @@ -81,9 +81,11 @@ os.system(string.join(sys.argv[1:], " ")) """ % string.replace(test.workpath('wrapper.out'), '\\', '\\\\')) test.write('SConstruct', """ -foo = Environment(PDFTEXFLAGS = '--output-comment Commentary') +import os +ENV = { 'PATH' : os.environ['PATH'] } +foo = Environment(ENV = ENV, PDFTEXFLAGS = '--output-comment Commentary') pdftex = foo.Dictionary('PDFTEX') -bar = Environment(PDFTEX = r'%s wrapper.py ' + pdftex) +bar = Environment(ENV = ENV, PDFTEX = r'%s wrapper.py ' + pdftex) foo.PDF(target = 'foo.pdf', source = 'foo.tex') bar.PDF(target = 'bar', source = 'bar.tex') """ % python) diff --git a/test/RCS.py b/test/RCS.py index 0dfc4bc..68bb546 100644 --- a/test/RCS.py +++ b/test/RCS.py @@ -83,6 +83,8 @@ test.no_result(os.path.exists(test.workpath('work1', 'sub', 'eee.in'))) test.no_result(os.path.exists(test.workpath('work1', 'sub', 'fff.in'))) test.write(['work1', 'SConstruct'], """ +import os +ENV = {'PATH' : os.environ['PATH']} def cat(env, source, target): target = str(target[0]) source = map(str, source) @@ -90,7 +92,8 @@ def cat(env, source, target): for src in source: f.write(open(src, "rb").read()) f.close() -env = Environment(BUILDERS={'Cat':Builder(action=cat)}, +env = Environment(ENV=ENV, + BUILDERS={'Cat':Builder(action=cat)}, RCS_COFLAGS='-q') env.Cat('aaa.out', 'aaa.in') env.Cat('bbb.out', 'bbb.in') @@ -169,6 +172,8 @@ test.no_result(os.path.exists(test.workpath('work2', 'sub', 'bbb.in'))) test.no_result(os.path.exists(test.workpath('work2', 'sub', 'ccc.in'))) test.write(['work2', 'SConstruct'], """ +import os +ENV = { 'PATH' : os.environ['PATH'] } def cat(env, source, target): target = str(target[0]) source = map(str, source) @@ -177,7 +182,7 @@ def cat(env, source, target): f.write(open(src, "rb").read()) f.close() _default_env['RCS_COFLAGS'] = '-l' -env = Environment(BUILDERS={'Cat':Builder(action=cat)}) +env = Environment(ENV=ENV, BUILDERS={'Cat':Builder(action=cat)}) env.Cat('aaa.out', 'aaa.in') env.Cat('bbb.out', 'bbb.in') env.Cat('ccc.out', 'ccc.in') diff --git a/test/SHCCFLAGS.py b/test/SHCCFLAGS.py index 2ba45b3..610fcd1 100644 --- a/test/SHCCFLAGS.py +++ b/test/SHCCFLAGS.py @@ -27,6 +27,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import sys import TestSCons import os +import string if sys.platform == 'win32': fooflags = '/nologo -DFOO' @@ -35,10 +36,12 @@ else: fooflags = '-DFOO' barflags = '-DBAR' +test = TestSCons.TestSCons() + if os.name == 'posix': os.environ['LD_LIBRARY_PATH'] = '.' - -test = TestSCons.TestSCons() +if string.find(sys.platform, 'irix') > -1: + os.environ['LD_LIBRARYN32_PATH'] = '.' test.write('SConstruct', """ foo = Environment(SHCCFLAGS = '%s', WIN32_INSERT_DEF=1) diff --git a/test/SHCXXFLAGS.py b/test/SHCXXFLAGS.py index 49de950..38feca1 100644 --- a/test/SHCXXFLAGS.py +++ b/test/SHCXXFLAGS.py @@ -27,6 +27,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import sys import TestSCons import os +import string if sys.platform == 'win32': _obj = '.obj' @@ -39,6 +40,8 @@ else: if os.name == 'posix': os.environ['LD_LIBRARY_PATH'] = '.' +if string.find(sys.platform, 'irix') > -1: + os.environ['LD_LIBRARYN32_PATH'] = '.' test = TestSCons.TestSCons() diff --git a/test/SHF77.py b/test/SHF77.py index 19fa51e..23e9bf3 100644 --- a/test/SHF77.py +++ b/test/SHF77.py @@ -34,7 +34,10 @@ python = TestSCons.python if sys.platform == 'win32': _obj = '.obj' else: - _obj = '.os' + if string.find(sys.platform, 'irix') > -1: + _obj = '.o' + else: + _obj = '.os' test = TestSCons.TestSCons() diff --git a/test/SHF77FLAGS.py b/test/SHF77FLAGS.py index 3ea6577..444f106 100644 --- a/test/SHF77FLAGS.py +++ b/test/SHF77FLAGS.py @@ -34,7 +34,10 @@ python = TestSCons.python if sys.platform == 'win32': _obj = '.obj' else: - _obj = '.os' + if string.find(sys.platform, 'irix') > -1: + _obj = '.o' + else: + _obj = '.os' test = TestSCons.TestSCons() @@ -111,6 +114,7 @@ test.fail_test(test.read('test6' + _obj) != " -x -c\nThis is a .FPP file.\n") g77 = test.where_is('g77') +FTN_LIB = TestSCons.fortran_lib if g77: @@ -123,12 +127,12 @@ os.system(string.join(sys.argv[1:], " ")) """ % string.replace(test.workpath('wrapper.out'), '\\', '\\\\')) test.write('SConstruct', """ -foo = Environment(LIBS = 'g2c') +foo = Environment(LIBS = r'%s') shf77 = foo.Dictionary('SHF77') bar = foo.Copy(SHF77 = r'%s wrapper.py ' + shf77, SHF77FLAGS = '-Ix') foo.SharedLibrary(target = 'foo/foo', source = 'foo.f') bar.SharedLibrary(target = 'bar/bar', source = 'bar.f') -""" % python) +""" % (FTN_LIB, python)) test.write('foo.f', r""" PROGRAM FOO diff --git a/test/SharedLibrary.py b/test/SharedLibrary.py index 9fa1141..fe35c02 100644 --- a/test/SharedLibrary.py +++ b/test/SharedLibrary.py @@ -193,11 +193,13 @@ test.run(arguments = '.') if os.name == 'posix': os.environ['LD_LIBRARY_PATH'] = '.' +if string.find(sys.platform, 'irix') != -1: + os.environ['LD_LIBRARYN32_PATH'] = '.' test.run(program = test.workpath('prog'), stdout = "f1.c\nf2a.c\nf2b.c\nf2c.c\nf3a.c\nf3b.c\nf3c.c\nprog.c\n") -if sys.platform == 'win32': +if sys.platform == 'win32' or string.find(sys.platform, 'irix') != -1: test.run(arguments = '-f SConstructFoo') else: test.run(arguments = '-f SConstructFoo', status=2, stderr=''' diff --git a/test/TAR.py b/test/TAR.py index 669bd0f..abd86ba 100644 --- a/test/TAR.py +++ b/test/TAR.py @@ -46,7 +46,9 @@ for opt, arg in opts: if opt == '-f': out = arg def process(outfile, name): if os.path.isdir(name): - for entry in os.listdir(name): + list = os.listdir(name) + list.sort() + for entry in list: process(outfile, os.path.join(name, entry)) else: outfile.write(open(name, 'rb').read()) diff --git a/test/TEX.py b/test/TEX.py index 11f6182..7a88e7a 100644 --- a/test/TEX.py +++ b/test/TEX.py @@ -75,9 +75,11 @@ os.system(string.join(sys.argv[1:], " ")) """ % string.replace(test.workpath('wrapper.out'), '\\', '\\\\')) test.write('SConstruct', """ -foo = Environment() +import os +ENV = { 'PATH' : os.environ['PATH'] } +foo = Environment(ENV = ENV) tex = foo.Dictionary('TEX') -bar = Environment(TEX = r'%s wrapper.py ' + tex) +bar = Environment(ENV = ENV, TEX = r'%s wrapper.py ' + tex) foo.DVI(target = 'foo.dvi', source = 'foo.tex') bar.DVI(target = 'bar', source = 'bar.tex') """ % python) diff --git a/test/TEXFLAGS.py b/test/TEXFLAGS.py index c171217..fa5edb6 100644 --- a/test/TEXFLAGS.py +++ b/test/TEXFLAGS.py @@ -81,9 +81,11 @@ os.system(string.join(sys.argv[1:], " ")) """ % string.replace(test.workpath('wrapper.out'), '\\', '\\\\')) test.write('SConstruct', """ -foo = Environment(TEXFLAGS = '--output-comment Commentary') +import os +ENV = { 'PATH' : os.environ['PATH'] } +foo = Environment(ENV = ENV, TEXFLAGS = '--output-comment Commentary') tex = foo.Dictionary('TEX') -bar = Environment(TEX = r'%s wrapper.py ' + tex) +bar = Environment(ENV = ENV, TEX = r'%s wrapper.py ' + tex) foo.DVI(target = 'foo.dvi', source = 'foo.tex') bar.DVI(target = 'bar', source = 'bar.tex') """ % python) diff --git a/test/ZIP.py b/test/ZIP.py index 3ba6a23..1924ab4 100644 --- a/test/ZIP.py +++ b/test/ZIP.py @@ -42,7 +42,9 @@ import os.path import sys def process(outfile, name): if os.path.isdir(name): - for entry in os.listdir(name): + list = os.listdir(name) + list.sort() + for entry in list: process(outfile, os.path.join(name, entry)) else: outfile.write(open(name, 'rb').read()) diff --git a/test/redirection.py b/test/redirection.py index da3732e..cc356c6 100644 --- a/test/redirection.py +++ b/test/redirection.py @@ -27,6 +27,8 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os import TestSCons +python = TestSCons.python + test = TestSCons.TestSCons() test.write('cat.py', r""" @@ -42,12 +44,12 @@ sys.exit(0) test.write('SConstruct', r""" env = Environment() env.Command(target='foo1', source='bar1', - action='python cat.py $SOURCES > $TARGET') + action= '%s cat.py $SOURCES > $TARGET') env.Command(target='foo2', source='bar2', - action='python cat.py < $SOURCES > $TARGET') + action= '%s cat.py < $SOURCES > $TARGET') env.Command(target='foo3', source='bar3', - action='python cat.py $SOURCES | python cat.py > $TARGET') -""") + action='%s cat.py $SOURCES | %s cat.py > $TARGET') +""" % (python, python, python, python)) test.write('bar1', 'bar1\r\n') test.write('bar2', 'bar2\r\n') diff --git a/test/subdir.py b/test/subdir.py index e155a67..03cbed3 100644 --- a/test/subdir.py +++ b/test/subdir.py @@ -27,6 +27,8 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import TestSCons import os.path +python = TestSCons.python + test = TestSCons.TestSCons() test.subdir('subdir') @@ -40,13 +42,13 @@ file.close() """) test.write('SConstruct', """ -B = Builder(action = "python build.py $TARGETS $SOURCES") +B = Builder(action = "%s build.py $TARGETS $SOURCES") env = Environment(BUILDERS = { 'B' : B }) env.B(target = 'subdir/f1.out', source = 'subdir/f1.in') env.B(target = 'subdir/f2.out', source = 'subdir/f2.in') env.B(target = 'subdir/f3.out', source = 'subdir/f3.in') env.B(target = 'subdir/f4.out', source = 'subdir/f4.in') -""") +""" % python) test.write(['subdir', 'f1.in'], "f1.in\n") test.write(['subdir', 'f2.in'], "f2.in\n") -- cgit v0.12