Skip to content

Commit

Permalink
Merge 50f4fe4 into e8d4f01
Browse files Browse the repository at this point in the history
  • Loading branch information
mwichmann committed Nov 26, 2018
2 parents e8d4f01 + 50f4fe4 commit 1424843
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ RELEASE 3.1.0.alpha.yyyymmdd - NEW DATE WILL BE INSERTED HERE
- Update (pep8) configure-cache script, add a --show option.
- Fix for a couple of "what if tool not found" exceptions in framework.
- Add Textfile/Substfile to default environment. (issue #3147)
- Make the clang StaticLibrary tests work on win32.

From Bernhard M. Wiedemann:
- Update SCons' internal scons build logic to allow overriding build date
Expand Down
20 changes: 17 additions & 3 deletions test/Clang/clang_static_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"

import sys

import TestSCons

_exe = TestSCons._exe
Expand All @@ -32,11 +34,23 @@
if not test.where_is('clang'):
test.skip_test("Could not find 'clang', skipping test.\n")

if sys.platform == 'win32':
foo_lib = 'foo.lib'
archiver = 'mslib'
import SCons.Tool.MSCommon as msc
if not msc.msvc_exists():
foo_lib = 'libfoo.a'
archiver = 'ar'
else:
foo_lib = 'libfoo.a'
archiver = 'ar'


test.write('SConstruct', """\
DefaultEnvironment(tools=[])
env = Environment(tools=['mingw','clang', 'ar'])
env = Environment(tools=['mingw','clang', '%s'])
env.StaticLibrary('foo', 'foo.c')
""")
""" % archiver)

test.write('foo.c', """\
int bar() {
Expand All @@ -46,7 +60,7 @@

test.run()

test.must_exist(test.workpath('libfoo.a'))
test.must_exist(test.workpath(foo_lib))

test.pass_test()

Expand Down
20 changes: 17 additions & 3 deletions test/Clang/clangxx_static_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"

import sys

import TestSCons

_exe = TestSCons._exe
Expand All @@ -32,11 +34,23 @@
if not test.where_is('clang'):
test.skip_test("Could not find 'clang++', skipping test.\n")

if sys.platform == 'win32':
foo_lib = 'foo.lib'
archiver = 'mslib'
import SCons.Tool.MSCommon as msc
if not msc.msvc_exists():
foo_lib = 'libfoo.a'
archiver = 'ar'
else:
foo_lib = 'libfoo.a'
archiver = 'ar'


test.write('SConstruct', """\
DefaultEnvironment(tools=[])
env = Environment(tools=['mingw','clang++', 'ar'])
env = Environment(tools=['mingw','clang++', '%s'])
env.StaticLibrary('foo', 'foo.cpp')
""")
""" % archiver)

test.write('foo.cpp', """\
int bar() {
Expand All @@ -46,7 +60,7 @@

test.run()

test.must_exist(test.workpath('libfoo.a'))
test.must_exist(test.workpath(foo_lib))

test.pass_test()

Expand Down

0 comments on commit 1424843

Please sign in to comment.