allow skipping CPython regression tests in test runner with --no-pyregr
authorStefan Behnel <scoder@users.berlios.de>
Sat, 19 Jul 2008 08:44:56 +0000 (10:44 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Sat, 19 Jul 2008 08:44:56 +0000 (10:44 +0200)
runtests.py

index 191c437f88ea136ee45ff7549b48f59efb6c882a..5310dd7a7eeaa3755adf98183c7d0dfed93ba9ea 100644 (file)
@@ -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)