From 0e0b73b9bd85ec568bff5406808b9add13fa012c Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sat, 19 Jul 2008 10:44:56 +0200 Subject: [PATCH] allow skipping CPython regression tests in test runner with --no-pyregr --- runtests.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/runtests.py b/runtests.py index 191c437f..5310dd7a 100644 --- a/runtests.py +++ b/runtests.py @@ -45,12 +45,14 @@ class ErrorWriter(object): 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() @@ -62,6 +64,8 @@ class TestBuilder(object): 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 @@ -312,6 +316,9 @@ if __name__ == '__main__': 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") @@ -368,7 +375,9 @@ if __name__ == '__main__': 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) -- 2.26.2