summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt Smith <kwsmith1@wisc.edu>2009-08-09 18:46:36 -0500
committerKurt Smith <kwsmith1@wisc.edu>2009-08-09 18:46:36 -0500
commit8ac56ef10e34418d2c0232813fb835c2ec08e63b (patch)
tree7325e65039d1a00bc32cb8c70a03a9166cab8260
parentde61114d2b4310188ddd1d182b762d4b9cbb4c83 (diff)
downloadcython-8ac56ef10e34418d2c0232813fb835c2ec08e63b.tar.gz
fwrap: added module tests.
-rw-r--r--Tools/fwrap/tests/bugs.txt0
-rw-r--r--Tools/fwrap/tests/run/othermod.f955
-rw-r--r--Tools/fwrap/tests/run/use_module.f9583
-rw-r--r--Tools/fwrap/tests/run/use_module_fwrap_doctest.py6
4 files changed, 94 insertions, 0 deletions
diff --git a/Tools/fwrap/tests/bugs.txt b/Tools/fwrap/tests/bugs.txt
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tools/fwrap/tests/bugs.txt
diff --git a/Tools/fwrap/tests/run/othermod.f95 b/Tools/fwrap/tests/run/othermod.f95
new file mode 100644
index 000000000..76ea65e20
--- /dev/null
+++ b/Tools/fwrap/tests/run/othermod.f95
@@ -0,0 +1,5 @@
+
+ module other
+ implicit none
+
+ integer, parameter :: other_int = selected_real_kind(14)
diff --git a/Tools/fwrap/tests/run/use_module.f95 b/Tools/fwrap/tests/run/use_module.f95
new file mode 100644
index 000000000..c515aaa80
--- /dev/null
+++ b/Tools/fwrap/tests/run/use_module.f95
@@ -0,0 +1,83 @@
+ module other
+ implicit none
+
+ integer, parameter :: other_int = selected_real_kind(14)
+ public :: other_int
+ end module other
+
+ module used
+ use other, used_int => other_int
+ implicit none
+
+ integer, parameter :: r8 = selected_real_kind(10,10)
+ integer, parameter :: foo = 4
+
+ end module used
+
+ module sub1
+ use used
+ implicit none
+ end module sub1
+
+ module sub2
+ use used
+ implicit none
+ end module sub2
+
+ module diamond
+ use sub1
+ use sub2
+ implicit none
+ end module diamond
+
+ ! function user(arg0)
+ ! use diamond, r4 => foo
+ ! implicit none
+ ! ! real(kind=r8), intent(in) :: arg0
+ ! ! real(kind=r4), intent(in) :: arg0
+ ! real(kind=used_int), intent(in) :: arg0
+ ! real(kind=r8) user
+
+ ! user = arg0
+
+ ! end function user
+
+ module conflict
+ use sub2
+ implicit none
+
+ integer, parameter :: r8 = 4
+
+ ! contains
+
+ ! subroutine user(arg0)
+ ! use sub2
+ ! implicit none
+ ! real(kind=r8), intent(inout) :: arg0
+
+ ! arg0 = 10
+
+ ! end subroutine
+
+ end module
+
+
+
+
+ ! program prog
+ ! use diamond
+
+ ! implicit none
+
+ ! interface
+ ! function user(arg)
+ ! use diamond
+ ! implicit none
+ ! real(kind=r8), intent(in) :: arg
+ ! real(kind=r8) user
+ ! end function
+ ! end interface
+
+ ! print *, user(10.0_r8)
+
+ ! end program
diff --git a/Tools/fwrap/tests/run/use_module_fwrap_doctest.py b/Tools/fwrap/tests/run/use_module_fwrap_doctest.py
new file mode 100644
index 000000000..e81055a43
--- /dev/null
+++ b/Tools/fwrap/tests/run/use_module_fwrap_doctest.py
@@ -0,0 +1,6 @@
+from use_module_fwrap import *
+
+__doc__ = u'''
+>>> user(10.0)
+(10.0,)
+'''