aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLKedward <laurence.kedward@bristol.ac.uk>2020-09-18 11:14:43 +0100
committerLKedward <laurence.kedward@bristol.ac.uk>2020-09-18 11:19:42 +0100
commit27b2ead1813368abe297db1913871f69836f48c0 (patch)
tree1bfb8ac5ccd43d823ea6e1edf99028ccd538fafb
parent507b315570d1d6521e2e15ad9579df205c53bc39 (diff)
downloadfpm-27b2ead1813368abe297db1913871f69836f48c0.tar.gz
fpm-27b2ead1813368abe297db1913871f69836f48c0.zip
Update: source parsing tests for dd5bf1
-rw-r--r--fpm/test/test_source_parsing.f9022
1 files changed, 16 insertions, 6 deletions
diff --git a/fpm/test/test_source_parsing.f90 b/fpm/test/test_source_parsing.f90
index c55a206..eec92d7 100644
--- a/fpm/test/test_source_parsing.f90
+++ b/fpm/test/test_source_parsing.f90
@@ -308,7 +308,7 @@ contains
open(file=temp_file, newunit=unit)
write(unit, '(a)') &
- & 'submodule (parent) :: child', &
+ & 'submodule (parent) child', &
& 'use module_one', &
& 'end submodule test'
close(unit)
@@ -323,8 +323,8 @@ contains
return
end if
- if (size(f_source%modules_provided) /= 0) then
- call test_failed(error,'Unexpected modules_provided - expecting zero')
+ if (size(f_source%modules_provided) /= 1) then
+ call test_failed(error,'Unexpected modules_provided - expecting one')
return
end if
@@ -333,6 +333,11 @@ contains
return
end if
+ if (.not.('child' .in. f_source%modules_provided)) then
+ call test_failed(error,'Missing module in modules_provided')
+ return
+ end if
+
if (.not.('module_one' .in. f_source%modules_used)) then
call test_failed(error,'Missing module in modules_used')
return
@@ -360,7 +365,7 @@ contains
open(file=temp_file, newunit=unit)
write(unit, '(a)') &
- & 'submodule (ancestor:parent) :: child', &
+ & 'submodule (ancestor:parent) child', &
& 'use module_one', &
& 'end submodule test'
close(unit)
@@ -375,8 +380,8 @@ contains
return
end if
- if (size(f_source%modules_provided) /= 0) then
- call test_failed(error,'Unexpected modules_provided - expecting zero')
+ if (size(f_source%modules_provided) /= 1) then
+ call test_failed(error,'Unexpected modules_provided - expecting one')
return
end if
@@ -385,6 +390,11 @@ contains
return
end if
+ if (.not.('child' .in. f_source%modules_provided)) then
+ call test_failed(error,'Missing module in modules_provided')
+ return
+ end if
+
if (.not.('module_one' .in. f_source%modules_used)) then
call test_failed(error,'Missing module in modules_used')
return