/[thuban]/branches/WIP-pyshapelib-bramz/test/runtests.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/test/runtests.py

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

revision 1458 by bh, Fri Jul 18 15:09:22 2003 UTC revision 1838 by bh, Tue Oct 21 09:58:43 2003 UTC
# Line 61  def main(): Line 61  def main():
61    
62      opts, args = getopt.getopt(sys.argv[1:], 'v', ['verbose'])      opts, args = getopt.getopt(sys.argv[1:], 'v', ['verbose'])
63      for optchar, value in opts:      for optchar, value in opts:
64          if optchar in ("-v", "--stub-auto-login"):          if optchar in ("-v", "--verbose"):
65              verbosity = 2              verbosity = 2
66          else:          else:
67              print>>sys.stderr, "Unknown option", optchar              print>>sys.stderr, "Unknown option", optchar
# Line 71  def main(): Line 71  def main():
71      # FIXME: It should be possible to run runtests.py even when not in      # FIXME: It should be possible to run runtests.py even when not in
72      # the test directory      # the test directory
73      files = os.listdir(os.curdir)      files = os.listdir(os.curdir)
74      names = []      if args:
75      for file in files:          names = args
76          if file[:4] == "test" and file[-3:] == ".py":      else:
77              names.append(file[:-3])          names = []
78            for file in files:
79                if file[:4] == "test" and file[-3:] == ".py":
80                    names.append(file[:-3])
81    
82      suite = unittest.defaultTestLoader.loadTestsFromNames(names)      suite = unittest.defaultTestLoader.loadTestsFromNames(names)
83      runner = unittest.TextTestRunner(verbosity = verbosity)      runner = support.ThubanTestRunner(verbosity = verbosity)
84      result = runner.run(suite)      result = support.execute_as_testsuite(runner.run, suite)
   
     support.print_additional_summary()  
85    
86      sys.exit(not result.wasSuccessful())      sys.exit(not result.wasSuccessful())
87    

Legend:
Removed from v.1458  
changed lines
  Added in v.1838

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26