/[gzz]/gzz/test/testutil.py
ViewVC logotype

Diff of /gzz/test/testutil.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.14 by humppake, Wed Oct 9 06:50:26 2002 UTC revision 1.15 by benja, Wed Oct 9 08:18:36 2002 UTC
# Line 32  NOTE: testutil.py itself runs all tests Line 32  NOTE: testutil.py itself runs all tests
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
# Line 73  def load(file): Line 74  def load(file):
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    

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26