summaryrefslogtreecommitdiffstats
path: root/test/MinGW
diff options
context:
space:
mode:
Diffstat (limited to 'test/MinGW')
-rw-r--r--test/MinGW/MinGWSharedLibrary.py16
-rw-r--r--test/MinGW/RCCOM.py20
-rw-r--r--test/MinGW/RCCOMSTR.py21
-rw-r--r--test/MinGW/WINDOWS_INSERT_DEF.py21
-rw-r--r--test/MinGW/bug_2799/SConstruct16
-rw-r--r--test/MinGW/mingw_uses_comstr_issue_2799.py21
6 files changed, 61 insertions, 54 deletions
diff --git a/test/MinGW/MinGWSharedLibrary.py b/test/MinGW/MinGWSharedLibrary.py
index 9ce4eb3..9fac820 100644
--- a/test/MinGW/MinGWSharedLibrary.py
+++ b/test/MinGW/MinGWSharedLibrary.py
@@ -41,30 +41,28 @@ _python_ = TestSCons._python_
test = TestSCons.TestSCons()
-if sys.platform not in ('cygwin','win32',):
- test.skip_test("Skipping mingw test on non-Windows %s platform."%sys.platform)
+if sys.platform not in ('cygwin', 'win32',):
+ test.skip_test("Skipping mingw test on non-Windows platform %s." % sys.platform)
-gcc = SCons.Tool.find_program_path(test.Environment(), 'gcc', default_paths=MINGW_DEFAULT_PATHS + CYGWIN_DEFAULT_PATHS )
+dp = MINGW_DEFAULT_PATHS
+gcc = SCons.Tool.find_program_path(test.Environment(), 'gcc', default_paths=dp)
if not gcc:
test.skip_test("Skipping mingw test, no MinGW found.\n")
test.write('foobar.cc', """
int abc(int a) {
return (a+1);
- }
- """)
+}
+""")
test.write('SConstruct', """
DefaultEnvironment(tools=[])
-env = Environment(tools=['mingw','link','g++'])
-#env.Tool('mingw')
+env = Environment(tools=['mingw', 'link', 'g++'])
foobar_obj = env.SharedObject('foobar.cc')
env.SharedLibrary('foobar', foobar_obj)
# Now verify versioned shared library doesn't fail
env.SharedLibrary('foobar_ver', foobar_obj, SHLIBVERSION='2.4')
-
-
""" % locals())
test.run(arguments = ".")
diff --git a/test/MinGW/RCCOM.py b/test/MinGW/RCCOM.py
index a4d9147..ffd58c8 100644
--- a/test/MinGW/RCCOM.py
+++ b/test/MinGW/RCCOM.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,13 +22,10 @@
# 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__"
"""
Test the ability to configure the $RCCOM construction variable
-when using MinGW.
+when using MinGW. This test does not use a compiler.
"""
import sys
@@ -37,14 +36,17 @@ _python_ = TestSCons._python_
test = TestSCons.TestSCons()
if sys.platform in ('irix6',):
- test.skip_test("Skipping mingw test on non-Windows %s platform."%sys.platform)
+ test.skip_test("Skipping mingw test on non-Windows platform %s." % sys.platform)
test.file_fixture('mycompile.py')
test.write('SConstruct', """
-env = Environment(tools=['default', 'mingw'],
- RCCOM = r'%(_python_)s mycompile.py rc $TARGET $SOURCES')
-env.RES(target = 'aaa', source = 'aaa.rc')
+DefaultEnvironment(tools=[])
+env = Environment(
+ tools=['default', 'mingw'],
+ RCCOM=r'%(_python_)s mycompile.py rc $TARGET $SOURCES',
+)
+env.RES(target='aaa', source='aaa.rc')
""" % locals())
test.write('aaa.rc', "aaa.rc\n/*rc*/\n")
diff --git a/test/MinGW/RCCOMSTR.py b/test/MinGW/RCCOMSTR.py
index 0ed84c2..e661577 100644
--- a/test/MinGW/RCCOMSTR.py
+++ b/test/MinGW/RCCOMSTR.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,13 +22,11 @@
# 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__"
"""
Test that the $RCCOMSTR construction variable allows you to customize
-the displayed string when rc is called.
+the displayed string when rc is called when using MinGW.
+This test does not use a compiler.
"""
import sys
@@ -42,10 +42,13 @@ if sys.platform in ('irix6',):
test.file_fixture('mycompile.py')
test.write('SConstruct', """
-env = Environment(tools=['default', 'mingw'],
- RCCOM = r'%(_python_)s mycompile.py rc $TARGET $SOURCES',
- RCCOMSTR = 'RCing $TARGET from $SOURCE')
-env.RES(target = 'aaa', source = 'aaa.rc')
+DefaultEnvironment(tools=[])
+env = Environment(
+ tools=['default', 'mingw'],
+ RCCOM=r'%(_python_)s mycompile.py rc $TARGET $SOURCES',
+ RCCOMSTR='RCing $TARGET from $SOURCE',
+)
+env.RES(target='aaa', source='aaa.rc')
""" % locals())
test.write('aaa.rc', "aaa.rc\n/*rc*/\n")
diff --git a/test/MinGW/WINDOWS_INSERT_DEF.py b/test/MinGW/WINDOWS_INSERT_DEF.py
index f82ebd8..5119c97 100644
--- a/test/MinGW/WINDOWS_INSERT_DEF.py
+++ b/test/MinGW/WINDOWS_INSERT_DEF.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__"
"""
Make sure that WINDOWS_INSERT_DEF isn't ignored when using MinGW.
@@ -39,11 +38,11 @@ from SCons.Platform.cygwin import CYGWIN_DEFAULT_PATHS
test = TestSCons.TestSCons()
-if sys.platform not in ('cygwin', 'win32'):
- test.skip_test(
- "Skipping mingw test on non-Windows platform: %s" % sys.platform)
+if sys.platform not in ('cygwin', 'win32',):
+ test.skip_test("Skipping mingw test on non-Windows platform %s\n" % sys.platform)
-gcc = SCons.Tool.find_program_path(test.Environment(), 'gcc', default_paths=MINGW_DEFAULT_PATHS + CYGWIN_DEFAULT_PATHS )
+dp = MINGW_DEFAULT_PATHS
+gcc = SCons.Tool.find_program_path(test.Environment(), 'gcc', default_paths=dp)
if not gcc:
test.skip_test("Skipping mingw test, no MinGW found.\n")
@@ -53,9 +52,9 @@ int hello_world(void) { return printf("Orbis, te saluto!\n"); }
""")
test.write('SConstruct', """
-env = Environment(TOOLS = ['mingw'])
-hello_dll = env.SharedLibrary(WINDOWS_INSERT_DEF = 0,
- target = 'hello', source = 'hello.c')
+DefaultEnvironment(tools=[])
+env = Environment(TOOLS=['mingw'])
+hello_dll = env.SharedLibrary(WINDOWS_INSERT_DEF=0, target='hello', source='hello.c')
""" % locals())
test.run(arguments = ".")
diff --git a/test/MinGW/bug_2799/SConstruct b/test/MinGW/bug_2799/SConstruct
index a1832f1..f22cacc 100644
--- a/test/MinGW/bug_2799/SConstruct
+++ b/test/MinGW/bug_2799/SConstruct
@@ -1,12 +1,12 @@
env = Environment(
- tools = ['mingw'],
- SHCCCOMSTR = 'SHCC $TARGET',
- SHLINKCOMSTR = 'SHLINK $TARGET',
- LDMODULECOMSTR = 'LDMODULE $TARGET',
- SHOBSUFFIX='.o',
- SHLIBSUFFIX='.so',
- SHLIBPREFIX='lib',
- LDMODULESUFFIX='.so',
+ tools=['mingw'],
+ SHCCCOMSTR='SHCC $TARGET',
+ SHLINKCOMSTR='SHLINK $TARGET',
+ LDMODULECOMSTR='LDMODULE $TARGET',
+ SHOBSUFFIX='.o',
+ SHLIBSUFFIX='.so',
+ SHLIBPREFIX='lib',
+ LDMODULESUFFIX='.so',
)
env.SharedLibrary('testlib', 'shlib.c')
diff --git a/test/MinGW/mingw_uses_comstr_issue_2799.py b/test/MinGW/mingw_uses_comstr_issue_2799.py
index fc96ad4..ae34f40 100644
--- a/test/MinGW/mingw_uses_comstr_issue_2799.py
+++ b/test/MinGW/mingw_uses_comstr_issue_2799.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
@@ -37,13 +39,16 @@ test = TestSCons.TestSCons()
test.dir_fixture('bug_2799')
test.run('-n -Q')
-test.must_contain_all_lines(test.stdout(),
- [
- 'SHCC shlib.o',
- 'SHLINK libtestlib.so',
- 'SHCC module.o',
- 'LDMODULE libtestmodule.so',''],
- )
+test.must_contain_all_lines(
+ test.stdout(),
+ [
+ 'SHCC shlib.o',
+ 'SHLINK libtestlib.so',
+ 'SHCC module.o',
+ 'LDMODULE libtestmodule.so',
+ '',
+ ],
+)
test.pass_test()