summaryrefslogtreecommitdiff
path: root/test/MSVC
diff options
context:
space:
mode:
authorWilliam Blevins <wblevins001@gmail.com>2016-10-03 02:08:04 -0400
committerWilliam Blevins <wblevins001@gmail.com>2016-10-03 02:08:04 -0400
commit19a22ecca5a72d9f78c0bc8672e5bbe6f11e65c8 (patch)
tree22bf17e710505ff6f6bcf5cc4aa7badfc958d5f2 /test/MSVC
parentfd8260b1ea1ec158bcabc8030d3a47eadf7c1255 (diff)
downloadscons-19a22ecca5a72d9f78c0bc8672e5bbe6f11e65c8.tar.gz
Moved common my<xxx>.py functions to global fixture and resolve byte/str.
Diffstat (limited to 'test/MSVC')
-rw-r--r--test/MSVC/PCHCOM.py16
-rw-r--r--test/MSVC/PCHCOMSTR.py16
-rw-r--r--test/MSVC/RCCOM.py16
-rw-r--r--test/MSVC/RCCOMSTR.py16
4 files changed, 8 insertions, 56 deletions
diff --git a/test/MSVC/PCHCOM.py b/test/MSVC/PCHCOM.py
index ff27e10e..fefab927 100644
--- a/test/MSVC/PCHCOM.py
+++ b/test/MSVC/PCHCOM.py
@@ -34,21 +34,11 @@ _python_ = TestSCons._python_
test = TestSCons.TestSCons()
-
-
-test.write('mypch.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 != '/*pch*/\\n']:
- outfile.write(l)
-sys.exit(0)
-""")
+test.file_fixture('mycompile.py')
test.write('SConstruct', """
env = Environment(tools=['default', 'msvc'],
- PCHCOM = r'%(_python_)s mypch.py $TARGET $SOURCES')
+ PCHCOM = r'%(_python_)s mycompile.py pch $TARGET $SOURCES')
env.PCH(target = 'aaa', source = 'aaa.h')
""" % locals())
@@ -58,8 +48,6 @@ test.run(arguments = ".")
test.must_match('aaa.pch', "aaa.h\n")
-
-
test.pass_test()
# Local Variables:
diff --git a/test/MSVC/PCHCOMSTR.py b/test/MSVC/PCHCOMSTR.py
index 51f56fb1..beea4884 100644
--- a/test/MSVC/PCHCOMSTR.py
+++ b/test/MSVC/PCHCOMSTR.py
@@ -35,21 +35,11 @@ _python_ = TestSCons._python_
test = TestSCons.TestSCons()
-
-
-test.write('mypch.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 != '/*pch*/\\n']:
- outfile.write(l)
-sys.exit(0)
-""")
+test.file_fixture('mycompile.py')
test.write('SConstruct', """
env = Environment(tools=['default', 'msvc'],
- PCHCOM = r'%(_python_)s mypch.py $TARGET $SOURCES',
+ PCHCOM = r'%(_python_)s mycompile.py pch $TARGET $SOURCES',
PCHCOMSTR = 'PCHing $TARGET from $SOURCE')
env.PCH(target = 'aaa', source = 'aaa.h')
""" % locals())
@@ -62,8 +52,6 @@ PCHing aaa.pch from aaa.h
test.must_match('aaa.pch', "aaa.h\n")
-
-
test.pass_test()
# Local Variables:
diff --git a/test/MSVC/RCCOM.py b/test/MSVC/RCCOM.py
index 05382b86..04f8fffa 100644
--- a/test/MSVC/RCCOM.py
+++ b/test/MSVC/RCCOM.py
@@ -35,21 +35,11 @@ _python_ = TestSCons._python_
test = TestSCons.TestSCons()
-
-
-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', 'msvc'],
- 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())
@@ -59,8 +49,6 @@ test.run(arguments = ".")
test.must_match('aaa.res', "aaa.rc\n")
-
-
test.pass_test()
# Local Variables:
diff --git a/test/MSVC/RCCOMSTR.py b/test/MSVC/RCCOMSTR.py
index 8425d73e..26306513 100644
--- a/test/MSVC/RCCOMSTR.py
+++ b/test/MSVC/RCCOMSTR.py
@@ -35,21 +35,11 @@ _python_ = TestSCons._python_
test = TestSCons.TestSCons()
-
-
-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', 'msvc'],
- 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())
@@ -62,8 +52,6 @@ RCing aaa.res from aaa.rc
test.must_match('aaa.res', "aaa.rc\n")
-
-
test.pass_test()
# Local Variables: