diff options
| author | Mats Wichmann <mats@linux.com> | 2021-04-02 07:43:49 -0600 |
|---|---|---|
| committer | Mats Wichmann <mats@linux.com> | 2021-04-14 15:32:13 -0600 |
| commit | b6e861cc465680f4c1ae5ec3327504da9afd5730 (patch) | |
| tree | 48ff81509abb6be7270e6c45cf2286338043ace8 /test/Libs/SharedLibrary.py | |
| parent | a20701025fa9f7901396b7d148c5069e86e16944 (diff) | |
| download | scons-git-b6e861cc465680f4c1ae5ec3327504da9afd5730.tar.gz | |
Test tweaks to help testing on mingw-only win32 systems
On a system where SCons is started from the mingw bash shell, and
mingw Python is the interpreter, the secondary self-identification differs.
Use that in a few tests which otherwise make the wrong decision.
EnvironmentTests used an invalid value for CCFLAGS, and empty
string is a better choice.
Change a couple of cases where Python code was run directly so
it's prefixed by the-Python-in-use, which fails if there is not
a Windows-registered program for .py files - we didn't really want
to use the Windows-native Python anyway.
Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'test/Libs/SharedLibrary.py')
| -rw-r--r-- | test/Libs/SharedLibrary.py | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/test/Libs/SharedLibrary.py b/test/Libs/SharedLibrary.py index 3d2c73498..f67d70753 100644 --- a/test/Libs/SharedLibrary.py +++ b/test/Libs/SharedLibrary.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,9 +22,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os import sys @@ -33,38 +32,36 @@ test = TestSCons.TestSCons() test.write('SConstruct', """ import sys -env=Environment(WINDOWS_INSERT_DEF=1) -env2 = Environment(LIBS = [ 'foo1', 'foo2', 'foo3' ], - LIBPATH = [ '.' ]) -env.SharedLibrary(target = 'foo1', source = 'f1.c') + +env = Environment(WINDOWS_INSERT_DEF=1) +env2 = Environment(LIBS=['foo1', 'foo2', 'foo3'], LIBPATH=['.']) +env.SharedLibrary(target='foo1', source='f1.c') if sys.platform == 'win32': - env.StaticLibrary(target = 'foo1-static', source = 'f1.c') + env.StaticLibrary(target='foo1-static', source='f1.c') else: - env.StaticLibrary(target = 'foo1', source = 'f1.c') -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'], no_import_lib = 1) -env2.Program(target = 'prog', source = 'prog.c') + env.StaticLibrary(target='foo1', source='f1.c') +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'], no_import_lib=1) +env2.Program(target='prog', source='prog.c') """) test.write('SConstructFoo', """ -env=Environment() +env = Environment() obj = env.Object('foo', 'foo.c') -Default(env.SharedLibrary(target = 'foo', source = obj)) +Default(env.SharedLibrary(target='foo', source=obj)) """) test.write('SConstructFoo2', """ -env=Environment() +env = Environment() obj = env.SharedObject('bar', 'foo.c') -Default(env.Library(target = 'foo', source = obj)) +Default(env.Library(target='foo', source=obj)) """) test.write('SConstructBaz', """ -env=Environment() +env = Environment() env['SHLIBVERSION'] = '1.0.0' obj = env.SharedObject('baz', 'foo.c') -Default(env.SharedLibrary(target = 'baz', source = obj)) +Default(env.SharedLibrary(target='baz', source=obj)) """) test.write('foo.c', r""" @@ -252,7 +249,7 @@ env2.Program(target = 'progbar', source = 'progbar.c') test.write('f4.c', r""" #include <stdio.h> -f4(void) +void f4(void) { printf("f4.c\n"); fflush(stdout); |
