summaryrefslogtreecommitdiffstats
path: root/test/Java/JAR.py
diff options
context:
space:
mode:
authorDaniel Moody <dmoody256@gmail.com>2017-10-26 02:11:00 (GMT)
committerDaniel Moody <dmoody256@gmail.com>2017-10-26 02:11:00 (GMT)
commit253bfb7a24dfa0da59acc4389885aeac9f216f2b (patch)
treec3b9c6abaeb701d82860bab54f143a2a8df77709 /test/Java/JAR.py
parentb54f4166d0053ae7168af1d16223fff574344f17 (diff)
downloadSCons-253bfb7a24dfa0da59acc4389885aeac9f216f2b.zip
SCons-253bfb7a24dfa0da59acc4389885aeac9f216f2b.tar.gz
SCons-253bfb7a24dfa0da59acc4389885aeac9f216f2b.tar.bz2
updated the JAR test to test that the java source files were actually compiled and are in the resulting jar file. Also updated the swig dependency test to throw no result from what seems to be a non java related bug.
Diffstat (limited to 'test/Java/JAR.py')
-rw-r--r--test/Java/JAR.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/test/Java/JAR.py b/test/Java/JAR.py
index 08b7ab1..d6d735c 100644
--- a/test/Java/JAR.py
+++ b/test/Java/JAR.py
@@ -25,7 +25,6 @@
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import os
-
import TestSCons
_python_ = TestSCons._python_
@@ -248,6 +247,7 @@ test.subdir('testdir2',
['testdir2', 'com', 'javasource'])
# simple SConstruct which passes the 3 .java as source
+# and extracts the jar back to classes
test.write(['testdir2', 'SConstruct'], """
foo = Environment()
foo.Jar(target = 'foo', source = [
@@ -255,6 +255,8 @@ foo.Jar(target = 'foo', source = [
'com/javasource/JavaFile2.java',
'com/javasource/JavaFile3.java'
])
+foo.Command(foo.Dir('test'), 'foo.jar', Mkdir("test") )
+foo.Command('JavaFile1.class', foo.Dir('test'), foo['JAR'] + ' xvf ../foo.jar', chdir='test')
""")
test.write(['testdir2', 'com', 'javasource', 'JavaFile1.java'], """\
@@ -295,11 +297,18 @@ public class JavaFile3
test.run(chdir='testdir2')
-if("jar cf foo.jar com/javasource/JavaFile1.java com/javasource/JavaFile2.java " +
- "com/javasource/JavaFile3.java" not in test.stdout()):
+# check the output and make sure the java files got converted to classes
+if("jar cf foo.jar " +
+ "-C com/javasource/JavaFile1 com/javasource/JavaFile1.class " +
+ "-C com/javasource/JavaFile2 com/javasource/JavaFile2.class " +
+ "-C com/javasource/JavaFile3 com/javasource/JavaFile3.class" not in test.stdout()):
test.fail_test()
+# make sure there are class in the jar
test.must_exist(['testdir2','foo.jar'])
+test.must_exist(['testdir2', 'test', 'com', 'javasource', 'JavaFile1.class'])
+test.must_exist(['testdir2', 'test', 'com', 'javasource', 'JavaFile2.class'])
+test.must_exist(['testdir2', 'test', 'com', 'javasource', 'JavaFile3.class'])
test.pass_test()