Skip to content

Commit

Permalink
Merge pull request #579 from Carltoffel/fix-test-cleanup
Browse files Browse the repository at this point in the history
Fix dir not getting removed after testing fpm
  • Loading branch information
LKedward authored Sep 24, 2021
2 parents 17cc803 + a906a12 commit f9464aa
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/new_test/new_test.f90
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ program new_test
character(len=:),allocatable :: expected(:)
logical,allocatable :: tally(:)
logical :: IS_OS_WINDOWS
character(len=*),parameter :: dirs_to_be_removed = 'fpm_scratch_* name-with-hyphens'
character(len=:),allocatable :: rm_command
write(*,'(g0:,1x)')'TEST new SUBCOMMAND (draft):'

cmdpath = get_command_path()
Expand Down Expand Up @@ -146,10 +148,11 @@ program new_test
! clean up scratch files; might want an option to leave them for inspection
select case (get_os_type())
case (OS_UNKNOWN, OS_LINUX, OS_MACOS, OS_CYGWIN, OS_SOLARIS, OS_FREEBSD, OS_OPENBSD)
call execute_command_line('rm -rf fpm_scratch_*',exitstat=estat,cmdstat=cstat,cmdmsg=message)
rm_command = 'rm -rf ' // dirs_to_be_removed
case (OS_WINDOWS)
call execute_command_line('rmdir fpm_scratch_* /s /q',exitstat=estat,cmdstat=cstat,cmdmsg=message)
rm_command = 'rmdir ' // dirs_to_be_removed // ' /s /q'
end select
call execute_command_line(rm_command, exitstat=estat,cmdstat=cstat,cmdmsg=message)

write(*,'("new TEST TALLY=",*(g0))')tally
if(all(tally))then
Expand Down

0 comments on commit f9464aa

Please sign in to comment.