comparison testcases.py @ 58:c95addbe0851

Fixed test group support
author Oleg Oshmyan <chortos@inbox.lv>
date Tue, 21 Dec 2010 03:04:43 +0200
parents 855bdfeb32a6
children 24f144e11b5e
comparison
equal deleted inserted replaced
57:855bdfeb32a6 58:c95addbe0851
583 except Exception: 583 except Exception:
584 prob.config.tests = tuple(prob.config.tests) 584 prob.config.tests = tuple(prob.config.tests)
585 585
586 if options.legacy: 586 if options.legacy:
587 prob.config.usegroups = False 587 prob.config.usegroups = False
588 prob.config.tests = list(prob.config.tests) 588 newtests = []
589 for i, name in enumerate(prob.config.tests): 589 for i, name in enumerate(prob.config.tests):
590 # Same here; we'll need to iterate over them twice 590 # Same here; we'll need to iterate over them twice
591 try: 591 try:
592 l = len(name) 592 l = len(name)
593 except Exception: 593 except Exception:
594 try: 594 try:
595 name = tuple(name) 595 name = tuple(name)
596 except TypeError: 596 except TypeError:
597 name = (name,) 597 name = (name,)
598 l = len(name) 598 l = len(name)
599 if len(name) > 1: 599 if l > 1:
600 prob.config.usegroups = True 600 prob.config.usegroups = True
601 break 601 newtests.append(name)
602 elif not len(name): 602 if prob.config.usegroups:
603 prob.config.tests[i] = (name,) 603 prob.config.tests = newtests
604 del newtests
604 605
605 # First get prob.cache.padoutput right, 606 # First get prob.cache.padoutput right,
606 # then yield the actual test cases 607 # then yield the actual test cases
607 for i in prob.config.dummies: 608 for i in prob.config.dummies:
608 s = 'sample ' + str(i).zfill(prob.config.paddummies) 609 s = 'sample ' + str(i).zfill(prob.config.paddummies)