Skip to content

Commit 6455ce4

Browse files
committed
manifest: add test
1 parent 1960157 commit 6455ce4

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

test/fpm_test/test_manifest.f90

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ subroutine collect_manifest(tests)
6868
& new_unittest("example-empty", test_example_empty, should_fail=.true.), &
6969
& new_unittest("install-library", test_install_library), &
7070
& new_unittest("install-empty", test_install_empty), &
71+
& new_unittest("install-module-dir", test_install_module_dir), &
7172
& new_unittest("install-wrongkey", test_install_wrongkey, should_fail=.true.), &
7273
& new_unittest("preprocess-empty", test_preprocess_empty), &
7374
& new_unittest("preprocess-wrongkey", test_preprocess_wrongkey, should_fail=.true.), &
@@ -1359,6 +1360,34 @@ subroutine test_install_wrongkey(error)
13591360

13601361
end subroutine test_install_wrongkey
13611362

1363+
1364+
subroutine test_install_module_dir(error)
1365+
use fpm_manifest_install
1366+
1367+
!> Error handling
1368+
type(error_t), allocatable, intent(out) :: error
1369+
1370+
type(toml_table) :: table
1371+
type(install_config_t) :: install
1372+
1373+
table = toml_table()
1374+
call set_value(table, "module-dir", "custom_modules")
1375+
1376+
call new_install_config(install, table, error)
1377+
if (allocated(error)) return
1378+
1379+
if (.not.allocated(install%module_dir)) then
1380+
call test_failed(error, "Module directory should be allocated")
1381+
return
1382+
end if
1383+
1384+
if (install%module_dir /= "custom_modules") then
1385+
call test_failed(error, "Module directory should match input")
1386+
return
1387+
end if
1388+
1389+
end subroutine test_install_module_dir
1390+
13621391
subroutine test_preprocess_empty(error)
13631392
use fpm_manifest_preprocess
13641393

0 commit comments

Comments
 (0)