merge
authorDag Sverre Seljebotn <dagss@student.matnat.uio.no>
Wed, 13 Aug 2008 13:11:44 +0000 (15:11 +0200)
committerDag Sverre Seljebotn <dagss@student.matnat.uio.no>
Wed, 13 Aug 2008 13:11:44 +0000 (15:11 +0200)
1  2 
runtests.py
tests/run/bufaccess.pyx

diff --cc runtests.py
index 2ea5c2a760cdb708c614c3d3fab6f11e74441c88,e251e288fb35e710752622573b9eb56a144426d6..175273afa5ab12125f2291bce75727b3e3e022c2
@@@ -264,8 -259,8 +264,9 @@@ class CythonRunTestCase(CythonCompileTe
          result.startTest(self)
          try:
              self.runCompileTest()
 -            sys.stderr.write('running doctests in %s ...\n' % self.module)
 -            doctest.DocTestSuite(self.module).run(result)
 +            if not self.cythononly:
++                sys.stderr.write('running doctests in %s ...\n' % self.module)
 +                doctest.DocTestSuite(self.module).run(result)
          except Exception:
              result.addError(self, sys.exc_info())
              result.stopTest(self)
@@@ -376,10 -372,10 +378,13 @@@ if __name__ == '__main__'
                        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/")
 +                      help="do not run the regression tests of CPython in tests/pyregr/")    
 +    parser.add_option("--cython-only", dest="cythononly",
 +                      action="store_true", default=False,
 +                      help="only compile pyx to c, do not run C compiler or run the tests")
+     parser.add_option("--sys-pyregr", dest="system_pyregr",
+                       action="store_true", default=False,
+                       help="run the regression tests of the CPython installation")
      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.cleanup_sharedlibs, options.pyregr)
 +                                options.cleanup_sharedlibs, options.pyregr, options.cythononly)
-         test_suite.addTests([filetests.build_suite()])
+         test_suite.addTest(filetests.build_suite())
+     if options.system_pyregr:
+         filetests = TestBuilder(ROOTDIR, WORKDIR, selectors,
+                                 options.annotate_source, options.cleanup_workdir,
+                                 options.cleanup_sharedlibs, True)
+         test_suite.addTest(
+             filetests.handle_directory(
+                 os.path.join(sys.prefix, 'lib', 'python'+sys.version[:3], 'test'),
+                 'pyregr'))
  
      unittest.TextTestRunner(verbosity=options.verbosity).run(test_suite)
  
index 89e2495f676bf194db20970211d85d11ddd12e1a,b19174042cb3ce0ebbbcb9bc3d432d7680e72858..14fc95d47c7eacd9e21db951101262dc45c3d995
@@@ -14,10 -14,10 +14,10 @@@ cimport python_buffe
  cimport stdio
  cimport cython
  
cimport refcount
from python_ref cimport PyObject
  
  __test__ = {}
 -setup_string = """
 +setup_string = u"""
      >>> A = IntMockBuffer("A", range(6))
      >>> B = IntMockBuffer("B", range(6))
      >>> C = IntMockBuffer("C", range(6), (2,3))