Skip to content

Commit 696f93f

Browse files
committed
install_config_t: add test option
1 parent 3c835fc commit 696f93f

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

src/fpm/manifest/install.f90

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ module fpm_manifest_install
1818

1919
!> Install library with this project
2020
logical :: library = .false.
21+
22+
!> Install tests with this project
23+
logical :: test = .false.
2124

2225
contains
2326

@@ -51,6 +54,7 @@ subroutine new_install_config(self, table, error)
5154
if (allocated(error)) return
5255

5356
call get_value(table, "library", self%library, .false.)
57+
call get_value(table, "test", self%library, .false.)
5458

5559
end subroutine new_install_config
5660

@@ -75,8 +79,8 @@ subroutine check(table, error)
7579
case default
7680
call syntax_error(error, "Key "//list(ikey)%key//" is not allowed in install table")
7781
exit
78-
case("library")
79-
continue
82+
case("library","test")
83+
continue
8084
end select
8185
end do
8286
if (allocated(error)) return
@@ -107,8 +111,8 @@ subroutine info(self, unit, verbosity)
107111
if (pr < 1) return
108112

109113
write(unit, fmt) "Install configuration"
110-
write(unit, fmt) " - library install", &
111-
& trim(merge("enabled ", "disabled", self%library))
114+
write(unit, fmt) " - library install", trim(merge("enabled ", "disabled", self%library))
115+
write(unit, fmt) " - test install", trim(merge("enabled ", "disabled", self%test))
112116

113117
end subroutine info
114118

@@ -121,6 +125,7 @@ logical function install_conf_same(this,that)
121125
select type (other=>that)
122126
type is (install_config_t)
123127
if (this%library.neqv.other%library) return
128+
if (this%test.neqv.other%test) return
124129
class default
125130
! Not the same type
126131
return
@@ -144,6 +149,10 @@ subroutine dump_to_toml(self, table, error)
144149
type(error_t), allocatable, intent(out) :: error
145150

146151
call set_value(table, "library", self%library, error, class_name)
152+
if (allocated(error)) return
153+
154+
call set_value(table, "test", self%test, error, class_name)
155+
if (allocated(error)) return
147156

148157
end subroutine dump_to_toml
149158

@@ -163,6 +172,8 @@ subroutine load_from_toml(self, table, error)
163172

164173
call get_value(table, "library", self%library, error, class_name)
165174
if (allocated(error)) return
175+
call get_value(table, "library", self%test, error, class_name)
176+
if (allocated(error)) return
166177

167178
end subroutine load_from_toml
168179

0 commit comments

Comments
 (0)