summaryrefslogtreecommitdiffstats
path: root/test/CXX
diff options
context:
space:
mode:
Diffstat (limited to 'test/CXX')
-rw-r--r--test/CXX/CXX.py18
-rw-r--r--test/CXX/CXXCOM.py4
-rw-r--r--test/CXX/CXXCOMSTR.py4
-rw-r--r--test/CXX/CXXFILESUFFIX.py6
-rw-r--r--test/CXX/SHCXX.py6
-rw-r--r--test/CXX/SHCXXCOM.py4
-rw-r--r--test/CXX/SHCXXCOMSTR.py4
-rw-r--r--test/CXX/SHCXXFLAGS.py15
8 files changed, 29 insertions, 32 deletions
diff --git a/test/CXX/CXX.py b/test/CXX/CXX.py
index 70a9b82..a1b4c2a 100644
--- a/test/CXX/CXX.py
+++ b/test/CXX/CXX.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
_exe = TestSCons._exe
test = TestSCons.TestSCons()
@@ -107,16 +107,16 @@ sys.exit(0)
""")
test.write('SConstruct', """
-env = Environment(LINK = r'%s mylink.py',
+env = Environment(LINK = r'%(_python_)s mylink.py',
LINKFLAGS = [],
- CXX = r'%s myc++.py',
+ CXX = r'%(_python_)s myc++.py',
CXXFLAGS = [])
env.Program(target = 'test1', source = 'test1.cc')
env.Program(target = 'test2', source = 'test2.cpp')
env.Program(target = 'test3', source = 'test3.cxx')
env.Program(target = 'test4', source = 'test4.c++')
env.Program(target = 'test5', source = 'test5.C++')
-""" % (python, python))
+""" % locals())
test.write('test1.cc', r"""This is a .cc file.
/*c++*/
@@ -158,12 +158,12 @@ test.must_match('test5' + _exe, "This is a .C++ file.\n")
if TestSCons.case_sensitive_suffixes('.c', '.C'):
test.write('SConstruct', """
-env = Environment(LINK = r'%s mylink.py',
+env = Environment(LINK = r'%(_python_)s mylink.py',
LINKFLAGS = [],
- CXX = r'%s myc++.py',
+ CXX = r'%(_python_)s myc++.py',
CXXFLAGS = [])
env.Program(target = 'test6', source = 'test6.C')
-""" % (python, python))
+""" % locals())
test.write('test6.C', r"""This is a .C file.
/*c++*/
@@ -188,10 +188,10 @@ os.system(string.join(sys.argv[1:], " "))
test.write('SConstruct', """
foo = Environment()
cxx = foo.Dictionary('CXX')
-bar = Environment(CXX = r'%s wrapper.py ' + cxx)
+bar = Environment(CXX = r'%(_python_)s wrapper.py ' + cxx)
foo.Program(target = 'foo', source = 'foo.cxx')
bar.Program(target = 'bar', source = 'bar.cxx')
-""" % python)
+""" % locals())
test.write('foo.cxx', r"""
#include <stdio.h>
diff --git a/test/CXX/CXXCOM.py b/test/CXX/CXXCOM.py
index c4c419d..c98fb8c 100644
--- a/test/CXX/CXXCOM.py
+++ b/test/CXX/CXXCOM.py
@@ -33,7 +33,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
_exe = TestSCons._exe
test = TestSCons.TestSCons()
@@ -55,7 +55,7 @@ else:
alt_cpp_suffix = '.C'
test.write('SConstruct', """
-env = Environment(CXXCOM = r'%(python)s mycc.py $TARGET $SOURCE',
+env = Environment(CXXCOM = r'%(_python_)s mycc.py $TARGET $SOURCE',
OBJSUFFIX='.obj')
env.Object(target = 'test1', source = 'test1.cpp')
env.Object(target = 'test2', source = 'test2.cc')
diff --git a/test/CXX/CXXCOMSTR.py b/test/CXX/CXXCOMSTR.py
index 82f7ace..23bd3e6 100644
--- a/test/CXX/CXXCOMSTR.py
+++ b/test/CXX/CXXCOMSTR.py
@@ -34,7 +34,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
_exe = TestSCons._exe
test = TestSCons.TestSCons()
@@ -56,7 +56,7 @@ else:
alt_cpp_suffix = '.C'
test.write('SConstruct', """
-env = Environment(CXXCOM = r'%(python)s mycc.py $TARGET $SOURCE',
+env = Environment(CXXCOM = r'%(_python_)s mycc.py $TARGET $SOURCE',
CXXCOMSTR = 'Building $TARGET from $SOURCE',
OBJSUFFIX='.obj')
env.Object(target = 'test1', source = 'test1.cpp')
diff --git a/test/CXX/CXXFILESUFFIX.py b/test/CXX/CXXFILESUFFIX.py
index 8f4c4fa..62e8cc1 100644
--- a/test/CXX/CXXFILESUFFIX.py
+++ b/test/CXX/CXXFILESUFFIX.py
@@ -30,7 +30,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
test = TestSCons.TestSCons()
@@ -46,10 +46,10 @@ sys.exit(0)
""")
test.write('SConstruct', """
-env = Environment(LEX = r'%s mylex.py', tools = ['lex'])
+env = Environment(LEX = r'%(_python_)s mylex.py', tools = ['lex'])
env.CXXFile(target = 'foo', source = 'foo.ll')
env.Copy(CXXFILESUFFIX = '.xyz').CXXFile(target = 'bar', source = 'bar.ll')
-""" % python)
+""" % locals())
input = r"""
int
diff --git a/test/CXX/SHCXX.py b/test/CXX/SHCXX.py
index 5c050d1..c02086b 100644
--- a/test/CXX/SHCXX.py
+++ b/test/CXX/SHCXX.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
test = TestSCons.TestSCons()
@@ -44,10 +44,10 @@ os.system(string.join(sys.argv[1:], " "))
test.write('SConstruct', """
foo = Environment()
shcxx = foo.Dictionary('SHCXX')
-bar = Environment(SHCXX = r'%s wrapper.py ' + shcxx)
+bar = Environment(SHCXX = r'%(_python_)s wrapper.py ' + shcxx)
foo.SharedObject(target = 'foo/foo', source = 'foo.cpp')
bar.SharedObject(target = 'bar/bar', source = 'bar.cpp')
-""" % python)
+""" % locals())
test.write('foo.cpp', r"""
#include <stdio.h>
diff --git a/test/CXX/SHCXXCOM.py b/test/CXX/SHCXXCOM.py
index 54ef0d5..600049e 100644
--- a/test/CXX/SHCXXCOM.py
+++ b/test/CXX/SHCXXCOM.py
@@ -33,7 +33,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
_exe = TestSCons._exe
test = TestSCons.TestSCons()
@@ -55,7 +55,7 @@ else:
alt_cpp_suffix = '.C'
test.write('SConstruct', """
-env = Environment(SHCXXCOM = r'%(python)s mycc.py $TARGET $SOURCE',
+env = Environment(SHCXXCOM = r'%(_python_)s mycc.py $TARGET $SOURCE',
SHOBJSUFFIX='.obj')
env.SharedObject(target = 'test1', source = 'test1.cpp')
env.SharedObject(target = 'test2', source = 'test2.cc')
diff --git a/test/CXX/SHCXXCOMSTR.py b/test/CXX/SHCXXCOMSTR.py
index ad3a907..33beae7 100644
--- a/test/CXX/SHCXXCOMSTR.py
+++ b/test/CXX/SHCXXCOMSTR.py
@@ -34,7 +34,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
_exe = TestSCons._exe
test = TestSCons.TestSCons()
@@ -56,7 +56,7 @@ else:
alt_cpp_suffix = '.C'
test.write('SConstruct', """
-env = Environment(SHCXXCOM = r'%(python)s mycc.py $TARGET $SOURCE',
+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.cpp')
diff --git a/test/CXX/SHCXXFLAGS.py b/test/CXX/SHCXXFLAGS.py
index 88da443..049835c 100644
--- a/test/CXX/SHCXXFLAGS.py
+++ b/test/CXX/SHCXXFLAGS.py
@@ -29,15 +29,8 @@ import TestSCons
import os
import string
-if sys.platform == 'win32':
- _obj = '.obj'
- fooflags = '/nologo -DFOO'
- barflags = '/nologo -DBAR'
-else:
- _obj = '.o'
- fooflags = '-DFOO'
- barflags = '-DBAR'
-
+_obj = TestSCons._obj
+
if os.name == 'posix':
os.environ['LD_LIBRARY_PATH'] = '.'
if string.find(sys.platform, 'irix') > -1:
@@ -45,6 +38,10 @@ if string.find(sys.platform, 'irix') > -1:
test = TestSCons.TestSCons()
+e = test.Environment()
+fooflags = e['SHCXXFLAGS'] + ' -DFOO'
+barflags = e['SHCXXFLAGS'] + ' -DBAR'
+
test.write('SConstruct', """
foo = Environment(SHCXXFLAGS = '%s', WINDOWS_INSERT_DEF=1)
bar = Environment(SHCXXFLAGS = '%s', WINDOWS_INSERT_DEF=1)