summaryrefslogtreecommitdiffstats
path: root/test/Java
diff options
context:
space:
mode:
authorDaniel Moody <dmoody256@gmail.com>2017-10-10 01:34:28 (GMT)
committerDaniel Moody <dmoody256@gmail.com>2017-10-10 01:34:28 (GMT)
commit9050e8c4f3b345628f4038b572d090bcaee15507 (patch)
tree202e7b6611ed4da862bb150656c98a12f06a6c72 /test/Java
parent3dba3ffbdcef903ad1a8c18ac0da86dcba175ea8 (diff)
downloadSCons-9050e8c4f3b345628f4038b572d090bcaee15507.zip
SCons-9050e8c4f3b345628f4038b572d090bcaee15507.tar.gz
SCons-9050e8c4f3b345628f4038b572d090bcaee15507.tar.bz2
added test to JAR to also check the case that java source files are passed directly as a source to the Jar builder. The only other test that did this was multi-setp.py which was reliant on swig being installed.
Diffstat (limited to 'test/Java')
-rw-r--r--test/Java/JAR.py62
1 files changed, 62 insertions, 0 deletions
diff --git a/test/Java/JAR.py b/test/Java/JAR.py
index 476bfcd..08b7ab1 100644
--- a/test/Java/JAR.py
+++ b/test/Java/JAR.py
@@ -239,6 +239,68 @@ test.must_exist('bar.jar')
test.up_to_date(arguments = '.')
+#######
+# test java source files as source to Jar builder
+
+# make some directories to test in
+test.subdir('testdir2',
+ ['testdir2', 'com'],
+ ['testdir2', 'com', 'javasource'])
+
+# simple SConstruct which passes the 3 .java as source
+test.write(['testdir2', 'SConstruct'], """
+foo = Environment()
+foo.Jar(target = 'foo', source = [
+ 'com/javasource/JavaFile1.java',
+ 'com/javasource/JavaFile2.java',
+ 'com/javasource/JavaFile3.java'
+])
+""")
+
+test.write(['testdir2', 'com', 'javasource', 'JavaFile1.java'], """\
+package com.javasource;
+
+public class JavaFile1
+{
+ public static void main(String[] args)
+ {
+
+ }
+}
+""")
+
+test.write(['testdir2', 'com', 'javasource', 'JavaFile2.java'], """\
+package com.javasource;
+
+public class JavaFile2
+{
+ public static void main(String[] args)
+ {
+
+ }
+}
+""")
+
+test.write(['testdir2', 'com', 'javasource', 'JavaFile3.java'], """\
+package com.javasource;
+
+public class JavaFile3
+{
+ public static void main(String[] args)
+ {
+
+ }
+}
+""")
+
+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()):
+ test.fail_test()
+
+test.must_exist(['testdir2','foo.jar'])
+
test.pass_test()
# Local Variables: