From: Robert Bradshaw Date: Fri, 16 Jan 2009 05:25:31 +0000 (-0800) Subject: Test for #include order X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=cd4b9f1b215f66a7d5280a5f7ef37f28324bceff;p=cython.git Test for #include order --- diff --git a/tests/run/includes/a.h b/tests/run/includes/a.h new file mode 100644 index 00000000..7550c500 --- /dev/null +++ b/tests/run/includes/a.h @@ -0,0 +1 @@ +int a = 1; \ No newline at end of file diff --git a/tests/run/includes/all.pyx b/tests/run/includes/all.pyx new file mode 100644 index 00000000..7aca44df --- /dev/null +++ b/tests/run/includes/all.pyx @@ -0,0 +1,22 @@ +__doc__ = """ + >>> test() + 1, 2, 3, 4, 5 +""" + +# Make sure all of these happen in order. + +cdef extern from "a.h": + cdef int a + +from b cimport b + +cdef extern from "c.h": + cdef int c + +from indirect_d cimport d + +cdef extern from "e.h": + cdef int e + +def test(): + print a, b, c, d, e diff --git a/tests/run/includes/b.h b/tests/run/includes/b.h new file mode 100644 index 00000000..bd6952c7 --- /dev/null +++ b/tests/run/includes/b.h @@ -0,0 +1 @@ +int b = a+1; \ No newline at end of file diff --git a/tests/run/includes/b.pxd b/tests/run/includes/b.pxd new file mode 100644 index 00000000..c189c4e3 --- /dev/null +++ b/tests/run/includes/b.pxd @@ -0,0 +1,2 @@ +cdef extern from "b.h": + cdef int b diff --git a/tests/run/includes/c.h b/tests/run/includes/c.h new file mode 100644 index 00000000..60bec436 --- /dev/null +++ b/tests/run/includes/c.h @@ -0,0 +1 @@ +int c = b+1; \ No newline at end of file diff --git a/tests/run/includes/d.h b/tests/run/includes/d.h new file mode 100644 index 00000000..0f214998 --- /dev/null +++ b/tests/run/includes/d.h @@ -0,0 +1 @@ +int d = c+1; \ No newline at end of file diff --git a/tests/run/includes/d.pxd b/tests/run/includes/d.pxd new file mode 100644 index 00000000..6abe3886 --- /dev/null +++ b/tests/run/includes/d.pxd @@ -0,0 +1,2 @@ +cdef extern from "d.h": + cdef int d diff --git a/tests/run/includes/e.h b/tests/run/includes/e.h new file mode 100644 index 00000000..21e7ec97 --- /dev/null +++ b/tests/run/includes/e.h @@ -0,0 +1 @@ +int e = d+1; \ No newline at end of file diff --git a/tests/run/includes/indirect_d.pxd b/tests/run/includes/indirect_d.pxd new file mode 100644 index 00000000..15b16d0e --- /dev/null +++ b/tests/run/includes/indirect_d.pxd @@ -0,0 +1 @@ +from d cimport d \ No newline at end of file