From cd4b9f1b215f66a7d5280a5f7ef37f28324bceff Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Thu, 15 Jan 2009 21:25:31 -0800 Subject: [PATCH] Test for #include order --- tests/run/includes/a.h | 1 + tests/run/includes/all.pyx | 22 ++++++++++++++++++++++ tests/run/includes/b.h | 1 + tests/run/includes/b.pxd | 2 ++ tests/run/includes/c.h | 1 + tests/run/includes/d.h | 1 + tests/run/includes/d.pxd | 2 ++ tests/run/includes/e.h | 1 + tests/run/includes/indirect_d.pxd | 1 + 9 files changed, 32 insertions(+) create mode 100644 tests/run/includes/a.h create mode 100644 tests/run/includes/all.pyx create mode 100644 tests/run/includes/b.h create mode 100644 tests/run/includes/b.pxd create mode 100644 tests/run/includes/c.h create mode 100644 tests/run/includes/d.h create mode 100644 tests/run/includes/d.pxd create mode 100644 tests/run/includes/e.h create mode 100644 tests/run/includes/indirect_d.pxd 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 -- 2.26.2