aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLKedward <laurence.kedward@bristol.ac.uk>2020-09-18 11:38:13 +0100
committerLKedward <laurence.kedward@bristol.ac.uk>2020-09-18 11:38:13 +0100
commit35f4779647ddab4ef7edef26b4e0027004d6c756 (patch)
tree4ae4d9c33120495608fe43a9b92b9fb2c5fd41c4
parent27b2ead1813368abe297db1913871f69836f48c0 (diff)
downloadfpm-35f4779647ddab4ef7edef26b4e0027004d6c756.tar.gz
fpm-35f4779647ddab4ef7edef26b4e0027004d6c756.zip
Add: example package with submodules
-rwxr-xr-xci/run_tests.bat7
-rwxr-xr-xci/run_tests.sh5
-rw-r--r--test/example_packages/submodules/fpm.toml1
-rw-r--r--test/example_packages/submodules/src/child1.f9016
-rw-r--r--test/example_packages/submodules/src/child2.f9010
-rw-r--r--test/example_packages/submodules/src/grandchild.f9010
-rw-r--r--test/example_packages/submodules/src/parent.f9015
7 files changed, 63 insertions, 1 deletions
diff --git a/ci/run_tests.bat b/ci/run_tests.bat
index 2aa27e7..5a4d624 100755
--- a/ci/run_tests.bat
+++ b/ci/run_tests.bat
@@ -51,4 +51,11 @@ if errorlevel 1 exit 1
if errorlevel 1 exit 1
.\build\gfortran_debug\app\with_c
+if errorlevel 1 exit 1
+
+
+cd ..\submodules
+if errorlevel 1 exit 1
+
+..\..\..\fpm\build\gfortran_debug\app\fpm build
if errorlevel 1 exit 1 \ No newline at end of file
diff --git a/ci/run_tests.sh b/ci/run_tests.sh
index ea29da8..1f6d867 100755
--- a/ci/run_tests.sh
+++ b/ci/run_tests.sh
@@ -21,4 +21,7 @@ cd ../hello_complex
cd ../with_c
../../../fpm/build/gfortran_debug/app/fpm build
-./build/gfortran_debug/app/with_c \ No newline at end of file
+./build/gfortran_debug/app/with_c
+
+cd ../submodules
+../../../fpm/build/gfortran_debug/app/fpm build \ No newline at end of file
diff --git a/test/example_packages/submodules/fpm.toml b/test/example_packages/submodules/fpm.toml
new file mode 100644
index 0000000..cfc3d61
--- /dev/null
+++ b/test/example_packages/submodules/fpm.toml
@@ -0,0 +1 @@
+name = "submodules"
diff --git a/test/example_packages/submodules/src/child1.f90 b/test/example_packages/submodules/src/child1.f90
new file mode 100644
index 0000000..dbd0fa5
--- /dev/null
+++ b/test/example_packages/submodules/src/child1.f90
@@ -0,0 +1,16 @@
+submodule(parent) child1
+implicit none
+
+interface
+ module function my_fun() result (b)
+ integer :: b
+ end function my_fun
+end interface
+
+contains
+
+module procedure my_sub1
+ a = 1
+end procedure my_sub1
+
+end submodule child1 \ No newline at end of file
diff --git a/test/example_packages/submodules/src/child2.f90 b/test/example_packages/submodules/src/child2.f90
new file mode 100644
index 0000000..179cc32
--- /dev/null
+++ b/test/example_packages/submodules/src/child2.f90
@@ -0,0 +1,10 @@
+submodule(parent) child2
+implicit none
+
+contains
+
+module procedure my_sub2
+ a = 2
+end procedure my_sub2
+
+end submodule child2 \ No newline at end of file
diff --git a/test/example_packages/submodules/src/grandchild.f90 b/test/example_packages/submodules/src/grandchild.f90
new file mode 100644
index 0000000..8c5aa17
--- /dev/null
+++ b/test/example_packages/submodules/src/grandchild.f90
@@ -0,0 +1,10 @@
+submodule(parent:child1) grandchild
+implicit none
+
+contains
+
+module procedure my_fun
+ b = 2
+end procedure my_fun
+
+end submodule grandchild \ No newline at end of file
diff --git a/test/example_packages/submodules/src/parent.f90 b/test/example_packages/submodules/src/parent.f90
new file mode 100644
index 0000000..570827c
--- /dev/null
+++ b/test/example_packages/submodules/src/parent.f90
@@ -0,0 +1,15 @@
+module parent
+implicit none
+
+interface
+
+ module subroutine my_sub1(a)
+ integer, intent(out) :: a
+ end subroutine my_sub1
+
+ module subroutine my_sub2(a)
+ integer, intent(out) :: a
+ end subroutine my_sub2
+end interface
+
+end module parent \ No newline at end of file