summaryrefslogtreecommitdiffstats
path: root/test/CXX
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/CXX
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/CXX')
-rw-r--r--test/CXX/CXXCOM.py16
-rw-r--r--test/CXX/CXXCOMSTR.py14
-rw-r--r--test/CXX/SHCXXCOM.py15
-rw-r--r--test/CXX/SHCXXCOMSTR.py16
4 files changed, 8 insertions, 53 deletions
diff --git a/test/CXX/CXXCOM.py b/test/CXX/CXXCOM.py
index a3da81a..307ab13 100644
--- a/test/CXX/CXXCOM.py
+++ b/test/CXX/CXXCOM.py
@@ -31,25 +31,15 @@ Test the ability to configure the $CXXCOM construction variable.
import TestSCons
_python_ = TestSCons._python_
-_exe = TestSCons._exe
test = TestSCons.TestSCons()
-
-
-test.write('mycc.py', r"""
-import sys
-outfile = open(sys.argv[1], 'wb')
-infile = open(sys.argv[2], 'rb')
-for l in [l for l in infile.readlines() if l[:7] != '/*c++*/']:
- outfile.write(l)
-sys.exit(0)
-""")
+test.file_fixture('mycompile.py')
alt_cpp_suffix=test.get_alt_cpp_suffix()
test.write('SConstruct', """
-env = Environment(CXXCOM = r'%(_python_)s mycc.py $TARGET $SOURCE',
+env = Environment(CXXCOM = r'%(_python_)s mycompile.py c++ $TARGET $SOURCE',
OBJSUFFIX='.obj')
env.Object(target = 'test1', source = 'test1.cpp')
env.Object(target = 'test2', source = 'test2.cc')
@@ -75,8 +65,6 @@ test.must_match('test4.obj', "test4.c++\n")
test.must_match('test5.obj', "test5.C++\n")
test.must_match('test6.obj', "test6.C\n")
-
-
test.pass_test()
# Local Variables:
diff --git a/test/CXX/CXXCOMSTR.py b/test/CXX/CXXCOMSTR.py
index 9d54e91..f7494ca 100644
--- a/test/CXX/CXXCOMSTR.py
+++ b/test/CXX/CXXCOMSTR.py
@@ -32,25 +32,15 @@ the C++ compilation output.
import TestSCons
_python_ = TestSCons._python_
-_exe = TestSCons._exe
test = TestSCons.TestSCons()
-
-
-test.write('mycc.py', r"""
-import sys
-outfile = open(sys.argv[1], 'wb')
-infile = open(sys.argv[2], 'rb')
-for l in [l for l in infile.readlines() if l != '/*c++*/\n']:
- outfile.write(l)
-sys.exit(0)
-""")
+test.file_fixture('mycompile.py')
alt_cpp_suffix=test.get_alt_cpp_suffix()
test.write('SConstruct', """
-env = Environment(CXXCOM = r'%(_python_)s mycc.py $TARGET $SOURCE',
+env = Environment(CXXCOM = r'%(_python_)s mycompile.py c++ $TARGET $SOURCE',
CXXCOMSTR = 'Building $TARGET from $SOURCE',
OBJSUFFIX='.obj')
env.Object(target = 'test1', source = 'test1.cpp')
diff --git a/test/CXX/SHCXXCOM.py b/test/CXX/SHCXXCOM.py
index 7f151ed..72e247a 100644
--- a/test/CXX/SHCXXCOM.py
+++ b/test/CXX/SHCXXCOM.py
@@ -31,25 +31,15 @@ Test the ability to configure the $SHCXXCOM construction variable.
import TestSCons
_python_ = TestSCons._python_
-_exe = TestSCons._exe
test = TestSCons.TestSCons()
-
-
-test.write('mycc.py', r"""
-import sys
-outfile = open(sys.argv[1], 'wb')
-infile = open(sys.argv[2], 'rb')
-for l in [l for l in infile.readlines() if l[:7] != '/*c++*/']:
- outfile.write(l)
-sys.exit(0)
-""")
+test.file_fixture('mycompile.py')
alt_cpp_suffix=test.get_alt_cpp_suffix()
test.write('SConstruct', """
-env = Environment(SHCXXCOM = r'%(_python_)s mycc.py $TARGET $SOURCE',
+env = Environment(SHCXXCOM = r'%(_python_)s mycompile.py c++ $TARGET $SOURCE',
SHOBJPREFIX='',
SHOBJSUFFIX='.obj')
env.SharedObject(target = 'test1', source = 'test1.cpp')
@@ -76,7 +66,6 @@ test.must_match('test4.obj', "test4.c++\n")
test.must_match('test5.obj', "test5.C++\n")
test.must_match('test6.obj', "test6.C\n")
-
test.pass_test()
# Local Variables:
diff --git a/test/CXX/SHCXXCOMSTR.py b/test/CXX/SHCXXCOMSTR.py
index 716c9ad..77075e4 100644
--- a/test/CXX/SHCXXCOMSTR.py
+++ b/test/CXX/SHCXXCOMSTR.py
@@ -32,25 +32,15 @@ the shared object C++ compilation output.
import TestSCons
_python_ = TestSCons._python_
-_exe = TestSCons._exe
test = TestSCons.TestSCons()
-
-
-test.write('mycc.py', r"""
-import sys
-outfile = open(sys.argv[1], 'wb')
-infile = open(sys.argv[2], 'rb')
-for l in [l for l in infile.readlines() if l != '/*c++*/\n']:
- outfile.write(l)
-sys.exit(0)
-""")
+test.file_fixture('mycompile.py')
alt_cpp_suffix=test.get_alt_cpp_suffix()
test.write('SConstruct', """
-env = Environment(SHCXXCOM = r'%(_python_)s mycc.py $TARGET $SOURCE',
+env = Environment(SHCXXCOM = r'%(_python_)s mycompile.py c++ $TARGET $SOURCE',
SHCXXCOMSTR = 'Building shared object $TARGET from $SOURCE',
SHOBJPREFIX='', SHOBJSUFFIX='.obj')
env.SharedObject(target = 'test1', source = 'test1.cpp')
@@ -84,8 +74,6 @@ test.must_match('test4.obj', "test4.c++\n")
test.must_match('test5.obj', "test5.C++\n")
test.must_match('test6.obj', "test6.C\n")
-
-
test.pass_test()
# Local Variables: