Skip to content

Commit

Permalink
Fix issue kivy#162 by making 'make tests' pass.
Browse files Browse the repository at this point in the history
  • Loading branch information
benson-basis committed May 3, 2015
1 parent cca4da3 commit 4f8c918
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
24 changes: 16 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
.PHONY: build_ext tests

JAVAC_OPTS=-target 1.6 -source 1.6
JAVAC=javac $(JAVAC_OPTS)

build_ext:
javac jnius/src/org/jnius/NativeInvocationHandler.java
$(JAVAC) jnius/src/org/jnius/NativeInvocationHandler.java
python setup.py build_ext --inplace -f -g

clean:
find . -name "*.class" -exec rm {} \;
rm -rf build

html:
$(MAKE) -C docs html

tests: build_ext
cd tests && javac org/jnius/HelloWorld.java
cd tests && javac org/jnius/BasicsTest.java
cd tests && javac org/jnius/MultipleMethods.java
cd tests && javac org/jnius/SimpleEnum.java
cd tests && javac org/jnius/InterfaceWithPublicEnum.java
cd tests && javac org/jnius/ClassArgument.java
cd tests && javac org/jnius/MultipleDimensions.java
cd tests && $(JAVAC) org/jnius/HelloWorld.java
cd tests && $(JAVAC) org/jnius/BasicsTest.java
cd tests && $(JAVAC) org/jnius/MultipleMethods.java
cd tests && $(JAVAC) org/jnius/SimpleEnum.java
cd tests && $(JAVAC) org/jnius/InterfaceWithPublicEnum.java
cd tests && $(JAVAC) org/jnius/ClassArgument.java
cd tests && $(JAVAC) org/jnius/MultipleDimensions.java
cp jnius/src/org/jnius/NativeInvocationHandler.class tests/org/jnius
cd tests && env PYTHONPATH=..:$(PYTHONPATH) nosetests-2.7 -v
12 changes: 10 additions & 2 deletions tests/test_proxy.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from jnius import autoclass, java_method, PythonJavaClass, cast
from nose.tools import *

print '1: declare a TestImplem that implement Collection'

Expand Down Expand Up @@ -104,7 +105,7 @@ def bad_signature(self, *args):
pass


print '2: instanciate the class, with some data'
print '2: instantiate the class, with some data'
a = TestImplem(*range(10))
print a
print dir(a)
Expand Down Expand Up @@ -150,4 +151,11 @@ def bad_signature(self, *args):
#print Collections.shuffle(a2)

# test bad signature
TestBadSignature()
threw = False
try:
TestBadSignature()
except Exception:
threw = True

if not threw:
raise Exception("Failed to throw for bad signature")

0 comments on commit 4f8c918

Please sign in to comment.