diff options
author | Steven Knight <knight@baldmt.com> | 2003-04-30 19:38:19 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2003-04-30 19:38:19 (GMT) |
commit | 3387eab42442c7fe7ed0064de5b939497cc6df1b (patch) | |
tree | 3c34e3c08fe379c147c7166067d05a0a87fccaa6 /test | |
parent | 212d77d88aa4374ef13f2e6bc7edf3395ac9736c (diff) | |
download | SCons-3387eab42442c7fe7ed0064de5b939497cc6df1b.zip SCons-3387eab42442c7fe7ed0064de5b939497cc6df1b.tar.gz SCons-3387eab42442c7fe7ed0064de5b939497cc6df1b.tar.bz2 |
Test portability fixes for Cygwin. (Chad Austin)
Diffstat (limited to 'test')
-rw-r--r-- | test/AR.py | 6 | ||||
-rw-r--r-- | test/ARFLAGS.py | 6 | ||||
-rw-r--r-- | test/AS.py | 11 | ||||
-rw-r--r-- | test/ASFLAGS.py | 5 | ||||
-rw-r--r-- | test/CC.py | 6 | ||||
-rw-r--r-- | test/CPPFLAGS.py | 15 | ||||
-rw-r--r-- | test/CPPPATH.py | 5 | ||||
-rw-r--r-- | test/CXX.py | 6 | ||||
-rw-r--r-- | test/ENV.py | 6 | ||||
-rw-r--r-- | test/F77.py | 6 | ||||
-rw-r--r-- | test/F77FLAGS.py | 6 | ||||
-rw-r--r-- | test/LEX.py | 6 | ||||
-rw-r--r-- | test/LEXFLAGS.py | 6 | ||||
-rw-r--r-- | test/LIBPATH.py | 11 | ||||
-rw-r--r-- | test/LINK.py | 6 | ||||
-rw-r--r-- | test/LINKFLAGS.py | 6 | ||||
-rw-r--r-- | test/Program-j.py | 5 | ||||
-rw-r--r-- | test/Program.py | 5 | ||||
-rw-r--r-- | test/RANLIB.py | 5 | ||||
-rw-r--r-- | test/RANLIBFLAGS.py | 6 | ||||
-rw-r--r-- | test/SHF77.py | 9 | ||||
-rw-r--r-- | test/SHLIBPREFIX.py | 5 | ||||
-rw-r--r-- | test/SHLIBSUFFIX.py | 5 | ||||
-rw-r--r-- | test/SHLINK.py | 9 | ||||
-rw-r--r-- | test/SHLINKFLAGS.py | 9 | ||||
-rw-r--r-- | test/YACC.py | 3 | ||||
-rw-r--r-- | test/YACCFLAGS.py | 3 | ||||
-rw-r--r-- | test/long-lines.py | 9 | ||||
-rw-r--r-- | test/option--implicit-cache.py | 8 | ||||
-rw-r--r-- | test/pre-post-actions.py | 5 | ||||
-rw-r--r-- | test/special-filenames.py | 17 |
31 files changed, 61 insertions, 155 deletions
@@ -30,11 +30,7 @@ import sys import TestSCons python = TestSCons.python - -if sys.platform == 'win32': - _exe = '.exe' -else: - _exe = '' +_exe = TestSCons._exe test = TestSCons.TestSCons() diff --git a/test/ARFLAGS.py b/test/ARFLAGS.py index 4936721..54cb463 100644 --- a/test/ARFLAGS.py +++ b/test/ARFLAGS.py @@ -30,11 +30,7 @@ import sys import TestSCons python = TestSCons.python - -if sys.platform == 'win32': - _exe = '.exe' -else: - _exe = '' +_exe = TestSCons._exe test = TestSCons.TestSCons() @@ -30,11 +30,7 @@ import sys import TestSCons python = TestSCons.python - -if sys.platform == 'win32': - _exe = '.exe' -else: - _exe = '' +_exe = TestSCons._exe test = TestSCons.TestSCons() @@ -67,11 +63,14 @@ inf = None while args: a = args[0] args = args[1:] - if a[0] != '/': + if not a[0] in "/-": if not inf: inf = a continue if a[:3] == '/Fo': out = a[3:] + if a == '-o': + out = args[0] + args = args[1:] infile = open(inf, 'rb') outfile = open(out, 'wb') for l in infile.readlines(): diff --git a/test/ASFLAGS.py b/test/ASFLAGS.py index 0331aed..d750a6a 100644 --- a/test/ASFLAGS.py +++ b/test/ASFLAGS.py @@ -32,12 +32,11 @@ import TestSCons python = TestSCons.python test = TestSCons.TestSCons() +_exe = TestSCons._exe if sys.platform == 'win32': - _exe = '.exe' - o = ' -x' o_c = ' -x' @@ -89,8 +88,6 @@ sys.exit(0) else: - _exe = '' - o = ' -x' o_c = ' -x -c' @@ -30,11 +30,7 @@ import sys import TestSCons python = TestSCons.python - -if sys.platform == 'win32': - _exe = '.exe' -else: - _exe = '' +_exe = TestSCons._exe test = TestSCons.TestSCons() diff --git a/test/CPPFLAGS.py b/test/CPPFLAGS.py index d8587c6..87f5603 100644 --- a/test/CPPFLAGS.py +++ b/test/CPPFLAGS.py @@ -30,18 +30,9 @@ import sys import TestSCons python = TestSCons.python - -if sys.platform == 'win32': - _exe = '.exe' - _obj = '.obj' - _shobj = '.obj' -else: - _exe = '' - _obj = '.o' - if string.find(sys.platform, 'irix') > -1: - _shobj = '.o' - else: - _shobj = '.os' +_exe = TestSCons._exe +_obj = TestSCons._obj +_shobj = TestSCons._shobj test = TestSCons.TestSCons() diff --git a/test/CPPPATH.py b/test/CPPPATH.py index cb650fa..1f93bf5 100644 --- a/test/CPPPATH.py +++ b/test/CPPPATH.py @@ -28,10 +28,7 @@ import os import sys import TestSCons -if sys.platform == 'win32': - _exe = '.exe' -else: - _exe = '' +_exe = TestSCons._exe prog = 'prog' + _exe subdir_prog = os.path.join('subdir', 'prog' + _exe) diff --git a/test/CXX.py b/test/CXX.py index cd2c7a9..bff7708 100644 --- a/test/CXX.py +++ b/test/CXX.py @@ -30,11 +30,7 @@ import sys import TestSCons python = TestSCons.python - -if sys.platform == 'win32': - _exe = '.exe' -else: - _exe = '' +_exe = TestSCons._exe test = TestSCons.TestSCons() diff --git a/test/ENV.py b/test/ENV.py index f92a2d8..31ad970 100644 --- a/test/ENV.py +++ b/test/ENV.py @@ -37,8 +37,10 @@ bin2_build_py = test.workpath('bin2', 'build.py') test.write('SConstruct', """ import os Bld = Builder(action = r"%s build.py $TARGET $SOURCES") -env1 = Environment(ENV = {'X' : 'env1'}, BUILDERS = { 'Bld' : Bld }) -env2 = Environment(ENV = {'X' : 'env2'}, BUILDERS = { 'Bld' : Bld }) +env1 = Environment(BUILDERS = { 'Bld' : Bld }) +env2 = Environment(BUILDERS = { 'Bld' : Bld }) +env1['ENV']['X'] = 'env1' +env2['ENV']['X'] = 'env2' env1.Bld(target = 'env1.out', source = 'input') env2.Bld(target = 'env2.out', source = 'input') """ % python) diff --git a/test/F77.py b/test/F77.py index f95dee9..0346765 100644 --- a/test/F77.py +++ b/test/F77.py @@ -30,11 +30,7 @@ import sys import TestSCons python = TestSCons.python - -if sys.platform == 'win32': - _exe = '.exe' -else: - _exe = '' +_exe = TestSCons._exe test = TestSCons.TestSCons() diff --git a/test/F77FLAGS.py b/test/F77FLAGS.py index b914701..b72c618 100644 --- a/test/F77FLAGS.py +++ b/test/F77FLAGS.py @@ -32,12 +32,10 @@ import TestSCons python = TestSCons.python test = TestSCons.TestSCons() - +_exe = TestSCons._exe if sys.platform == 'win32': - _exe = '.exe' - test.write('mylink.py', r""" import string import sys @@ -58,8 +56,6 @@ sys.exit(0) else: - _exe = '' - test.write('mylink.py', r""" import getopt import sys diff --git a/test/LEX.py b/test/LEX.py index 38d73fb..90549bd 100644 --- a/test/LEX.py +++ b/test/LEX.py @@ -31,11 +31,7 @@ import sys import TestSCons python = TestSCons.python - -if sys.platform == 'win32': - _exe = '.exe' -else: - _exe = '' +_exe = TestSCons._exe test = TestSCons.TestSCons() diff --git a/test/LEXFLAGS.py b/test/LEXFLAGS.py index c3ae182..ba440da 100644 --- a/test/LEXFLAGS.py +++ b/test/LEXFLAGS.py @@ -31,11 +31,7 @@ import sys import TestSCons python = TestSCons.python - -if sys.platform == 'win32': - _exe = '.exe' -else: - _exe = '' +_exe = TestSCons._exe test = TestSCons.TestSCons() diff --git a/test/LIBPATH.py b/test/LIBPATH.py index 2730be3..6e2a836 100644 --- a/test/LIBPATH.py +++ b/test/LIBPATH.py @@ -29,14 +29,9 @@ import sys import os.path import time -if sys.platform == 'win32': - _exe = '.exe' - _dll = '.dll' - lib_ = '' -else: - _exe = '' - _dll = '.so' - lib_ = 'lib' +_exe = TestSCons._exe +_dll = TestSCons._dll +lib_ = TestSCons.lib_ test = TestSCons.TestSCons() diff --git a/test/LINK.py b/test/LINK.py index 982cc88..e3c21bc 100644 --- a/test/LINK.py +++ b/test/LINK.py @@ -30,11 +30,7 @@ import sys import TestSCons python = TestSCons.python - -if sys.platform == 'win32': - _exe = '.exe' -else: - _exe = '' +_exe = TestSCons._exe test = TestSCons.TestSCons() diff --git a/test/LINKFLAGS.py b/test/LINKFLAGS.py index d5a1e40..58efcf3 100644 --- a/test/LINKFLAGS.py +++ b/test/LINKFLAGS.py @@ -30,11 +30,7 @@ import sys import TestSCons python = TestSCons.python - -if sys.platform == 'win32': - _exe = '.exe' -else: - _exe = '' +_exe = TestSCons._exe test = TestSCons.TestSCons() diff --git a/test/Program-j.py b/test/Program-j.py index 3e29040..fe778b3 100644 --- a/test/Program-j.py +++ b/test/Program-j.py @@ -27,10 +27,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import sys import TestSCons -if sys.platform == 'win32': - _exe = '.exe' -else: - _exe = '' +_exe = TestSCons._exe f1 = 'f1' + _exe f2 = 'f2' + _exe diff --git a/test/Program.py b/test/Program.py index b05a73a..3030172 100644 --- a/test/Program.py +++ b/test/Program.py @@ -29,10 +29,7 @@ import sys import time import TestSCons -if sys.platform == 'win32': - _exe = '.exe' -else: - _exe = '' +_exe = TestSCons._exe test = TestSCons.TestSCons() diff --git a/test/RANLIB.py b/test/RANLIB.py index 4879a83..cb8f1db 100644 --- a/test/RANLIB.py +++ b/test/RANLIB.py @@ -32,10 +32,7 @@ import TestSCons python = TestSCons.python -if sys.platform == 'win32': - _exe = '.exe' -else: - _exe = '' +_exe = TestSCons._exe test = TestSCons.TestSCons() diff --git a/test/RANLIBFLAGS.py b/test/RANLIBFLAGS.py index 0554d4c..fec606d 100644 --- a/test/RANLIBFLAGS.py +++ b/test/RANLIBFLAGS.py @@ -30,11 +30,7 @@ import sys import TestSCons python = TestSCons.python - -if sys.platform == 'win32': - _exe = '.exe' -else: - _exe = '' +_exe = TestSCons._exe test = TestSCons.TestSCons() diff --git a/test/SHF77.py b/test/SHF77.py index 23e9bf3..d78ef82 100644 --- a/test/SHF77.py +++ b/test/SHF77.py @@ -30,14 +30,7 @@ import sys import TestSCons python = TestSCons.python - -if sys.platform == 'win32': - _obj = '.obj' -else: - if string.find(sys.platform, 'irix') > -1: - _obj = '.o' - else: - _obj = '.os' +_obj = TestSCons._shobj test = TestSCons.TestSCons() diff --git a/test/SHLIBPREFIX.py b/test/SHLIBPREFIX.py index f830b68..25bca5f 100644 --- a/test/SHLIBPREFIX.py +++ b/test/SHLIBPREFIX.py @@ -28,10 +28,7 @@ import os import sys import TestSCons -if sys.platform == 'win32': - _lib = '.dll' -else: - _lib = '.so' +_lib = TestSCons._dll test = TestSCons.TestSCons() diff --git a/test/SHLIBSUFFIX.py b/test/SHLIBSUFFIX.py index 734f6c6..4c2d7ac 100644 --- a/test/SHLIBSUFFIX.py +++ b/test/SHLIBSUFFIX.py @@ -28,10 +28,7 @@ import os import sys import TestSCons -if sys.platform == 'win32': - lib_ = '' -else: - lib_ = 'lib' +lib_ = TestSCons.lib_ test = TestSCons.TestSCons() diff --git a/test/SHLINK.py b/test/SHLINK.py index 3fd8e75..7f1c63d 100644 --- a/test/SHLINK.py +++ b/test/SHLINK.py @@ -30,14 +30,9 @@ import sys import TestSCons python = TestSCons.python +lib_ = TestSCons.lib_ +_shlib = TestSCons._dll -if sys.platform == 'win32': - lib_ = '' - _shlib='.dll' -else: - lib_ = 'lib' - _shlib='.so' - test = TestSCons.TestSCons() test.write("wrapper.py", diff --git a/test/SHLINKFLAGS.py b/test/SHLINKFLAGS.py index 85ad6a3..9a4a6cc 100644 --- a/test/SHLINKFLAGS.py +++ b/test/SHLINKFLAGS.py @@ -30,13 +30,8 @@ import sys import TestSCons python = TestSCons.python - -if sys.platform == 'win32': - lib_ = '' - _shlib = '.dll' -else: - lib_ = 'lib' - _shlib = '.so' +lib_ = TestSCons.lib_ +_shlib = TestSCons._dll test = TestSCons.TestSCons() diff --git a/test/YACC.py b/test/YACC.py index 4854905..b44add1 100644 --- a/test/YACC.py +++ b/test/YACC.py @@ -31,13 +31,12 @@ import sys import TestSCons python = TestSCons.python +_exe = TestSCons._exe if sys.platform == 'win32': - _exe = '.exe' compiler = 'msvc' linker = 'mslink' else: - _exe = '' compiler = 'gcc' linker = 'gnulink' diff --git a/test/YACCFLAGS.py b/test/YACCFLAGS.py index 987025f..3ed6b6b 100644 --- a/test/YACCFLAGS.py +++ b/test/YACCFLAGS.py @@ -31,13 +31,12 @@ import sys import TestSCons python = TestSCons.python +_exe = TestSCons._exe if sys.platform == 'win32': - _exe = '.exe' compiler = 'msvc' linker = 'mslink' else: - _exe = '' compiler = 'gcc' linker = 'gnulink' diff --git a/test/long-lines.py b/test/long-lines.py index 3999f62..9d38504 100644 --- a/test/long-lines.py +++ b/test/long-lines.py @@ -32,13 +32,20 @@ import TestSCons test = TestSCons.TestSCons() -if sys.platform in ['win32', 'cygwin']: +if sys.platform == 'win32': lib_static_lib = 'static.lib' lib_shared_dll ='shared.dll' arflag_init = '/LIBPATH:' + test.workpath() arflag = ' /LIBPATH:' + test.workpath() linkflag_init = '/LIBPATH:' + test.workpath() linkflag = ' /LIBPATH:' + test.workpath() +elif sys.platform == 'cygwin': + lib_static_lib = 'libstatic.a' + lib_shared_dll ='shared.dll' + arflag_init = 'r' + arflag = 'o' + linkflag_init = '-L' + test.workpath() + linkflag = ' -L' + test.workpath() else: lib_shared_dll = 'libshared.so' lib_static_lib = 'libstatic.a' diff --git a/test/option--implicit-cache.py b/test/option--implicit-cache.py index e959856..ac11b2a 100644 --- a/test/option--implicit-cache.py +++ b/test/option--implicit-cache.py @@ -29,12 +29,8 @@ import sys import TestSCons import string -if sys.platform == 'win32': - _exe = '.exe' - _obj = '.obj' -else: - _exe = '' - _obj = '.o' +_exe = TestSCons._exe +_obj = TestSCons._obj prog = 'prog' + _exe subdir_prog = os.path.join('subdir', 'prog' + _exe) diff --git a/test/pre-post-actions.py b/test/pre-post-actions.py index d3139bb..91fcb3b 100644 --- a/test/pre-post-actions.py +++ b/test/pre-post-actions.py @@ -32,10 +32,7 @@ import stat import sys import TestSCons -if sys.platform == 'win32': - _exe = '.exe' -else: - _exe = '' +_exe = TestSCons._exe test = TestSCons.TestSCons() diff --git a/test/special-filenames.py b/test/special-filenames.py index d152e52..2002b37 100644 --- a/test/special-filenames.py +++ b/test/special-filenames.py @@ -32,7 +32,7 @@ import TestSCons test = TestSCons.TestSCons() -file_names = [ +attempt_file_names = [ 'File with spaces', 'File"with"double"quotes', "File'with'single'quotes", @@ -49,17 +49,20 @@ file_names = [ "Combination '\"\n\\;<>?|*\t&" ] -if os.name == 'nt': - # Windows only supports spaces. - file_names = file_names[0:1] - test.write("cat.py", """\ import sys open(sys.argv[1], 'wb').write(open(sys.argv[2], 'rb').read()) """) -for fn in file_names: - test.write(fn + '.in', fn + '\n') +file_names = [] +for fn in attempt_file_names: + try: + test.write(fn + '.in', fn + '\n') + file_names.append(fn) + except IOError: + # if the Python interpreter can't handle it, don't bother + # testing to see if SCons can + pass def buildFileStr(fn): return "env.Build(source=r\"\"\"%s.in\"\"\", target=r\"\"\"%s.out\"\"\")" % ( fn, fn ) |