summaryrefslogtreecommitdiffstats
path: root/test/JAR.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2003-09-17 12:01:39 (GMT)
committerSteven Knight <knight@baldmt.com>2003-09-17 12:01:39 (GMT)
commitaff3d21397df3db4ee99f0d6ef964dde23791b50 (patch)
tree104507e594a84e99a83abbbffac1b51cd834113c /test/JAR.py
parent0b3f13af1549fc4f6b6ed57f151b1d2004e82f2c (diff)
downloadSCons-aff3d21397df3db4ee99f0d6ef964dde23791b50.zip
SCons-aff3d21397df3db4ee99f0d6ef964dde23791b50.tar.gz
SCons-aff3d21397df3db4ee99f0d6ef964dde23791b50.tar.bz2
Support Jar manifest files and the -C option. Tool/ms*.py fixes for pre-Python 2.2. (Charles Crain)
Diffstat (limited to 'test/JAR.py')
-rw-r--r--test/JAR.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/JAR.py b/test/JAR.py
index 3636735..e0634be 100644
--- a/test/JAR.py
+++ b/test/JAR.py
@@ -87,6 +87,35 @@ line 3
test.fail_test(test.read('test2.jar') != "test2.CLASS\nline 3\n")
+test.write('myjar2.py', r"""
+import sys
+import string
+f=open(sys.argv[2], 'wb')
+f.write(string.join(sys.argv[1:]))
+f.write("\n")
+f.close()
+sys.exit(0)
+""")
+
+test.write('SConstruct', """
+env = Environment(tools = ['jar'],
+ JAR = r'%s myjar2.py',
+ JARFLAGS='cvf')
+env.Jar(target = 'classes.jar', source = [ 'testdir/bar.class',
+ 'foo.mf' ],
+ JARCHDIR='testdir')
+""" % (python))
+
+test.subdir('testdir')
+test.write([ 'testdir', 'bar.class' ], 'foo')
+test.write('foo.mf',
+ """Manifest-Version : 1.0
+ blah
+ blah
+ blah
+ """)
+test.run(arguments='classes.jar')
+test.fail_test(test.read('classes.jar') != 'cvfm classes.jar foo.mf -C testdir bar.class\n')
if not os.path.exists('/usr/local/j2sdk1.3.1/bin/javac'):
print "Could not find Java, skipping test(s)."