Commit 0e0b73b9 authored by Stefan Behnel's avatar Stefan Behnel

allow skipping CPython regression tests in test runner with --no-pyregr

parent eb4ef08d
...@@ -45,12 +45,14 @@ class ErrorWriter(object): ...@@ -45,12 +45,14 @@ class ErrorWriter(object):
return self._collect(True, True) return self._collect(True, True)
class TestBuilder(object): 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.rootdir = rootdir
self.workdir = workdir self.workdir = workdir
self.selectors = selectors self.selectors = selectors
self.annotate = annotate self.annotate = annotate
self.cleanup_workdir = cleanup_workdir self.cleanup_workdir = cleanup_workdir
self.with_pyregr = with_pyregr
def build_suite(self): def build_suite(self):
suite = unittest.TestSuite() suite = unittest.TestSuite()
...@@ -62,6 +64,8 @@ class TestBuilder(object): ...@@ -62,6 +64,8 @@ class TestBuilder(object):
continue continue
path = os.path.join(self.rootdir, filename) path = os.path.join(self.rootdir, filename)
if os.path.isdir(path) and filename in TEST_DIRS: if os.path.isdir(path) and filename in TEST_DIRS:
if filename == 'pyregr' and not self.with_pyregr:
continue
suite.addTest( suite.addTest(
self.handle_directory(path, filename)) self.handle_directory(path, filename))
return suite return suite
...@@ -312,6 +316,9 @@ if __name__ == '__main__': ...@@ -312,6 +316,9 @@ if __name__ == '__main__':
parser.add_option("--no-file", dest="filetests", parser.add_option("--no-file", dest="filetests",
action="store_false", default=True, action="store_false", default=True,
help="do not run the file based tests") 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", parser.add_option("-C", "--coverage", dest="coverage",
action="store_true", default=False, action="store_true", default=False,
help="collect source coverage data for the Compiler") help="collect source coverage data for the Compiler")
...@@ -368,7 +375,9 @@ if __name__ == '__main__': ...@@ -368,7 +375,9 @@ if __name__ == '__main__':
if options.filetests: if options.filetests:
filetests = TestBuilder(ROOTDIR, WORKDIR, selectors, 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()]) test_suite.addTests([filetests.build_suite()])
unittest.TextTestRunner(verbosity=options.verbosity).run(test_suite) unittest.TextTestRunner(verbosity=options.verbosity).run(test_suite)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment