tests/run-tests.py
branchstable
changeset 1363 58a33a3ed565
parent 1361 1d3aa8779efb
child 1364 772a53435e14
equal deleted inserted replaced
1361:1d3aa8779efb 1363:58a33a3ed565
   131                 entries[line] = filename
   131                 entries[line] = filename
   132 
   132 
   133         f.close()
   133         f.close()
   134     return entries
   134     return entries
   135 
   135 
   136 def parseargs():
   136 def parseargs(args):
   137     parser = optparse.OptionParser("%prog [options] [tests]")
   137     parser = optparse.OptionParser("%prog [options] [tests]")
   138 
   138 
   139     # keep these sorted
   139     # keep these sorted
   140     parser.add_option("--blacklist", action="append",
   140     parser.add_option("--blacklist", action="append",
   141         help="skip tests listed in the specified blacklist file")
   141         help="skip tests listed in the specified blacklist file")
   208                       help='run tests in random order')
   208                       help='run tests in random order')
   209 
   209 
   210     for option, (envvar, default) in defaults.items():
   210     for option, (envvar, default) in defaults.items():
   211         defaults[option] = type(default)(os.environ.get(envvar, default))
   211         defaults[option] = type(default)(os.environ.get(envvar, default))
   212     parser.set_defaults(**defaults)
   212     parser.set_defaults(**defaults)
   213     (options, args) = parser.parse_args()
   213     (options, args) = parser.parse_args(args)
   214 
   214 
   215     # jython is always pure
   215     # jython is always pure
   216     if 'java' in sys.platform or '__pypy__' in sys.modules:
   216     if 'java' in sys.platform or '__pypy__' in sys.modules:
   217         options.pure = True
   217         options.pure = True
   218 
   218 
  1174         return 80
  1174         return 80
  1175 
  1175 
  1176 testtypes = [('.py', pytest, '.out'),
  1176 testtypes = [('.py', pytest, '.out'),
  1177              ('.t', tsttest, '')]
  1177              ('.t', tsttest, '')]
  1178 
  1178 
  1179 def main():
  1179 def main(args):
  1180     (options, args) = parseargs()
  1180     (options, args) = parseargs(args)
  1181     os.umask(022)
  1181     os.umask(022)
  1182 
  1182 
  1183     checktools()
  1183     checktools()
  1184 
  1184 
  1185     if not args:
  1185     if not args:
  1297     finally:
  1297     finally:
  1298         time.sleep(.1)
  1298         time.sleep(.1)
  1299         cleanup(options)
  1299         cleanup(options)
  1300 
  1300 
  1301 if __name__ == '__main__':
  1301 if __name__ == '__main__':
  1302     main()
  1302     main(sys.argv[1:])