tests/run-tests.py
changeset 3306 642e5faf6bf0
parent 3215 53e843840349
child 3307 3cd51b986172
equal deleted inserted replaced
3305:e7abcf3a7c5f 3306:642e5faf6bf0
    30     help="print a test coverage report")
    30     help="print a test coverage report")
    31 parser.add_option("-s", "--cover_stdlib", action="store_true",
    31 parser.add_option("-s", "--cover_stdlib", action="store_true",
    32     help="print a test coverage report inc. standard libraries")
    32     help="print a test coverage report inc. standard libraries")
    33 parser.add_option("-C", "--annotate", action="store_true",
    33 parser.add_option("-C", "--annotate", action="store_true",
    34     help="output files annotated with coverage")
    34     help="output files annotated with coverage")
       
    35 parser.add_option("-r", "--retest", action="store_true",
       
    36     help="retest failed tests")
       
    37 
    35 parser.set_defaults(timeout=180)
    38 parser.set_defaults(timeout=180)
    36 (options, args) = parser.parse_args()
    39 (options, args) = parser.parse_args()
    37 verbose = options.verbose
    40 verbose = options.verbose
    38 coverage = options.cover or options.cover_stdlib or options.annotate
    41 coverage = options.cover or options.cover_stdlib or options.annotate
    39 
    42 
   358             args = os.listdir(".")
   361             args = os.listdir(".")
   359         for test in args:
   362         for test in args:
   360             if (test.startswith("test-") and '~' not in test and
   363             if (test.startswith("test-") and '~' not in test and
   361                 ('.' not in test or test.endswith('.py') or
   364                 ('.' not in test or test.endswith('.py') or
   362                  test.endswith('.bat'))):
   365                  test.endswith('.bat'))):
       
   366                 if options.retest and not os.path.exists(test + ".err"):
       
   367                     skipped += 1
       
   368                     continue
   363                 ret = run_one(test)
   369                 ret = run_one(test)
   364                 if ret is None:
   370                 if ret is None:
   365                     skipped += 1
   371                     skipped += 1
   366                 elif not ret:
   372                 elif not ret:
   367                     failed += 1
   373                     failed += 1