diff options
author | Gary Oberbrunner <garyo@oberbrunner.com> | 2012-12-22 13:44:03 -0500 |
---|---|---|
committer | Gary Oberbrunner <garyo@oberbrunner.com> | 2012-12-22 13:44:03 -0500 |
commit | 96155426117d6908a3936e55b789c5aa046e5e89 (patch) | |
tree | 1b68a6c7a7c1667cd6e1680fedb86a2acc54d16e /test/LINK | |
parent | 42dda8223a0eaef419978ed929e4fb36d03b1c44 (diff) | |
parent | 48395483d853df4b81c50553b3a4de3a023d6cee (diff) | |
download | scons-96155426117d6908a3936e55b789c5aa046e5e89.tar.gz |
Merging pull request #62 from Dirk Baechle: fixes for MinGW tests
Diffstat (limited to 'test/LINK')
-rw-r--r-- | test/LINK/SHLINKCOMSTR.py | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/test/LINK/SHLINKCOMSTR.py b/test/LINK/SHLINKCOMSTR.py index f97040a6..de56c2c8 100644 --- a/test/LINK/SHLINKCOMSTR.py +++ b/test/LINK/SHLINKCOMSTR.py @@ -29,6 +29,7 @@ Test that the $SHLINKCOMSTR construction variable allows you to customize the displayed linker string for programs using shared libraries. """ +import sys import TestSCons _python_ = TestSCons._python_ @@ -90,24 +91,24 @@ Linking shared test3.dll from test1.obj test2.obj test.must_match('test3.dll', "test1.c\ntest2.c\n") - -# Now test an actual compile and link. Since MS Windows -# resets the link actions, this could fail even if the above -# test passed. -test.write('SConstruct', """ -env = Environment(CXXCOMSTR = 'Compiling $TARGET ...', - SHLINKCOMSTR = 'Shared-Linking $TARGET ...') -env.SharedLibrary('test', 'test.cpp') -""") -test.write('test.cpp', """ -int i; -""") - -test.run() -if ("Shared-Linking" not in test.stdout()): - test.fail_test() - - +if sys.platform == "win32": + import SCons.Tool.MSCommon as msc + if msc.msvc_exists(): + # Now test an actual compile and link. Since MS Windows + # resets the link actions, this could fail even if the above + # test passed. + test.write('SConstruct', """ + env = Environment(CXXCOMSTR = 'Compiling $TARGET ...', + SHLINKCOMSTR = 'Shared-Linking $TARGET ...') + env.SharedLibrary('test', 'test.cpp') + """) + test.write('test.cpp', """ + int i; + """) + + test.run() + if ("Shared-Linking" not in test.stdout()): + test.fail_test() test.pass_test() |