better debug output
[cython.git] / runtests.py
index 8d9a38dcc912b201ed6e301f9b719459f2c44dbe..d4921d5bacddfa5a239260f642a10983df31717f 100644 (file)
@@ -35,7 +35,8 @@ TEST_RUN_DIRS = ['run', 'wrappers', 'pyregr']
 # which should be excluded if the module is not present.
 EXT_DEP_MODULES = {
     'numpy' : re.compile('.*\.numpy_.*').match,
-    'pstats' : re.compile('.*\.pstats_.*').match
+    'pstats' : re.compile('.*\.pstats_.*').match,
+    'posix' : re.compile('.*\.posix_.*').match,
 }
 
 def get_numpy_include_dirs():
@@ -50,9 +51,13 @@ EXT_DEP_INCLUDES = [
 VER_DEP_MODULES = {
     # tests are excluded if 'CurrentPythonVersion OP VersionTuple', i.e.
     # (2,4) : (operator.le, ...) excludes ... when PyVer <= 2.4.x
+    (2,5) : (operator.lt, lambda x: x in ['run.any',
+                                          'run.all',
+                                          ]),
     (2,4) : (operator.le, lambda x: x in ['run.extern_builtins_T258'
                                           ]),
-    (2,6) : (operator.lt, lambda x: x in ['run.print_function'
+    (2,6) : (operator.lt, lambda x: x in ['run.print_function',
+                                          'run.cython3',
                                           ]),
     (3,): (operator.ge, lambda x: x in ['run.non_future_division',
                                         'compile.extsetslice',
@@ -178,7 +183,10 @@ class TestBuilder(object):
 
     def build_tests(self, test_class, path, workdir, module, expect_errors):
         if expect_errors:
-            languages = self.languages[:1]
+            if 'cpp' in module and 'cpp' in self.languages:
+                languages = ['cpp']
+            else:
+                languages = self.languages[:1]
         else:
             languages = self.languages
         if 'cpp' in module and 'c' in languages:
@@ -321,7 +329,8 @@ class CythonCompileTestCase(unittest.TestCase):
             use_listing_file = False,
             cplus = self.language == 'cpp',
             generate_pxi = False,
-            evaluate_tree_assertions = True,
+#            evaluate_tree_assertions = True,
+            evaluate_tree_assertions = False,
             )
         cython_compile(source, options=options,
                        full_module_name=module)
@@ -781,7 +790,6 @@ if __name__ == '__main__':
 
     if sys.version_info[0] >= 3:
         options.doctests = False
-        options.pyregr   = False
         if options.with_cython:
             try:
                 # try if Cython is installed in a Py3 version
@@ -804,9 +812,10 @@ if __name__ == '__main__':
 
     if options.coverage or options.coverage_xml:
         if not WITH_CYTHON:
-            options.coverage = False
+            options.coverage = options.coverage_xml = False
         else:
-            from coverage import coverage
+            from coverage import coverage as _coverage
+            coverage = _coverage(branch=True)
             coverage.erase()
             coverage.start()
 
@@ -937,7 +946,7 @@ if __name__ == '__main__':
         if options.coverage:
             coverage.report(modules, show_missing=0)
         if options.coverage_xml:
-            coverage.xml_report(modules, show_missing=0, outfile="coverage-report.xml")
+            coverage.xml_report(modules, outfile="coverage-report.xml")
 
     if missing_dep_excluder.tests_missing_deps:
         sys.stderr.write("Following tests excluded because of missing dependencies on your system:\n")