summaryrefslogtreecommitdiffstats
path: root/test/SWIG
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2006-08-06 21:02:53 (GMT)
committerSteven Knight <knight@baldmt.com>2006-08-06 21:02:53 (GMT)
commit3716798b3700dee4552d7d5858a38350439b425d (patch)
tree25c361a3215f7ed298f44e4187590fec3b7d4139 /test/SWIG
parent039cc5101ba0a3df220e7ae40e197ffd145774c2 (diff)
downloadSCons-3716798b3700dee4552d7d5858a38350439b425d.zip
SCons-3716798b3700dee4552d7d5858a38350439b425d.tar.gz
SCons-3716798b3700dee4552d7d5858a38350439b425d.tar.bz2
Merged revisions 1540-1545,1547-1581 via svnmerge from
http://scons.tigris.org/svn/scons/branches/core ........ r1543 | stevenknight | 2006-07-25 20:37:19 -0400 (Tue, 25 Jul 2006) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-1502" from http://scons.tigris.org/svn/scons/branches/sigrefactor ........ r1558 | stevenknight | 2006-07-28 22:43:38 -0400 (Fri, 28 Jul 2006) | 2 lines Ignore *.pyc files in the QMTest subdirectory. ........ r1561 | stevenknight | 2006-07-29 07:16:14 -0400 (Sat, 29 Jul 2006) | 3 lines Fix the infrastructure that tests runtest.py itself when the wrapping runtest.py is run directly, not through Aegis. ........ r1580 | stevenknight | 2006-08-06 15:00:06 -0400 (Sun, 06 Aug 2006) | 1 line 0.96.D428 - Support cleaning and scanning target files generated by SWIG. (Arve Knudsen) ........ r1581 | stevenknight | 2006-08-06 15:40:20 -0400 (Sun, 06 Aug 2006) | 1 line 0.96.D429 - Use zipimport as a fallback when importing modules so SCons can use py2exe's all ........
Diffstat (limited to 'test/SWIG')
-rw-r--r--test/SWIG/SWIG.py50
1 files changed, 50 insertions, 0 deletions
diff --git a/test/SWIG/SWIG.py b/test/SWIG/SWIG.py
index 753d0b9..65ecf2b 100644
--- a/test/SWIG/SWIG.py
+++ b/test/SWIG/SWIG.py
@@ -218,6 +218,56 @@ This is bar.c!
test.up_to_date(arguments = '.')
+ # Test that swig-generated modules are removed
+ # The %module directive specifies the module name
+ test.write("module.i", """\
+%module modulename
+""")
+ test.write('SConstruct', """
+foo = Environment(SWIGFLAGS='-python',
+ CPPPATH='%(platform_sys_prefix)s/include/python%(version)s/',
+ SHCCFLAGS='',
+ LDMODULEPREFIX='%(ldmodule_prefix)s',
+ LDMODULESUFFIX='%(_dll)s',
+ FRAMEWORKSFLAGS='%(frameworks)s',
+ )
+
+foo.LoadableModule(target = 'modulename', source = ['module.i'])
+""" % locals())
+ test.run()
+ test.must_exist(test.workpath("modulename.py"))
+ test.run(arguments = "-c")
+ test.must_not_exist(test.workpath("modulename.py"))
+
+ # Test that implicit dependencies are caught
+
+ test.write("dependency.i", """\
+%module dependency
+""")
+ test.write("dependent.i", """\
+%module dependent
+
+%include dependency.i
+""")
+ test.write('SConstruct', """
+foo = Environment(SWIGFLAGS='-python',
+ CPPPATH='%(platform_sys_prefix)s/include/python%(version)s/',
+ SHCCFLAGS='',
+ LDMODULEPREFIX='%(ldmodule_prefix)s',
+ LDMODULESUFFIX='%(_dll)s',
+ FRAMEWORKSFLAGS='%(frameworks)s',
+ )
+swig = foo.Dictionary('SWIG')
+bar = foo.Copy(SWIG = r'%(python)s wrapper.py ' + swig)
+foo.CFile(target = 'dependent', source = ['dependent.i'])
+""" % locals())
+
+ test.run()
+ test.write("dependency.i", """%module dependency
+
+extern char *dependency_string();
+""")
+ test.not_up_to_date(arguments = "dependent_wrap.c")
test.pass_test()