Skip to content

Commit a906a12

Browse files
author
Carl Burkert
committed
Fix dir not getting removed after testing fpm
1 parent dfeb17a commit a906a12

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/new_test/new_test.f90

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ program new_test
3636
character(len=:),allocatable :: expected(:)
3737
logical,allocatable :: tally(:)
3838
logical :: IS_OS_WINDOWS
39+
character(len=*),parameter :: dirs_to_be_removed = 'fpm_scratch_* name-with-hyphens'
40+
character(len=:),allocatable :: rm_command
3941
write(*,'(g0:,1x)')'TEST new SUBCOMMAND (draft):'
4042

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

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

0 commit comments

Comments
 (0)