summaryrefslogtreecommitdiffstats
path: root/test/SWIG/noproxy.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/SWIG/noproxy.py')
-rw-r--r--test/SWIG/noproxy.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/test/SWIG/noproxy.py b/test/SWIG/noproxy.py
index 0d109b8..1aaeb08 100644
--- a/test/SWIG/noproxy.py
+++ b/test/SWIG/noproxy.py
@@ -29,6 +29,7 @@ Verify that SCons realizes the -noproxy option means no .py file will
be created.
"""
+import os
import sys
import TestSCons
@@ -43,19 +44,18 @@ else:
test = TestSCons.TestSCons()
swig = test.where_is('swig')
-
if not swig:
test.skip_test('Can not find installed "swig", skipping test.\n')
-_python_ = test.get_quoted_platform_python()
+python, python_include, python_libpath, python_lib = \
+ test.get_platform_python_info()
+Python_h = os.path.join(python_include, 'Python.h')
+if not os.path.exists(Python_h):
+ test.skip_test('Can not find %s, skipping test.\n' % Python_h)
# handle testing on other platforms:
ldmodule_prefix = '_'
-python_include_dir = test.get_python_inc()
-
-python_frameworks_flags = test.get_python_frameworks_flags()
-
test.write("dependency.i", """\
%module dependency
""")
@@ -68,14 +68,16 @@ test.write("dependent.i", """\
test.write('SConstruct', """
foo = Environment(SWIGFLAGS=['-python', '-noproxy'],
- CPPPATH='%(python_include_dir)s',
+ CPPPATH=[r'%(python_include)s'],
LDMODULEPREFIX='%(ldmodule_prefix)s',
LDMODULESUFFIX='%(_dll)s',
- FRAMEWORKS='%(python_frameworks_flags)s',
+ SWIG=[r'%(swig)s'],
+ LIBPATH=[r'%(python_libpath)s'],
+ LIBS='%(python_lib)s',
)
swig = foo.Dictionary('SWIG')
-bar = foo.Clone(SWIG = r'%(_python_)s wrapper.py ' + swig)
+bar = foo.Clone(SWIG = [r'%(python)s', 'wrapper.py', swig])
foo.CFile(target = 'dependent', source = ['dependent.i'])
""" % locals())