Hi,

Gary Furnish wrote:
> Can you produce a testcase for this issue?  It is *critical* for fast
> symbolics in Sage, so I would prefer to fix the bug as opposed to reverting.
> I see the problem now, but I will need the test cases you are using to
> produce a fix.  Once I have them it should be a relatively easy patch.

Here is a test case for the ordering bug (and a fix for the test runner). A
test for the header file generation is harder to write, as it requires
breaking out of the current "compile[-run]" test scheme into a
"compile-compile[-run]" scheme that builds a module against the previously
generated header file. I have currently no idea how to enable that in anything
but an ugly hackish way.

Stefan
# HG changeset patch
# User Stefan Behnel <[EMAIL PROTECTED]>
# Date 1207753404 -7200
# Node ID 3bf69f6a86bd53968dca4852c6d98896f03e229e
# Parent  57b0564cc0a889dbc0c42467488db74781087b3f
fix include dirs in test runner

diff -r 57b0564cc0a8 -r 3bf69f6a86bd runtests.py
--- a/runtests.py	Wed Apr 09 11:14:48 2008 +0200
+++ b/runtests.py	Wed Apr 09 17:03:24 2008 +0200
@@ -8,14 +8,13 @@ from distutils.extension import Extensio
 from distutils.extension import Extension
 from Cython.Distutils import build_ext
 
-
 from distutils.dist import Distribution
 distutils_distro = Distribution()
 
 TEST_DIRS = ['compile', 'run']
 TEST_RUN_DIRS = ['run']
 
-INCLUDE_DIRS = os.getenv('INCLUDE', '').split(os.pathsep)
+INCLUDE_DIRS = [ d for d in os.getenv('INCLUDE', '').split(os.pathsep) if d ]
 CFLAGS = os.getenv('CFLAGS', '').split()
 
 class TestBuilder(object):
# HG changeset patch
# User Stefan Behnel <[EMAIL PROTECTED]>
# Date 1207753730 -7200
# Node ID fb96db899b31e5f2104d5a2f7c5cf7968a4c27ac
# Parent  3bf69f6a86bd53968dca4852c6d98896f03e229e
test case for 'cdef extern class' definitions in .pxd files

diff -r 3bf69f6a86bd -r fb96db899b31 tests/compile/crunchytype.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/compile/crunchytype.h	Wed Apr 09 17:08:50 2008 +0200
@@ -0,0 +1,5 @@
+
+struct CrunchyType {
+  int number;
+  PyObject* string;
+};
diff -r 3bf69f6a86bd -r fb96db899b31 tests/compile/crunchytype.pxd
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/compile/crunchytype.pxd	Wed Apr 09 17:08:50 2008 +0200
@@ -0,0 +1,4 @@
+cdef extern from "crunchytype.h":
+    cdef class crunchytype.Crunchy [ object CrunchyType ]:
+        cdef int number
+        cdef object string
diff -r 3bf69f6a86bd -r fb96db899b31 tests/compile/extimportedsubtype.pyx
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/compile/extimportedsubtype.pyx	Wed Apr 09 17:08:50 2008 +0200
@@ -0,0 +1,7 @@
+from crunchytype cimport Crunchy
+
+cdef class Sub2(Crunchy):
+    cdef char character
+
+cdef class Sub1(Sub2):
+    cdef char character
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to