summaryrefslogtreecommitdiffstats
path: root/test/SWIG/generated_swigfile.py
diff options
context:
space:
mode:
authorGary Oberbrunner <garyo@oberbrunner.com>2014-08-21 01:52:38 (GMT)
committerGary Oberbrunner <garyo@oberbrunner.com>2014-08-21 01:52:38 (GMT)
commit678c769bc6189b5b7c301fbecfb37496725f6aee (patch)
tree0b0b37051a29dd48d2fb9c9c49a11182a276a0d9 /test/SWIG/generated_swigfile.py
parenta035c43fb34cc888fca250f26f68fc2b03c018ac (diff)
downloadSCons-678c769bc6189b5b7c301fbecfb37496725f6aee.zip
SCons-678c769bc6189b5b7c301fbecfb37496725f6aee.tar.gz
SCons-678c769bc6189b5b7c301fbecfb37496725f6aee.tar.bz2
SWIG: improve tool detection, and update SWIG tests to run on Windows.
The tool detection is improved by checking for swig in env['SWIG'], where it is commonly set, as well as env['ENV']['PATH']. The tests mostly didn't work on Windows. I updated them all. Mostly to build 32-bit extensions when using 32-bit python on Windows, and use .pyd as the python extension on Windows.
Diffstat (limited to 'test/SWIG/generated_swigfile.py')
-rw-r--r--test/SWIG/generated_swigfile.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/SWIG/generated_swigfile.py b/test/SWIG/generated_swigfile.py
index 1187df2..d09b473 100644
--- a/test/SWIG/generated_swigfile.py
+++ b/test/SWIG/generated_swigfile.py
@@ -39,14 +39,14 @@ import TestSCons
if sys.platform == 'win32':
_dll = '.dll'
else:
- _dll = '.so'
+ _dll = '.so'
# swig-python expects specific filenames.
# the platform specific suffix won't necessarily work.
if sys.platform == 'win32':
_dll = '.dll'
else:
- _dll = '.so'
+ _dll = '.so'
test = TestSCons.TestSCons()
@@ -69,17 +69,17 @@ foo = Environment(CPPPATH=[r'%(python_include)s'],
SWIG=[r'%(swig)s'],
LIBPATH=[r'%(python_libpath)s'],
)
-python_interface = foo.Command( 'test_py_swig.i', Value(1), "echo '%%module test_py_swig' > test_py_swig.i" )
+python_interface = foo.Command( 'test_py_swig.i', Value(1), 'echo %%module test_py_swig > test_py_swig.i' )
python_c_file = foo.CFile( target='python_swig_test',source=python_interface, SWIGFLAGS = '-python -c++' )
-java_interface = foo.Command( 'test_java_swig.i', Value(1),"echo '%%module test_java_swig' > test_java_swig.i" )
-java_c_file = foo.CFile( target='java_swig_test' ,source=java_interface, SWIGFLAGS = '-java -c++' )
+java_interface = foo.Command( 'test_java_swig.i', Value(1),'echo %%module test_java_swig > test_java_swig.i' )
+java_c_file = foo.CFile( target='java_swig_test' ,source=java_interface, SWIGFLAGS = '-java -c++' )
""" % locals())
expected_stdout = """\
-echo '%%module test_java_swig' > test_java_swig.i
+echo %%module test_java_swig > test_java_swig.i
%(swig)s -o java_swig_test_wrap.cc -java -c++ test_java_swig.i
-echo '%%module test_py_swig' > test_py_swig.i
+echo %%module test_py_swig > test_py_swig.i
%(swig)s -o python_swig_test_wrap.cc -python -c++ test_py_swig.i
""" % locals()
test.run(arguments = '.',stdout=test.wrap_stdout(expected_stdout))