__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+import os.path
import sys
import unittest
}
""")
- assert pkg_dir == 'com/sub/bar', pkg_dir
+ assert pkg_dir == os.path.join('com', 'sub', 'bar'), pkg_dir
assert classes == ['Foo'], classes
def test_inner_classes(self):
}
""")
- assert pkg_dir == 'com/sub/foo', pkg_dir
+ assert pkg_dir == os.path.join('com', 'sub', 'foo'), pkg_dir
assert classes == ['Example1'], classes
if __name__ == "__main__":
while args:
a = args[0]
if a == '-d':
+ outdir = args[1]
+ args = args[1:]
+ elif a == '-o':
+ outfile = open(args[1], 'wb')
+ args = args[1:]
+ elif a == '-classpath':
args = args[1:]
elif a == '-sourcepath':
args = args[1:]
args = args[1:]
for file in args:
infile = open(file, 'rb')
- outfile = open(file[:-5] + '.class', 'wb')
for l in infile.readlines():
if l[:9] != '/*javah*/':
outfile.write(l)
test.write('SConstruct', """
env = Environment(tools = ['javah'],
JAVAH = r'%s myjavah.py')
-env.JavaH(target = 'test1.class', source = 'test1.java')
+env.JavaH(target = File('test1.h'), source = 'test1.java')
""" % (python))
test.write('test1.java', """\
line 3
""")
-#test.run(arguments = '.', stderr = None)
+test.run(arguments = '.', stderr = None)
-#test.fail_test(test.read('test1.class') != "test1.java\nline 3\n")
+test.fail_test(test.read('test1.h') != "test1.java\nline 3\n")
if os.path.normcase('.java') == os.path.normcase('.JAVA'):
test.write('SConstruct', """\
env = Environment(tools = ['javah'],
JAVAH = r'%s myjavah.py')
-env.Java(target = 'test2.class', source = 'test2.JAVA')
+env.JavaH(target = File('test2.h'), source = 'test2.JAVA')
""" % python)
test.write('test2.JAVA', """\
test.run(arguments = '.', stderr = None)
- test.fail_test(test.read('test2.class') != "test2.JAVA\nline 3\n")
+ test.fail_test(test.read('test2.h') != "test2.JAVA\nline 3\n")
if not os.path.exists('/usr/local/j2sdk1.3.1/bin/javah'):
test.write('SConstruct', """\
env = Environment(tools = ['rmic'],
RMIC = r'%s myrmic.py')
-env.Java(target = 'outdir', source = 'test2.JAVA')
+env.RMIC(target = 'outdir', source = 'test2.JAVA')
""" % python)
test.write('test2.JAVA', """\
test.run(arguments = '.', stderr = None)
- test.fail_test(test.read('test2.class') != "test2.JAVA\nline 3\n")
+ test.fail_test(test.read(['outdir', 'test2.class']) != "test2.JAVA\nline 3\n")
if not os.path.exists('/usr/local/j2sdk1.3.1/bin/rmic'):