summaryrefslogtreecommitdiffstats
path: root/test/MinGW
diff options
context:
space:
mode:
authorWilliam Blevins <wblevins001@gmail.com>2016-10-03 06:08:04 (GMT)
committerWilliam Blevins <wblevins001@gmail.com>2016-10-03 06:08:04 (GMT)
commit5587089a661a520a32c353ea886939cd63a0636a (patch)
tree22bf17e710505ff6f6bcf5cc4aa7badfc958d5f2 /test/MinGW
parent6dd3fd8b838d18d65edd6e7adabf3a363437f8a9 (diff)
downloadSCons-5587089a661a520a32c353ea886939cd63a0636a.zip
SCons-5587089a661a520a32c353ea886939cd63a0636a.tar.gz
SCons-5587089a661a520a32c353ea886939cd63a0636a.tar.bz2
Moved common my<xxx>.py functions to global fixture and resolve byte/str.
Diffstat (limited to 'test/MinGW')
-rw-r--r--test/MinGW/RCCOM.py14
-rw-r--r--test/MinGW/RCCOMSTR.py14
2 files changed, 4 insertions, 24 deletions
diff --git a/test/MinGW/RCCOM.py b/test/MinGW/RCCOM.py
index dadfea5..a4d9147 100644
--- a/test/MinGW/RCCOM.py
+++ b/test/MinGW/RCCOM.py
@@ -39,19 +39,11 @@ test = TestSCons.TestSCons()
if sys.platform in ('irix6',):
test.skip_test("Skipping mingw test on non-Windows %s platform."%sys.platform)
-test.write('myrc.py', """
-import sys
-outfile = open(sys.argv[1], 'wb')
-for f in sys.argv[2:]:
- infile = open(f, 'rb')
- for l in [l for l in infile.readlines() if l != '/*rc*/\\n']:
- outfile.write(l)
-sys.exit(0)
-""")
+test.file_fixture('mycompile.py')
test.write('SConstruct', """
env = Environment(tools=['default', 'mingw'],
- RCCOM = r'%(_python_)s myrc.py $TARGET $SOURCES')
+ RCCOM = r'%(_python_)s mycompile.py rc $TARGET $SOURCES')
env.RES(target = 'aaa', source = 'aaa.rc')
""" % locals())
@@ -61,8 +53,6 @@ test.run(arguments = ".")
test.must_match('aaa.o', "aaa.rc\n")
-
-
test.pass_test()
# Local Variables:
diff --git a/test/MinGW/RCCOMSTR.py b/test/MinGW/RCCOMSTR.py
index 501a57d..0ed84c2 100644
--- a/test/MinGW/RCCOMSTR.py
+++ b/test/MinGW/RCCOMSTR.py
@@ -39,19 +39,11 @@ test = TestSCons.TestSCons()
if sys.platform in ('irix6',):
test.skip_test("Skipping mingw test on non-Windows %s platform."%sys.platform)
-test.write('myrc.py', """
-import sys
-outfile = open(sys.argv[1], 'wb')
-for f in sys.argv[2:]:
- infile = open(f, 'rb')
- for l in [l for l in infile.readlines() if l != '/*rc*/\\n']:
- outfile.write(l)
-sys.exit(0)
-""")
+test.file_fixture('mycompile.py')
test.write('SConstruct', """
env = Environment(tools=['default', 'mingw'],
- RCCOM = r'%(_python_)s myrc.py $TARGET $SOURCES',
+ RCCOM = r'%(_python_)s mycompile.py rc $TARGET $SOURCES',
RCCOMSTR = 'RCing $TARGET from $SOURCE')
env.RES(target = 'aaa', source = 'aaa.rc')
""" % locals())
@@ -64,8 +56,6 @@ RCing aaa.o from aaa.rc
test.must_match('aaa.o', "aaa.rc\n")
-
-
test.pass_test()
# Local Variables: