return self._collect(True, True)
class TestBuilder(object):
- def __init__(self, rootdir, workdir, selectors, annotate, cleanup_workdir):
+ def __init__(self, rootdir, workdir, selectors, annotate,
+ cleanup_workdir, with_pyregr):
self.rootdir = rootdir
self.workdir = workdir
self.selectors = selectors
self.annotate = annotate
self.cleanup_workdir = cleanup_workdir
+ self.with_pyregr = with_pyregr
def build_suite(self):
suite = unittest.TestSuite()
continue
path = os.path.join(self.rootdir, filename)
if os.path.isdir(path) and filename in TEST_DIRS:
+ if filename == 'pyregr' and not self.with_pyregr:
+ continue
suite.addTest(
self.handle_directory(path, filename))
return suite
parser.add_option("--no-file", dest="filetests",
action="store_false", default=True,
help="do not run the file based tests")
+ parser.add_option("--no-pyregr", dest="pyregr",
+ action="store_false", default=True,
+ help="do not run the regression tests of CPython in tests/pyregr/")
parser.add_option("-C", "--coverage", dest="coverage",
action="store_true", default=False,
help="collect source coverage data for the Compiler")
if options.filetests:
filetests = TestBuilder(ROOTDIR, WORKDIR, selectors,
- options.annotate_source, options.cleanup_workdir)
+ options.annotate_source,
+ options.cleanup_workdir,
+ options.pyregr)
test_suite.addTests([filetests.build_suite()])
unittest.TextTestRunner(verbosity=options.verbosity).run(test_suite)