diff options
author | Gary Oberbrunner <garyo@oberbrunner.com> | 2013-08-25 13:51:55 (GMT) |
---|---|---|
committer | Gary Oberbrunner <garyo@oberbrunner.com> | 2013-08-25 13:51:55 (GMT) |
commit | d9ee0920aa8f861e326ffb8278661de58dacbac8 (patch) | |
tree | be1b724d5da507ac34721397b08f94d3e1d4151a /test | |
parent | 96119bccc3252d27798353a07fe4b52eaff17efb (diff) | |
parent | 6d7f7a2a743436e65432c6b2ed1037c7c4ad2477 (diff) | |
download | SCons-d9ee0920aa8f861e326ffb8278661de58dacbac8.zip SCons-d9ee0920aa8f861e326ffb8278661de58dacbac8.tar.gz SCons-d9ee0920aa8f861e326ffb8278661de58dacbac8.tar.bz2 |
Merge pull request #84, cyglink tool from David Rothenberger.
Also updated src/CHANGES.txt.
Diffstat (limited to 'test')
-rw-r--r-- | test/LINK/VersionedLib.py | 12 | ||||
-rw-r--r-- | test/Libs/SharedLibrary.py | 9 | ||||
-rw-r--r-- | test/Libs/SharedLibraryIxes.py | 20 |
3 files changed, 34 insertions, 7 deletions
diff --git a/test/LINK/VersionedLib.py b/test/LINK/VersionedLib.py index 0d45789..3c92252 100644 --- a/test/LINK/VersionedLib.py +++ b/test/LINK/VersionedLib.py @@ -98,6 +98,18 @@ elif platform == 'darwin': 'libtest.dylib',
'libtest.2.5.4.dylib',
]
+elif platform == 'cygwin':
+ # All (?) the files we expect will get created in the current directory
+ files = [
+ 'cygtest-2-5-4.dll',
+ 'libtest-2-5-4.dll.a',
+ 'test.os',
+ ]
+ # All (?) the files we expect will get created in the 'installtest' directory
+ instfiles = [
+ 'cygtest-2-5-4.dll',
+ 'libtest-2-5-4.dll.a',
+ ]
elif platform == 'win32':
# All (?) the files we expect will get created in the current directory
files = [
diff --git a/test/Libs/SharedLibrary.py b/test/Libs/SharedLibrary.py index 18d1f24..b7d1374 100644 --- a/test/Libs/SharedLibrary.py +++ b/test/Libs/SharedLibrary.py @@ -44,7 +44,7 @@ else: SharedLibrary(target = 'foo2', source = Split('f2a.c f2b.c f2c.c'), WINDOWS_INSERT_DEF = 1) -env.SharedLibrary(target = 'foo3', source = ['f3a.c', 'f3b.c', 'f3c.c']) +env.SharedLibrary(target = 'foo3', source = ['f3a.c', 'f3b.c', 'f3c.c'], no_import_lib = 1) env2.Program(target = 'prog', source = 'prog.c') """) @@ -207,6 +207,13 @@ if sys.platform.find('irix') != -1: 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 == 'cygwin': + # Cygwin: Make sure the DLLs are prefixed correctly. + test.must_exist('cygfoo1.dll', 'cygfoo2.dll', 'cygfoo3.dll') + test.must_exist('libfoo1.dll.a', 'libfoo2.dll.a') + test.must_not_exist('foo3.dll.a') + + if sys.platform == 'win32' or sys.platform.find('irix') != -1: test.run(arguments = '-f SConstructFoo') else: diff --git a/test/Libs/SharedLibraryIxes.py b/test/Libs/SharedLibraryIxes.py index 4804f5f..6924769 100644 --- a/test/Libs/SharedLibraryIxes.py +++ b/test/Libs/SharedLibraryIxes.py @@ -30,12 +30,14 @@ libraries that have non-standard library prefixes and suffixes. """ import re +import sys import TestSCons test = TestSCons.TestSCons() test.write('SConstruct', """ import sys +isCygwin = sys.platform == 'cygwin' isWindows = sys.platform == 'win32' isMingw = False if isWindows: @@ -107,9 +109,9 @@ def nameInLib(source, lib, libname): return (source, libname) libmethods = [nodeInSrc, pathInSrc, nodeInLib, pathInLib] -# We skip the nameInLib test for MinGW...it would fail, due to +# We skip the nameInLib test for MinGW and Cygwin...they would fail, due to # the Tool's internal naming conventions -if not isMingw: +if not isMingw and not isCygwin: libmethods.extend([nameInLib]) def buildAndlinkAgainst(builder, target, source, method, lib, libname, **kw): @@ -122,11 +124,11 @@ def buildAndlinkAgainst(builder, target, source, method, lib, libname, **kw): if str(l)[-4:] == '.lib': lib = [l] break - # If we use MinGW and create a SharedLibrary, we get two targets: a DLL, + # If we use MinGW or Cygwin and create a SharedLibrary, we get two targets: a DLL, # and the import lib created by the "--out-implib" parameter. We always # want to link against the second one, in order to prevent naming issues # for the linker command line... - if isMingw and len(lib) > 1: + if (isMingw or isCygwin) and len(lib) > 1: lib = lib[1:] # Apply the naming method to be tested and call the specified Builder. @@ -276,8 +278,14 @@ tests = re.findall(r'Prog: (\d+), (\S+), (\S+), (\S+)', test.stdout()) expected = "goo.c\nfoo.c\nprog.c\n" for t in tests: - test.must_exist(t[1]) - test.must_exist(t[2]) + if sys.platform != 'cygwin': + test.must_exist(t[1]) + test.must_exist(t[2]) + else: + # Cygwin turns libFoo.xxx into cygFoo.xxx + for f in t[1:2]: + test.must_exist(re.sub('^lib', 'cyg', f)) + test.must_exist(t[3]) test.run(program = test.workpath(t[3]), stdout=expected) |