aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fpm/src/fpm/manifest/executable.f904
-rw-r--r--fpm/src/fpm/manifest/package.f909
-rw-r--r--fpm/src/fpm/manifest/test.f904
3 files changed, 15 insertions, 2 deletions
diff --git a/fpm/src/fpm/manifest/executable.f90 b/fpm/src/fpm/manifest/executable.f90
index 704396a..94d4000 100644
--- a/fpm/src/fpm/manifest/executable.f90
+++ b/fpm/src/fpm/manifest/executable.f90
@@ -63,6 +63,10 @@ contains
if (allocated(error)) return
call get_value(table, "name", self%name)
+ if (.not.allocated(self%name)) then
+ call syntax_error(error, "Could not retrieve executable name")
+ return
+ end if
call get_value(table, "source-dir", self%source_dir, "app")
call get_value(table, "main", self%main, "main.f90")
diff --git a/fpm/src/fpm/manifest/package.f90 b/fpm/src/fpm/manifest/package.f90
index f318ad7..95194d2 100644
--- a/fpm/src/fpm/manifest/package.f90
+++ b/fpm/src/fpm/manifest/package.f90
@@ -93,6 +93,10 @@ contains
if (allocated(error)) return
call get_value(table, "name", self%name)
+ if (.not.allocated(self%name)) then
+ call syntax_error(error, "Could not retrieve package name")
+ return
+ end if
call get_value(table, "dependencies", child, requested=.false.)
if (associated(child)) then
@@ -110,6 +114,7 @@ contains
if (associated(child)) then
allocate(self%library)
call new_library(self%library, child, error)
+ if (allocated(error)) return
end if
call get_value(table, "executable", children, requested=.false.)
@@ -125,6 +130,7 @@ contains
call new_executable(self%executable(ii), node, error)
if (allocated(error)) exit
end do
+ if (allocated(error)) return
end if
call get_value(table, "test", children, requested=.false.)
@@ -140,6 +146,7 @@ contains
call new_test(self%test(ii), node, error)
if (allocated(error)) exit
end do
+ if (allocated(error)) return
end if
end subroutine new_package
@@ -154,14 +161,12 @@ contains
!> Error handling
type(error_t), allocatable, intent(out) :: error
- character(len=:), allocatable :: name
type(toml_key), allocatable :: list(:)
logical :: name_present
integer :: ikey
name_present = .false.
- call table%get_key(name)
call table%get_keys(list)
if (.not.allocated(list)) then
diff --git a/fpm/src/fpm/manifest/test.f90 b/fpm/src/fpm/manifest/test.f90
index 9b50315..c35ea63 100644
--- a/fpm/src/fpm/manifest/test.f90
+++ b/fpm/src/fpm/manifest/test.f90
@@ -56,6 +56,10 @@ contains
if (allocated(error)) return
call get_value(table, "name", self%name)
+ if (.not.allocated(self%name)) then
+ call syntax_error(error, "Could not retrieve test name")
+ return
+ end if
call get_value(table, "source-dir", self%source_dir, "test")
call get_value(table, "main", self%main, "main.f90")