Test for #include order
authorRobert Bradshaw <robertwb@math.washington.edu>
Fri, 16 Jan 2009 05:25:31 +0000 (21:25 -0800)
committerRobert Bradshaw <robertwb@math.washington.edu>
Fri, 16 Jan 2009 05:25:31 +0000 (21:25 -0800)
tests/run/includes/a.h [new file with mode: 0644]
tests/run/includes/all.pyx [new file with mode: 0644]
tests/run/includes/b.h [new file with mode: 0644]
tests/run/includes/b.pxd [new file with mode: 0644]
tests/run/includes/c.h [new file with mode: 0644]
tests/run/includes/d.h [new file with mode: 0644]
tests/run/includes/d.pxd [new file with mode: 0644]
tests/run/includes/e.h [new file with mode: 0644]
tests/run/includes/indirect_d.pxd [new file with mode: 0644]

diff --git a/tests/run/includes/a.h b/tests/run/includes/a.h
new file mode 100644 (file)
index 0000000..7550c50
--- /dev/null
@@ -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 (file)
index 0000000..7aca44d
--- /dev/null
@@ -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 (file)
index 0000000..bd6952c
--- /dev/null
@@ -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 (file)
index 0000000..c189c4e
--- /dev/null
@@ -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 (file)
index 0000000..60bec43
--- /dev/null
@@ -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 (file)
index 0000000..0f21499
--- /dev/null
@@ -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 (file)
index 0000000..6abe388
--- /dev/null
@@ -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 (file)
index 0000000..21e7ec9
--- /dev/null
@@ -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 (file)
index 0000000..15b16d0
--- /dev/null
@@ -0,0 +1 @@
+from d cimport d
\ No newline at end of file