/[fenfire]/fenfire/org/fenfire/test/test.py
ViewVC logotype

Diff of /fenfire/org/fenfire/test/test.py

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

revision 1.3 by benja, Mon Mar 3 19:10:02 2003 UTC revision 1.4 by benja, Tue Mar 4 10:50:43 2003 UTC
# Line 53  def test(module): Line 53  def test(module):
53          fn = getattr(module, test)          fn = getattr(module, test)
54    
55          if not fn.__doc__:          if not fn.__doc__:
56              name = test              name = '%s.%s' % (module.__name__, test)
57          else:          else:
58              lines = fn.__doc__.split('\n')              lines = fn.__doc__.split('\n')
59              if lines[0] == '':              if lines[0] == '':
60                  name = '%s (%s)' % (test, lines[1].strip())                  name = '%s.%s (%s)' % (module.__name__, test,
61                                           lines[1].strip())
62              else:              else:
63                  name = '%s (%s)' % (test, lines[0].strip())                  name = '%s.%s (%s)' % (module.__name__, test,
64                                           lines[0].strip())
65                    
66          print name + "... ",          print name + "... ",
67    
# Line 102  def shouldRun(obj): Line 104  def shouldRun(obj):
104    
105    
106  def load(file):  def load(file):
107      name = os.path.splitext(os.path.basename(file))[0]      name = os.path.splitext(file)[0]
108        name = '.'.join(name.split('/'))
109        name = '.'.join(name.split('\\'))
110    
111      module = imp.new_module(name)      module = imp.new_module(name)
112      execfile(file, module.__dict__)      execfile(file, module.__dict__)
# Line 132  def tests(files): Line 136  def tests(files):
136    
137  def main(args):  def main(args):
138      global runfail      global runfail
139      runfail = []      runfail = [None]
140            
141      opts, args = getopt.getopt(args,      opts, args = getopt.getopt(args,
142              org.fenfire.test.dbg.short + "f:",              org.fenfire.test.dbg.short + "f:",
# Line 163  def startGraphicsAPI(dirs): Line 167  def startGraphicsAPI(dirs):
167    
168                  print                  print
169    
170                  for exc in exceptions:              for exc in exceptions:
                     print 75 * '-'  
                     traceback.print_exception(*exc['exception'])  
   
171                  print 75 * '-'                  print 75 * '-'
172                  print                  traceback.print_exception(*exc['exception'])
173                  print "%s test failures." % len(exceptions)  
174                print 75 * '-'
175                print
176                print "%s test failures." % len(exceptions)
177    
178                  java.lang.System.exit(exceptions != [])              java.lang.System.exit(exceptions != [])
179    
180      gzz.client.GraphicsAPI.getInstance().startUpdateManager(Starter(dirs))      gzz.client.GraphicsAPI.getInstance().startUpdateManager(Starter(dirs))
181    

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

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