Skip to content

Commit 3c835fc

Browse files
committed
installer_t: add test directory
1 parent 1221ce3 commit 3c835fc

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/fpm/installer.f90

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ module fpm_installer
2121
character(len=:), allocatable :: bindir
2222
!> Library directory relative to the installation prefix
2323
character(len=:), allocatable :: libdir
24+
!> Test program directory relative to the installation prefix
25+
character(len=:), allocatable :: testdir
2426
!> Include directory relative to the installation prefix
2527
character(len=:), allocatable :: includedir
2628
!> Output unit for informative printout
@@ -53,6 +55,9 @@ module fpm_installer
5355

5456
!> Default name of the library subdirectory
5557
character(len=*), parameter :: default_libdir = "lib"
58+
59+
!> Default name of the test subdirectory
60+
character(len=*), parameter :: default_testdir = "test"
5661

5762
!> Default name of the include subdirectory
5863
character(len=*), parameter :: default_includedir = "include"
@@ -78,7 +83,7 @@ module fpm_installer
7883
contains
7984

8085
!> Create a new instance of an installer
81-
subroutine new_installer(self, prefix, bindir, libdir, includedir, verbosity, &
86+
subroutine new_installer(self, prefix, bindir, libdir, includedir, testdir, verbosity, &
8287
copy, move)
8388
!> Instance of the installer
8489
type(installer_t), intent(out) :: self
@@ -90,6 +95,8 @@ subroutine new_installer(self, prefix, bindir, libdir, includedir, verbosity, &
9095
character(len=*), intent(in), optional :: libdir
9196
!> Include directory relative to the installation prefix
9297
character(len=*), intent(in), optional :: includedir
98+
!> Test directory relative to the installation prefix
99+
character(len=*), intent(in), optional :: testdir
93100
!> Verbosity of the installer
94101
integer, intent(in), optional :: verbosity
95102
!> Copy command
@@ -125,6 +132,12 @@ subroutine new_installer(self, prefix, bindir, libdir, includedir, verbosity, &
125132
else
126133
self%includedir = default_includedir
127134
end if
135+
136+
if (present(testdir)) then
137+
self%testdir = testdir
138+
else
139+
self%testdir = default_testdir
140+
end if
128141

129142
if (present(prefix)) then
130143
self%prefix = prefix

0 commit comments

Comments
 (0)