106 |
raise e |
raise e |
107 |
|
|
108 |
tests["needGL"] = needGL |
tests["needGL"] = needGL |
109 |
|
tests["getGraphicsWindow"] = getGraphicsWindow |
110 |
try: |
try: |
111 |
exec compiledTestFile in tests |
exec compiledTestFile in tests |
112 |
except NeedGLError, e: |
except NeedGLError, e: |
118 |
def setUp(self): |
def setUp(self): |
119 |
self.module = imp.new_module(%s) |
self.module = imp.new_module(%s) |
120 |
self.module.unittestObject = self |
self.module.unittestObject = self |
121 |
|
self.module.needGL = needGL |
122 |
self.module.getGraphicsWindow = getGraphicsWindow |
self.module.getGraphicsWindow = getGraphicsWindow |
123 |
exec faildefs in self.module.__dict__ |
exec faildefs in self.module.__dict__ |
124 |
exec self.code in self.module.__dict__ |
exec self.code in self.module.__dict__ |
169 |
|
|
170 |
|
|
171 |
if __name__ == '__main__': |
if __name__ == '__main__': |
172 |
test = ['test/'] |
sys.path.insert(0, ".") |
173 |
if len(sys.argv) > 1: |
import getopt |
174 |
sys.path.insert(0, ".") |
import gzz.util.dbg |
175 |
import getopt |
opts, args = getopt.getopt(sys.argv[1:], |
176 |
import gzz.util.dbg |
gzz.util.dbg.short, |
177 |
opts, args = getopt.getopt(sys.argv[1:], |
gzz.util.dbg.long) |
178 |
gzz.util.dbg.short, |
for o,a in opts: |
179 |
gzz.util.dbg.long) |
print "Opt: ",o,a |
180 |
for o,a in opts: |
if o in gzz.util.dbg.all: |
181 |
print "Opt: ",o,a |
gzz.util.dbg.option(o,a) |
182 |
if o in gzz.util.dbg.all: |
test = args |
|
gzz.util.dbg.option(o,a) |
|
|
|
|
|
test = args |
|
183 |
try: |
try: |
184 |
if test.index('jni') >=0: |
if test.index('jni') >=0: |
185 |
print "Enabling jni" |
print "Enabling jni" |
187 |
test.remove('jni') |
test.remove('jni') |
188 |
except ValueError: |
except ValueError: |
189 |
pass |
pass |
190 |
|
if len(test) == 0: |
191 |
|
test = ['test/'] |
192 |
class Starter(java.lang.Runnable): |
class Starter(java.lang.Runnable): |
193 |
def run(self): |
def run(self): |
194 |
unittest.TextTestRunner(verbosity=2).run(suite(test)) |
unittest.TextTestRunner(verbosity=2).run(suite(test)) |