aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurence Kedward <laurence.kedward@bristol.ac.uk>2021-09-24 14:48:37 +0100
committerGitHub <noreply@github.com>2021-09-24 14:48:37 +0100
commitf9464aa3fd40749cfac68479640b4a969a4289b7 (patch)
tree9c186b51074139fe58ed3f54a85ae096d374bccc
parent17cc803347b6c0da9f689413a88dc7ddfa6909bf (diff)
parenta906a122bcbb360c889a41a590d582b0b62c7e61 (diff)
downloadfpm-f9464aa3fd40749cfac68479640b4a969a4289b7.tar.gz
fpm-f9464aa3fd40749cfac68479640b4a969a4289b7.zip
Merge pull request #579 from Carltoffel/fix-test-cleanup
Fix dir not getting removed after testing fpm
-rw-r--r--test/new_test/new_test.f907
1 files changed, 5 insertions, 2 deletions
diff --git a/test/new_test/new_test.f90 b/test/new_test/new_test.f90
index a6c859b..f191015 100644
--- a/test/new_test/new_test.f90
+++ b/test/new_test/new_test.f90
@@ -36,6 +36,8 @@ character(len=:),allocatable :: shortdirs(:)
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()
@@ -146,10 +148,11 @@ logical :: IS_OS_WINDOWS
! 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