Commit d6027cb2 authored by Mark Florisson's avatar Mark Florisson

Fix Python 3 testrunner and give a warning for Python 2 builds without debug symbols

......@@ -197,10 +197,11 @@ class TestAll(GdbDebuggerTestCase):
return
out, err = self.p.communicate()
err = err.decode('UTF-8')
border = '*' * 30
start = '%s v INSIDE GDB v %s' % (border, border)
end = '%s ^ INSIDE GDB ^ %s' % (border, border)
errmsg = '\n%s\n%s%s' % (start, err.decode('UTF-8'), end)
errmsg = '\n%s\n%s%s' % (start, err, end)
self.assertEquals(0, self.p.wait(), errmsg)
sys.stderr.write(err)
......
......@@ -426,7 +426,7 @@ def run_unittest_in_module(modulename):
"debugging information. Either compile python with "
"-g or get a debug build (configure with --with-pydebug).")
warnings.warn(msg)
os._exit(1)
os._exit(0)
else:
m = __import__(modulename, fromlist=[''])
tests = inspect.getmembers(m, inspect.isclass)
......
......@@ -78,6 +78,15 @@ VER_DEP_MODULES = {
'run.special_methods_T561_py2']),
}
# files that should not be converted to Python 3 code with 2to3
KEEP_2X_FILES = [
os.path.join('Cython', 'Debugger', 'Tests', 'test_libcython_in_gdb.py'),
os.path.join('Cython', 'Debugger', 'Tests', 'test_libpython_in_gdb.py'),
os.path.join('Cython', 'Debugger', 'libcython.py'),
os.path.join('Cython', 'Debugger', 'libpython.py'),
]
INCLUDE_DIRS = [ d for d in os.getenv('INCLUDE', '').split(os.pathsep) if d ]
CFLAGS = os.getenv('CFLAGS', '').split()
......@@ -932,9 +941,14 @@ def refactor_for_py3(distdir, cy3_dir):
recursive-exclude Cython *
recursive-include Cython *.py *.pyx *.pxd
recursive-include Cython/Debugger/Tests *
include runtests.py
''')
sys.path.insert(0, cy3_dir)
for keep_2x_file in KEEP_2X_FILES:
destfile = os.path.join(cy3_dir, keep_2x_file)
shutil.copy(keep_2x_file, destfile)
class PendingThreadsError(RuntimeError):
pass
......
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