diff options
author | Steven Knight <knight@baldmt.com> | 2004-11-21 00:41:12 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2004-11-21 00:41:12 (GMT) |
commit | 9121165c1f6de68d4c2e8701083de04dfcf2ddc3 (patch) | |
tree | 9c21395a4d49fd3aba7a22fe8e93b041445b00b3 /test/CXX | |
parent | ac44b9e4c5ba049e38fc0609670322faa6503443 (diff) | |
download | SCons-9121165c1f6de68d4c2e8701083de04dfcf2ddc3.zip SCons-9121165c1f6de68d4c2e8701083de04dfcf2ddc3.tar.gz SCons-9121165c1f6de68d4c2e8701083de04dfcf2ddc3.tar.bz2 |
Miscellaneous fixes: portability and version fixes, missing , better CXXCOM tests, ATL include directories, intelc Tool import.
Diffstat (limited to 'test/CXX')
-rw-r--r-- | test/CXX/CXXCOM.py | 35 | ||||
-rw-r--r-- | test/CXX/CXXCOMSTR.py | 45 | ||||
-rw-r--r-- | test/CXX/SHCXXCOM.py | 36 | ||||
-rw-r--r-- | test/CXX/SHCXXCOMSTR.py | 45 |
4 files changed, 94 insertions, 67 deletions
diff --git a/test/CXX/CXXCOM.py b/test/CXX/CXXCOM.py index 4641473..c4c419d 100644 --- a/test/CXX/CXXCOM.py +++ b/test/CXX/CXXCOM.py @@ -50,31 +50,36 @@ sys.exit(0) """) if os.path.normcase('.c') == os.path.normcase('.C'): - alt_cc_suffix = '.CC' + alt_cpp_suffix = '.cpp' else: - alt_cc_suffix = '.cc' + alt_cpp_suffix = '.C' test.write('SConstruct', """ env = Environment(CXXCOM = r'%(python)s mycc.py $TARGET $SOURCE', OBJSUFFIX='.obj') -env.Object(target = 'test1', source = 'test1.cc') -env.Object(target = 'test2', source = 'test2%(alt_cc_suffix)s') +env.Object(target = 'test1', source = 'test1.cpp') +env.Object(target = 'test2', source = 'test2.cc') +env.Object(target = 'test3', source = 'test3.cxx') +env.Object(target = 'test4', source = 'test4.c++') +env.Object(target = 'test5', source = 'test5.C++') +env.Object(target = 'test6', source = 'test6%(alt_cpp_suffix)s') """ % locals()) -test.write('test1.cc', """\ -test1.cc -/*c++*/ -""") - -test.write('test2'+alt_cc_suffix, """\ -test2.CC -/*c++*/ -""") +test.write('test1.cpp', "test1.cpp\n/*c++*/\n") +test.write('test2.cc', "test2.cc\n/*c++*/\n") +test.write('test3.cxx', "test3.cxx\n/*c++*/\n") +test.write('test4.c++', "test4.c++\n/*c++*/\n") +test.write('test5.C++', "test5.C++\n/*c++*/\n") +test.write('test6'+alt_cpp_suffix, "test6.C\n/*c++*/\n") test.run() -test.must_match('test1.obj', "test1.cc\n") -test.must_match('test2.obj', "test2.CC\n") +test.must_match('test1.obj', "test1.cpp\n") +test.must_match('test2.obj', "test2.cc\n") +test.must_match('test3.obj', "test3.cxx\n") +test.must_match('test4.obj', "test4.c++\n") +test.must_match('test5.obj', "test5.C++\n") +test.must_match('test6.obj', "test6.C\n") diff --git a/test/CXX/CXXCOMSTR.py b/test/CXX/CXXCOMSTR.py index 0a2dce6..82f7ace 100644 --- a/test/CXX/CXXCOMSTR.py +++ b/test/CXX/CXXCOMSTR.py @@ -45,41 +45,50 @@ test.write('mycc.py', r""" import sys outfile = open(sys.argv[1], 'wb') infile = open(sys.argv[2], 'rb') -for l in filter(lambda l: l[:6] != '/*cc*/', infile.readlines()): +for l in filter(lambda l: l != '/*c++*/\n', infile.readlines()): outfile.write(l) sys.exit(0) """) if os.path.normcase('.c') == os.path.normcase('.C'): - alt_cc_suffix = '.CC' + alt_cpp_suffix = '.cpp' else: - alt_cc_suffix = '.cc' + alt_cpp_suffix = '.C' test.write('SConstruct', """ env = Environment(CXXCOM = r'%(python)s mycc.py $TARGET $SOURCE', CXXCOMSTR = 'Building $TARGET from $SOURCE', OBJSUFFIX='.obj') -env.Object(target = 'test1', source = 'test1.cc') -env.Object(target = 'test2', source = 'test2%(alt_cc_suffix)s') +env.Object(target = 'test1', source = 'test1.cpp') +env.Object(target = 'test2', source = 'test2.cc') +env.Object(target = 'test3', source = 'test3.cxx') +env.Object(target = 'test4', source = 'test4.c++') +env.Object(target = 'test5', source = 'test5.C++') +env.Object(target = 'test6', source = 'test6%(alt_cpp_suffix)s') """ % locals()) -test.write('test1.cc', """\ -test1.cc -/*cc*/ -""") - -test.write('test2'+alt_cc_suffix, """\ -test2.CC -/*cc*/ -""") +test.write('test1.cpp', "test1.cpp\n/*c++*/\n") +test.write('test2.cc', "test2.cc\n/*c++*/\n") +test.write('test3.cxx', "test3.cxx\n/*c++*/\n") +test.write('test4.c++', "test4.c++\n/*c++*/\n") +test.write('test5.C++', "test5.C++\n/*c++*/\n") +test.write('test6'+alt_cpp_suffix, "test6.C\n/*c++*/\n") test.run(stdout = test.wrap_stdout("""\ -Building test1.obj from test1.cc -Building test2.obj from test2%(alt_cc_suffix)s +Building test1.obj from test1.cpp +Building test2.obj from test2.cc +Building test3.obj from test3.cxx +Building test4.obj from test4.c++ +Building test5.obj from test5.C++ +Building test6.obj from test6%(alt_cpp_suffix)s """ % locals())) -test.must_match('test1.obj', "test1.cc\n") -test.must_match('test2.obj', "test2.CC\n") +test.must_match('test1.obj', "test1.cpp\n") +test.must_match('test2.obj', "test2.cc\n") +test.must_match('test3.obj', "test3.cxx\n") +test.must_match('test4.obj', "test4.c++\n") +test.must_match('test5.obj', "test5.C++\n") +test.must_match('test6.obj', "test6.C\n") diff --git a/test/CXX/SHCXXCOM.py b/test/CXX/SHCXXCOM.py index 1a38d71..54ef0d5 100644 --- a/test/CXX/SHCXXCOM.py +++ b/test/CXX/SHCXXCOM.py @@ -50,32 +50,36 @@ sys.exit(0) """) if os.path.normcase('.c') == os.path.normcase('.C'): - alt_cc_suffix = '.CC' + alt_cpp_suffix = '.cpp' else: - alt_cc_suffix = '.cc' + alt_cpp_suffix = '.C' test.write('SConstruct', """ env = Environment(SHCXXCOM = r'%(python)s mycc.py $TARGET $SOURCE', SHOBJSUFFIX='.obj') -env.SharedObject(target = 'test1', source = 'test1.cc') -env.SharedObject(target = 'test2', source = 'test2%(alt_cc_suffix)s') +env.SharedObject(target = 'test1', source = 'test1.cpp') +env.SharedObject(target = 'test2', source = 'test2.cc') +env.SharedObject(target = 'test3', source = 'test3.cxx') +env.SharedObject(target = 'test4', source = 'test4.c++') +env.SharedObject(target = 'test5', source = 'test5.C++') +env.SharedObject(target = 'test6', source = 'test6%(alt_cpp_suffix)s') """ % locals()) -test.write('test1.cc', """\ -test1.cc -/*c++*/ -""") - -test.write('test2'+alt_cc_suffix, """\ -test2.CC -/*c++*/ -""") +test.write('test1.cpp', "test1.cpp\n/*c++*/\n") +test.write('test2.cc', "test2.cc\n/*c++*/\n") +test.write('test3.cxx', "test3.cxx\n/*c++*/\n") +test.write('test4.c++', "test4.c++\n/*c++*/\n") +test.write('test5.C++', "test5.C++\n/*c++*/\n") +test.write('test6'+alt_cpp_suffix, "test6.C\n/*c++*/\n") test.run() -test.must_match('test1.obj', "test1.cc\n") -test.must_match('test2.obj', "test2.CC\n") - +test.must_match('test1.obj', "test1.cpp\n") +test.must_match('test2.obj', "test2.cc\n") +test.must_match('test3.obj', "test3.cxx\n") +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() diff --git a/test/CXX/SHCXXCOMSTR.py b/test/CXX/SHCXXCOMSTR.py index 2c43393..ad3a907 100644 --- a/test/CXX/SHCXXCOMSTR.py +++ b/test/CXX/SHCXXCOMSTR.py @@ -45,41 +45,50 @@ test.write('mycc.py', r""" import sys outfile = open(sys.argv[1], 'wb') infile = open(sys.argv[2], 'rb') -for l in filter(lambda l: l[:6] != '/*cc*/', infile.readlines()): +for l in filter(lambda l: l != '/*c++*/\n', infile.readlines()): outfile.write(l) sys.exit(0) """) if os.path.normcase('.c') == os.path.normcase('.C'): - alt_cc_suffix = '.CC' + alt_cpp_suffix = '.cpp' else: - alt_cc_suffix = '.cc' + alt_cpp_suffix = '.C' test.write('SConstruct', """ env = Environment(SHCXXCOM = r'%(python)s mycc.py $TARGET $SOURCE', SHCXXCOMSTR = 'Building shared object $TARGET from $SOURCE', SHOBJSUFFIX='.obj') -env.SharedObject(target = 'test1', source = 'test1.cc') -env.SharedObject(target = 'test2', source = 'test2%(alt_cc_suffix)s') +env.SharedObject(target = 'test1', source = 'test1.cpp') +env.SharedObject(target = 'test2', source = 'test2.cc') +env.SharedObject(target = 'test3', source = 'test3.cxx') +env.SharedObject(target = 'test4', source = 'test4.c++') +env.SharedObject(target = 'test5', source = 'test5.C++') +env.SharedObject(target = 'test6', source = 'test6%(alt_cpp_suffix)s') """ % locals()) -test.write('test1.cc', """\ -test1.cc -/*cc*/ -""") - -test.write('test2'+alt_cc_suffix, """\ -test2.CC -/*cc*/ -""") +test.write('test1.cpp', "test1.cpp\n/*c++*/\n") +test.write('test2.cc', "test2.cc\n/*c++*/\n") +test.write('test3.cxx', "test3.cxx\n/*c++*/\n") +test.write('test4.c++', "test4.c++\n/*c++*/\n") +test.write('test5.C++', "test5.C++\n/*c++*/\n") +test.write('test6'+alt_cpp_suffix, "test6.C\n/*c++*/\n") test.run(stdout = test.wrap_stdout("""\ -Building shared object test1.obj from test1.cc -Building shared object test2.obj from test2%(alt_cc_suffix)s +Building shared object test1.obj from test1.cpp +Building shared object test2.obj from test2.cc +Building shared object test3.obj from test3.cxx +Building shared object test4.obj from test4.c++ +Building shared object test5.obj from test5.C++ +Building shared object test6.obj from test6%(alt_cpp_suffix)s """ % locals())) -test.must_match('test1.obj', "test1.cc\n") -test.must_match('test2.obj', "test2.CC\n") +test.must_match('test1.obj', "test1.cpp\n") +test.must_match('test2.obj', "test2.cc\n") +test.must_match('test3.obj', "test3.cxx\n") +test.must_match('test4.obj', "test4.c++\n") +test.must_match('test5.obj', "test5.C++\n") +test.must_match('test6.obj', "test6.C\n") |