48 |
false = 0 |
false = 0 |
49 |
enableJNI = false |
enableJNI = false |
50 |
|
|
51 |
|
class NeedGLError: |
52 |
|
pass |
53 |
|
|
54 |
|
def needGL(): |
55 |
|
if enableJNI: return |
56 |
|
raise NeedGLError() |
57 |
|
|
58 |
def tests(files): |
def tests(files): |
59 |
""" |
""" |
60 |
Return a list of all *.test files in a given directory and its |
Return a list of all *.test files in a given directory and its |
106 |
|
|
107 |
try: |
try: |
108 |
exec compiledTestFile in globals(), tests |
exec compiledTestFile in globals(), tests |
109 |
except java.lang.UnsatisfiedLinkError, e: jni(e) |
except NeedGLError, e: |
110 |
except java.lang.NoClassDefFoundError, e: jni(e) |
print "Skipping test %s because it needs OpenGL compiled.", file |
111 |
|
|
112 |
testnames = [t for t in tests.keys() if t.startswith('test')] |
testnames = [t for t in tests.keys() if t.startswith('test')] |
113 |
|
|
189 |
class Starter(java.lang.Runnable): |
class Starter(java.lang.Runnable): |
190 |
def run(self): |
def run(self): |
191 |
unittest.TextTestRunner(verbosity=2).run(suite(test)) |
unittest.TextTestRunner(verbosity=2).run(suite(test)) |
192 |
|
java.lang.System.exit(0) |
193 |
GraphicsAPI.getInstance().startUpdateManager(Starter()) |
GraphicsAPI.getInstance().startUpdateManager(Starter()) |
194 |
|
|
195 |
|
|