32 |
""" |
""" |
33 |
|
|
34 |
import unittest, os.path, fnmatch, string, imp |
import unittest, os.path, fnmatch, string, imp |
35 |
|
import java |
36 |
|
|
37 |
true = 1 |
true = 1 |
38 |
false = 0 |
false = 0 |
74 |
|
|
75 |
compiledTestFile = compile(open(file).read() + '\n', file, 'exec') |
compiledTestFile = compile(open(file).read() + '\n', file, 'exec') |
76 |
tests = {} |
tests = {} |
77 |
exec compiledTestFile in globals(), tests |
|
78 |
|
def jni(e, file=file): |
79 |
|
# A jni test |
80 |
|
if enableJNI == false: |
81 |
|
print file + " skipped: JNI required." |
82 |
|
return |
83 |
|
else: |
84 |
|
raise e |
85 |
|
|
86 |
try: |
try: |
87 |
if tests.keys().index('requiresJNI') >= 0: |
exec compiledTestFile in globals(), tests |
88 |
if enableJNI == false: |
except java.lang.UnsatisfiedLinkError, e: jni(e) |
89 |
print file + " skipped: JNI required." |
except java.lang.NoClassDefFoundError, e: jni(e) |
|
return |
|
|
except ValueError: |
|
|
pass |
|
90 |
|
|
91 |
testnames = [t for t in tests.keys() if t.startswith('test')] |
testnames = [t for t in tests.keys() if t.startswith('test')] |
92 |
|
|