diff options
author | Steven Knight <knight@baldmt.com> | 2007-07-14 15:30:04 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2007-07-14 15:30:04 (GMT) |
commit | c1c5babea02556d1dbf3280d7644aa3323f1b876 (patch) | |
tree | 0637b8519aaebc4e457f58553899ead8dedb1252 /test/SWIG/SWIGOUTDIR.py | |
parent | 0bef9160a93a51ab9671c0a19d144ca027355e24 (diff) | |
download | SCons-c1c5babea02556d1dbf3280d7644aa3323f1b876.zip SCons-c1c5babea02556d1dbf3280d7644aa3323f1b876.tar.gz SCons-c1c5babea02556d1dbf3280d7644aa3323f1b876.tar.bz2 |
Merged revisions 2121-2135 via svnmerge from
http://scons.tigris.org/svn/scons/branches/core
........
r2128 | stevenknight | 2007-07-13 06:27:11 -0500 (Fri, 13 Jul 2007) | 2 lines
Use the "swig -classic" option on pre-2.0 Python versions.
........
r2130 | stevenknight | 2007-07-13 09:42:45 -0500 (Fri, 13 Jul 2007) | 2 lines
Remove left-over cut-and-paste stuff about loadable modules and frameworks.
........
r2131 | stevenknight | 2007-07-13 12:08:37 -0500 (Fri, 13 Jul 2007) | 4 lines
Refactor the structure of the tests to make the java input strings
separate from the parse_java() calls. (Prep for enhancing the parser
for Java 1.5 anonymous class files.)
........
r2132 | stevenknight | 2007-07-13 12:24:09 -0500 (Fri, 13 Jul 2007) | 3 lines
Copy the Java 1.4 nested-anonymous-class test case from test/Java/live.py.
Remove a commented-out unit test already added elsewhere.
........
r2133 | stevenknight | 2007-07-13 16:16:51 -0500 (Fri, 13 Jul 2007) | 4 lines
Support the changed naming of .class files for nested anonymous inner
classes in Java 1.5 by adding a new $JAVAVERSION variable that can be set
to reflect the javac version being used.
........
r2134 | stevenknight | 2007-07-13 20:28:34 -0500 (Fri, 13 Jul 2007) | 5 lines
Add a $SWIGOUTDIR variable.
Add it, when set, to the command line as an argument to -outdir.
Have the emitter use it to figure out where the generated .java
files will be (something we didn't do at all before, -outdir aside).
........
r2135 | stevenknight | 2007-07-13 23:51:21 -0500 (Fri, 13 Jul 2007) | 2 lines
Minor unit test fixes for old Python versions (1.6 and 2.0).
........
Diffstat (limited to 'test/SWIG/SWIGOUTDIR.py')
-rw-r--r-- | test/SWIG/SWIGOUTDIR.py | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/test/SWIG/SWIGOUTDIR.py b/test/SWIG/SWIGOUTDIR.py new file mode 100644 index 0000000..69d535c --- /dev/null +++ b/test/SWIG/SWIGOUTDIR.py @@ -0,0 +1,66 @@ +#!/usr/bin/env python +# +# __COPYRIGHT__ +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" + +""" +Verify that use of the $SWIGOUTDIR variable causes SCons to recognize +that Java files are created in the specified output directory. +""" + +import TestSCons + +test = TestSCons.TestSCons() + +test.write(['SConstruct'], """\ +env = Environment(tools = ['default', 'swig']) + +Java_foo_interface = env.SharedLibrary( + 'Java_foo_interface', + 'Java_foo_interface.i', + SWIGOUTDIR = 'java/build', + SWIGFLAGS = '-c++ -java -Wall', + SWIGCXXFILESUFFIX = "_wrap.cpp") +""" % locals()) + +test.write('Java_foo_interface.i', """\ +%module foopack +""") + +# SCons should realize that it needs to create the java/build +# subdirectory to hold the generate .java files. +test.run(arguments = '.') + +# SCons should remove the built .java files. +test.run(arguments = '-c java/build/foopack.java java/build/foopackJNI.java') + +test.must_not_exist('java/build/foopackJNI.java') +test.must_not_exist('java/build/foopack.java') + +# SCons should realize it needs to rebuild the removed .java files. +test.not_up_to_date(arguments = '.') + + + +test.pass_test() |