Skip to content

Commit

Permalink
add install command tests
Browse files Browse the repository at this point in the history
  • Loading branch information
perazz committed Sep 23, 2024
1 parent 9427dc4 commit 60a21b4
Showing 1 changed file with 37 additions and 1 deletion.
38 changes: 37 additions & 1 deletion test/fpm_test/test_installer.f90
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ subroutine collect_installer(testsuite)
& new_unittest("install-sitepackages", test_install_sitepackages), &
& new_unittest("install-mod", test_install_mod), &
& new_unittest("install-exe-unix", test_install_exe_unix), &
& new_unittest("install-exe-win", test_install_exe_win)]
& new_unittest("install-exe-win", test_install_exe_win), &
& new_unittest("install-test-unix", test_install_tests_unix), &
& new_unittest("install-test-win", test_install_tests_win)]

end subroutine collect_installer

Expand Down Expand Up @@ -73,6 +75,40 @@ subroutine test_install_exe_win(error)

end subroutine test_install_exe_win

subroutine test_install_tests_unix(error)
!> Error handling
type(error_t), allocatable, intent(out) :: error

type(mock_installer_t) :: mock
type(installer_t) :: installer

call new_installer(installer, prefix="PREFIX", testdir="tdir", verbosity=0, copy="mock")
mock%installer_t = installer
mock%os = OS_LINUX
mock%expected_dir = "PREFIX/tdir"
mock%expected_run = 'mock "name" "'//mock%expected_dir//'"'

call mock%install_test("name", error)

end subroutine test_install_tests_unix

subroutine test_install_tests_win(error)
!> Error handling
type(error_t), allocatable, intent(out) :: error

type(mock_installer_t) :: mock
type(installer_t) :: installer

call new_installer(installer, prefix="PREFIX", testdir="tdir", verbosity=0, copy="mock")
mock%installer_t = installer
mock%os = OS_WINDOWS
mock%expected_dir = "PREFIX\tdir"
mock%expected_run = 'mock "name.exe" "'//mock%expected_dir//'"'

call mock%install_test("name", error)

end subroutine test_install_tests_win

subroutine test_install_lib(error)
!> Error handling
type(error_t), allocatable, intent(out) :: error
Expand Down

0 comments on commit 60a21b4

Please sign in to comment.