Win32 portability fixes for various tests.
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Wed, 26 Jun 2002 01:47:54 +0000 (01:47 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Wed, 26 Jun 2002 01:47:54 +0000 (01:47 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@396 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/engine/SCons/Tool/mslink.py
test/F77.py
test/F77FLAGS.py
test/F77PATH.py
test/Install.py
test/LIBPATH.py
test/SHF77.py
test/SHF77FLAGS.py
test/option-v.py
test/win32pathmadness.py

index 2f05b46c6f3b1ef38292a9b882339c9bcd1ea821..5b458c05e5e85559863c515878416b6f36873ae4 100644 (file)
@@ -34,6 +34,7 @@ selection method.
 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
 import os.path
+import string
 
 import SCons.Defaults
 import SCons.Errors
index 654849882a991c34dd8cfb029f3dcec0d13fa354..8e53fabe37d26beb3da23eceb14908b4bcf30b38 100644 (file)
@@ -58,26 +58,6 @@ for l in infile.readlines():
     if l[:5] != '#link':
        outfile.write(l)
 sys.exit(0)
-""")
-
-    test.write('myg77.py', r"""
-import sys
-args = sys.argv[1:]
-inf = None
-while args:
-    a = args[0]
-    args = args[1:]
-    if a[0] != '/':
-        if not inf:
-            inf = a
-        continue
-    if a[:3] == '/Fo': out = a[3:]
-infile = open(inf, 'rb')
-outfile = open(out, 'wb')
-for l in infile.readlines():
-    if l[:4] != '#g77':
-       outfile.write(l)
-sys.exit(0)
 """)
 
 else:
@@ -96,7 +76,7 @@ for l in infile.readlines():
 sys.exit(0)
 """)
 
-    test.write('myg77.py', r"""
+test.write('myg77.py', r"""
 import getopt
 import sys
 opts, args = getopt.getopt(sys.argv[1:], 'co:')
index e4d1f8cf43749968291cb259f86d69f8c925352a..79469c49e56846de9560fa2dfc08356340a75b3c 100644 (file)
@@ -38,8 +38,6 @@ if sys.platform == 'win32':
 
     _exe = '.exe'
 
-    o = ' -x /c'
-
     test.write('mylink.py', r"""
 import string
 import sys
@@ -56,39 +54,12 @@ for l in infile.readlines():
     if l[:5] != '#link':
        outfile.write(l)
 sys.exit(0)
-""")
-
-    test.write('myg77.py', r"""
-import sys
-args = sys.argv[1:]
-inf = None
-optstring = ''
-while args:
-    a = args[0]
-    args = args[1:]
-    if not a[0] in '/-':
-        if not inf:
-            inf = a
-        continue
-    if a[:3] == '/Fo':
-        out = a[3:]
-        continue
-    optstring = optstring + ' ' + a
-infile = open(inf, 'rb')
-outfile = open(out, 'wb')
-outfile.write(optstring + "\n")
-for l in infile.readlines():
-    if l[:4] != '#g77':
-       outfile.write(l)
-sys.exit(0)
 """)
 
 else:
 
     _exe = ''
 
-    o = ' -x -c'
-
     test.write('mylink.py', r"""
 import getopt
 import sys
@@ -103,7 +74,7 @@ for l in infile.readlines():
 sys.exit(0)
 """)
 
-    test.write('myg77.py', r"""
+test.write('myg77.py', r"""
 import getopt
 import sys
 opts, args = getopt.getopt(sys.argv[1:], 'co:x')
@@ -165,17 +136,17 @@ test.write('test6.FPP', r"""This is a .FPP file.
 
 test.run(arguments = '.', stderr = None)
 
-test.fail_test(test.read('test1' + _exe) != "%s\nThis is a .f file.\n" % o)
+test.fail_test(test.read('test1' + _exe) != " -x -c\nThis is a .f file.\n")
 
-test.fail_test(test.read('test2' + _exe) != "%s\nThis is a .for file.\n" % o)
+test.fail_test(test.read('test2' + _exe) != " -x -c\nThis is a .for file.\n")
 
-test.fail_test(test.read('test3' + _exe) != "%s\nThis is a .FOR file.\n" % o)
+test.fail_test(test.read('test3' + _exe) != " -x -c\nThis is a .FOR file.\n")
 
-test.fail_test(test.read('test4' + _exe) != "%s\nThis is a .F file.\n" % o)
+test.fail_test(test.read('test4' + _exe) != " -x -c\nThis is a .F file.\n")
 
-test.fail_test(test.read('test5' + _exe) != "%s\nThis is a .fpp file.\n" % o)
+test.fail_test(test.read('test5' + _exe) != " -x -c\nThis is a .fpp file.\n")
 
-test.fail_test(test.read('test6' + _exe) != "%s\nThis is a .FPP file.\n" % o)
+test.fail_test(test.read('test6' + _exe) != " -x -c\nThis is a .FPP file.\n")
 
 
 
index e8b540f5ffd674e499e0e7333a93d57f1ebacafe..ad38bf1f6e5cce1ea1127ab216245c101a813221 100644 (file)
@@ -41,6 +41,11 @@ args = prog + ' ' + subdir_prog + ' ' + variant_prog
 
 test = TestSCons.TestSCons()
 
+if not test.where_is('g77'):
+    print "g77 is not installed on this system."
+    print "Cannot test F77PATH."
+    test.no_result(1)
+
 test.subdir('include', 'subdir', ['subdir', 'include'], 'inc2')
 
 test.write('SConstruct', """
index 3a3c2bc59095daea2ddc139af839394c76a0312e..cd0238bc2e6449038ab18f071f6ecaa10a7e1c7f 100644 (file)
@@ -95,8 +95,8 @@ test.run(arguments = '.')
 test.fail_test(oldtime1 == os.path.getmtime(foo1))
 test.fail_test(oldtime2 != os.path.getmtime(foo2))
 
-# Verify that scons prints an error message if a target can not be unlinked before
-# building it:
+# Verify that scons prints an error message
+# if a target can not be unlinked before building it:
 test.write('f1.c', r"""
 #include <stdio.h>
 
@@ -108,7 +108,10 @@ int main(void)
 """)
 
 os.chmod(test.workpath('.'), 0555)
+f = open(test.workpath('f1' + _obj), 'rb')
 
 test.run(arguments = foo1, stderr="scons: *** [Errno 13] Permission denied: 'f1%s'\n"%_obj, status=2)
 
+f.close()
+
 test.pass_test()
index 0176c07925a0a94400b93856499d20cd6dd8a31e..51b29989b984df5f960d28a512c02b5698e2ff78 100644 (file)
@@ -56,7 +56,7 @@ env1.Library(target = './lib1/foo1', source = f1)
 
 env2 = Environment(LIBS = 'foo2',
                    LIBPATH = '.')
-env2.SharedLibrary(target = 'shlib', source = 'shlib.c')
+env2.SharedLibrary(target = 'shlib', source = 'shlib.c', no_import_lib = 1)
 env2.Library(target = 'foo2', source = f1)
 """)
 
@@ -127,7 +127,7 @@ env1.Library(target = './lib1/foo1', source = f1)
 
 env2 = Environment(LIBS = 'foo2',
                    LIBPATH = Split('. ./lib2'))
-env2.SharedLibrary(target = 'shlib', source = 'shlib.c')
+env2.SharedLibrary(target = 'shlib', source = 'shlib.c', no_import_lib = 1)
 env2.Library(target = 'foo2', source = f1)
 """)
 
index 86f1087444fb0e67afdfcaf4620d2c60b6c59d11..b0bde911b330984792527435c79e5f4272a861a8 100644 (file)
@@ -40,31 +40,7 @@ test = TestSCons.TestSCons()
 
 
 
-if sys.platform == 'win32':
-
-    test.write('myg77.py', r"""
-import sys
-args = sys.argv[1:]
-inf = None
-while args:
-    a = args[0]
-    args = args[1:]
-    if a[0] != '/':
-        if not inf:
-            inf = a
-        continue
-    if a[:3] == '/Fo': out = a[3:]
-infile = open(inf, 'rb')
-outfile = open(out, 'wb')
-for l in infile.readlines():
-    if l[:4] != '#g77':
-       outfile.write(l)
-sys.exit(0)
-""")
-
-else:
-
-    test.write('myg77.py', r"""
+test.write('myg77.py', r"""
 import getopt
 import sys
 opts, args = getopt.getopt(sys.argv[1:], 'cf:o:')
index 3034c3e281e907e78d17077f332ee3cab6896acf..f9d729f899282855aa08a8a67599a52d0e381ff3 100644 (file)
@@ -40,40 +40,7 @@ test = TestSCons.TestSCons()
 
 
 
-if sys.platform == 'win32':
-
-    o = ' -x /c'
-
-    test.write('myg77.py', r"""
-import sys
-args = sys.argv[1:]
-inf = None
-optstring = ''
-while args:
-    a = args[0]
-    args = args[1:]
-    if not a[0] in '/-':
-        if not inf:
-            inf = a
-        continue
-    if a[:3] == '/Fo':
-        out = a[3:]
-        continue
-    optstring = optstring + ' ' + a
-infile = open(inf, 'rb')
-outfile = open(out, 'wb')
-outfile.write(optstring + "\n")
-for l in infile.readlines():
-    if l[:4] != '#g77':
-       outfile.write(l)
-sys.exit(0)
-""")
-
-else:
-
-    o = ' -x -c'
-
-    test.write('myg77.py', r"""
+test.write('myg77.py', r"""
 import getopt
 import sys
 opts, args = getopt.getopt(sys.argv[1:], 'co:x')
@@ -129,17 +96,17 @@ test.write('test6.FPP', r"""This is a .FPP file.
 
 test.run(arguments = '.', stderr = None)
 
-test.fail_test(test.read('test1' + _obj) != "%s\nThis is a .f file.\n" % o)
+test.fail_test(test.read('test1' + _obj) != " -x -c\nThis is a .f file.\n")
 
-test.fail_test(test.read('test2' + _obj) != "%s\nThis is a .for file.\n" % o)
+test.fail_test(test.read('test2' + _obj) != " -x -c\nThis is a .for file.\n")
 
-test.fail_test(test.read('test3' + _obj) != "%s\nThis is a .FOR file.\n" % o)
+test.fail_test(test.read('test3' + _obj) != " -x -c\nThis is a .FOR file.\n")
 
-test.fail_test(test.read('test4' + _obj) != "%s\nThis is a .F file.\n" % o)
+test.fail_test(test.read('test4' + _obj) != " -x -c\nThis is a .F file.\n")
 
-test.fail_test(test.read('test5' + _obj) != "%s\nThis is a .fpp file.\n" % o)
+test.fail_test(test.read('test5' + _obj) != " -x -c\nThis is a .fpp file.\n")
 
-test.fail_test(test.read('test6' + _obj) != "%s\nThis is a .FPP file.\n" % o)
+test.fail_test(test.read('test6' + _obj) != " -x -c\nThis is a .FPP file.\n")
 
 
 
index f114e25af667c82cbfde5720fe3b47a7e05b5a51..4adcf5ea9eb5315c0835645f21824e204c568707 100644 (file)
@@ -34,8 +34,8 @@ test = TestSCons.TestSCons(match = TestCmd.match_re)
 test.write('SConstruct', "")
 
 expect = r"""SCons by Steven Knight et al.:
-\tscript: v\d\.\d\d\.\S+, \d\d\d\d/\d\d/\d\d \d\d:\d\d:\d\d, by \S+ on \S+
-\tengine: v\d\.\d\d\.\S+, \d\d\d\d/\d\d/\d\d \d\d:\d\d:\d\d, by \S+ on \S+
+\tscript: v\S+, [^,]*, by \S+ on \S+
+\tengine: v\S+, [^,]*, by \S+ on \S+
 Copyright 2001, 2002 Steven Knight
 """
 
index 7c0088c74ebbd60c3a14c7ad6c3034d173947a39..745e24e72c53dcf06ca327485fd88b34c831e8ec 100644 (file)
@@ -44,10 +44,10 @@ if sys.platform != 'win32':
 test.subdir('src', 'build', 'include', 'src2')
 
 test.write('src/SConstruct', """
-env=Environment(LIBS=['../build/foo'], CPPPATH=['../include'], CCCOM='$CC $CCFLAGS $CPPFLAGS $_INCFLAGS /c ${SOURCES.abspath} /Fo$TARGET')
+env=Environment(LIBS=['../build/foo'], CPPPATH=['../include'], CCCOM='$CC $CCFLAGS $CPPFLAGS $_CPPINCFLAGS /c ${SOURCES.abspath} /Fo$TARGET')
 foo=env.Object('../build/foo', 'foo.c')
 Default(env.Library('../build/foo', foo))
-Default(env.Library('../build/bar', 'bar.c', shared=1))
+Default(env.SharedLibrary('../build/bar', 'bar.c'))
 Default(env.Program('../build/bar', ['main.c', '../src2/blat.c', '../build/bar.lib']))
 """)