diff options
author | Steven Knight <knight@baldmt.com> | 2003-11-10 16:13:15 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2003-11-10 16:13:15 (GMT) |
commit | 8de5ae79c1f6096683ee125b38b2e2d7525b7f07 (patch) | |
tree | 386f3ae3eac37497adf92f1a1539cd9f7ce13bd3 /test | |
parent | 9dd1434a94d2472b6f6d2956eb2b3e422d251a75 (diff) | |
download | SCons-8de5ae79c1f6096683ee125b38b2e2d7525b7f07.zip SCons-8de5ae79c1f6096683ee125b38b2e2d7525b7f07.tar.gz SCons-8de5ae79c1f6096683ee125b38b2e2d7525b7f07.tar.bz2 |
Use sys.stdout.write() instead of print so line feeds in -j output will stay (more) consistent. Fix suffix-handling on case-insensitive Cygwin systems. Test fixes for Cygwin portability. (Chad Austin)
Diffstat (limited to 'test')
-rw-r--r-- | test/Configure.py | 2 | ||||
-rw-r--r-- | test/LIBPATH.py | 4 | ||||
-rw-r--r-- | test/QT.py | 8 | ||||
-rw-r--r-- | test/SHLIBSUFFIX.py | 4 | ||||
-rw-r--r-- | test/SHLINK.py | 6 | ||||
-rw-r--r-- | test/SHLINKFLAGS.py | 2 | ||||
-rw-r--r-- | test/gnutools.py | 22 |
7 files changed, 28 insertions, 20 deletions
diff --git a/test/Configure.py b/test/Configure.py index 2b134dc..9c5d14a 100644 --- a/test/Configure.py +++ b/test/Configure.py @@ -330,7 +330,7 @@ def CheckCustom(test): resOK = resOK and retActOK and int(outputActOK)==0 resFAIL = retCompileFAIL or retLinkFAIL or retRunFAIL or outputRunFAIL!="" resFAIL = resFAIL or retActFAIL or outputActFAIL!="" - test.Result( resOK and not resFAIL ) + test.Result( int(resOK and not resFAIL) ) return resOK and not resFAIL env = Environment() diff --git a/test/LIBPATH.py b/test/LIBPATH.py index 6e2a836..d691af2 100644 --- a/test/LIBPATH.py +++ b/test/LIBPATH.py @@ -31,14 +31,14 @@ import time _exe = TestSCons._exe _dll = TestSCons._dll -lib_ = TestSCons.lib_ +dll_ = TestSCons.dll_ test = TestSCons.TestSCons() test.subdir('lib1', 'lib2') prog1 = test.workpath('prog') + _exe -prog2 = test.workpath(lib_ + 'shlib') + _dll +prog2 = test.workpath(dll_ + 'shlib') + _dll test.write('SConstruct', """ env1 = Environment(LIBS = [ 'foo1' ], @@ -34,8 +34,10 @@ import os.path python = TestSCons.python _exe = TestSCons._exe -_dll = TestSCons._dll lib_ = TestSCons.lib_ +_lib = TestSCons._lib +dll_ = TestSCons.dll_ +_dll = TestSCons._dll test = TestSCons.TestSCons() @@ -189,7 +191,7 @@ test.fail_test( not os.path.exists(test.workpath('work1', 'build', moc)) ) # 2. create .cpp, .h, moc_....cpp from .ui file -aaa_dll = lib_ + 'aaa' + _dll +aaa_dll = dll_ + 'aaa' + _dll moc = 'moc_aaa.cc' cpp = 'aaa.cc' h = 'aaa.h' @@ -241,7 +243,7 @@ test.fail_test(not os.path.exists(test.workpath('work2','build',moc)) or # 3. create a moc file from a cpp file -lib_aaa = lib_ + 'aaa.a' +lib_aaa = lib_ + 'aaa' + _lib moc = 'moc_aaa.cc' createSConstruct(test, ['work3', 'SConstruct']) diff --git a/test/SHLIBSUFFIX.py b/test/SHLIBSUFFIX.py index 4c2d7ac..aeea958 100644 --- a/test/SHLIBSUFFIX.py +++ b/test/SHLIBSUFFIX.py @@ -28,7 +28,7 @@ import os import sys import TestSCons -lib_ = TestSCons.lib_ +dll_ = TestSCons.dll_ test = TestSCons.TestSCons() @@ -47,6 +47,6 @@ foo(void) test.run(arguments = '.') -test.fail_test(not os.path.exists(test.workpath(lib_ + 'foo.shlib'))) +test.fail_test(not os.path.exists(test.workpath(dll_ + 'foo.shlib'))) test.pass_test() diff --git a/test/SHLINK.py b/test/SHLINK.py index 7f1c63d..ff24f0c 100644 --- a/test/SHLINK.py +++ b/test/SHLINK.py @@ -30,7 +30,7 @@ import sys import TestSCons python = TestSCons.python -lib_ = TestSCons.lib_ +dll_ = TestSCons.dll_ _shlib = TestSCons._dll test = TestSCons.TestSCons() @@ -73,11 +73,11 @@ test() } """) -test.run(arguments = lib_ + 'foo' + _shlib) +test.run(arguments = dll_ + 'foo' + _shlib) test.fail_test(os.path.exists(test.workpath('wrapper.out'))) -test.run(arguments = lib_ + 'bar' + _shlib) +test.run(arguments = dll_ + 'bar' + _shlib) test.fail_test(test.read('wrapper.out') != "wrapper.py\n") diff --git a/test/SHLINKFLAGS.py b/test/SHLINKFLAGS.py index 9a4a6cc..b7f18ca 100644 --- a/test/SHLINKFLAGS.py +++ b/test/SHLINKFLAGS.py @@ -30,7 +30,7 @@ import sys import TestSCons python = TestSCons.python -lib_ = TestSCons.lib_ +lib_ = TestSCons.dll_ _shlib = TestSCons._dll test = TestSCons.TestSCons() diff --git a/test/gnutools.py b/test/gnutools.py index ebc08c3..d5173ee 100644 --- a/test/gnutools.py +++ b/test/gnutools.py @@ -30,10 +30,11 @@ Testing the gnu tool chain, i.e. the tools 'gcc', 'g++' and 'gnulink'. import TestSCons import string +import sys python = TestSCons.python _exe = TestSCons._exe _dll = TestSCons._dll -lib_ = TestSCons.lib_ +dll_ = TestSCons.dll_ test = TestSCons.TestSCons() test.subdir('gnutools') @@ -124,19 +125,24 @@ def testObject(test, obj, command, flags): if not res: print "'"+obj+command+flags+"'"+"!='"+str(line1)+"'" return res +if sys.platform == 'cygwin': + fpic = '' +else: + fpic = '-fPIC ' + test.fail_test(not testObject(test, 'cfile1.o', 'gcc', '-c') or not testObject(test, 'cfile2.o', 'gcc', '-c') or not testObject(test, 'cppfile1.o', 'g++', '-c') or not testObject(test, 'cppfile2.o', 'g++', '-c') or - not testObject(test, 'cfile1.os', 'gcc', '-fPIC -c') or - not testObject(test, 'cfile2.os', 'gcc', '-fPIC -c') or - not testObject(test, 'cppfile1.os', 'g++', '-fPIC -c') or - not testObject(test, 'cppfile2.os', 'g++', '-fPIC -c') or + not testObject(test, 'cfile1.os', 'gcc', fpic + '-c') or + not testObject(test, 'cfile2.os', 'gcc', fpic + '-c') or + not testObject(test, 'cppfile1.os', 'g++', fpic + '-c') or + not testObject(test, 'cppfile2.os', 'g++', fpic + '-c') or not testObject(test, 'c-only' + _exe, 'gcc', '') or not testObject(test, 'cpp-only' + _exe, 'g++', '') or not testObject(test, 'c-and-cpp' + _exe, 'g++', '') or - not testObject(test, lib_ + 'c-only' + _dll, 'gcc', '-shared') or - not testObject(test, lib_ + 'cpp-only' + _dll, 'g++', '-shared') or - not testObject(test, lib_ + 'c-and-cpp' + _dll, 'g++', '-shared')) + not testObject(test, dll_ + 'c-only' + _dll, 'gcc', '-shared') or + not testObject(test, dll_ + 'cpp-only' + _dll, 'g++', '-shared') or + not testObject(test, dll_ + 'c-and-cpp' + _dll, 'g++', '-shared')) test.pass_test() |