aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLKedward <laurence.kedward@bristol.ac.uk>2020-11-08 11:46:22 +0000
committerLKedward <laurence.kedward@bristol.ac.uk>2020-11-08 11:46:22 +0000
commit4d87eddee8151d704839f08979b3c23cf63535cb (patch)
treef51e8977d4d028aeecc8d7d5a39695c8c40d6dde
parente15996cb01673e542a4697dfbc348b63c0bfb89e (diff)
downloadfpm-4d87eddee8151d704839f08979b3c23cf63535cb.tar.gz
fpm-4d87eddee8151d704839f08979b3c23cf63535cb.zip
Add check to run cmd for when there are no apps/tests to run
-rw-r--r--fpm/src/fpm.f9012
1 files changed, 11 insertions, 1 deletions
diff --git a/fpm/src/fpm.f90 b/fpm/src/fpm.f90
index 9b5796d..4f48a9b 100644
--- a/fpm/src/fpm.f90
+++ b/fpm/src/fpm.f90
@@ -330,7 +330,7 @@ subroutine cmd_run(settings,test)
end if
! Enumerate executable targets to run
- col_width = 10
+ col_width = -1
found(:) = .false.
allocate(executables(0))
do i=1,size(model%targets)
@@ -374,6 +374,16 @@ subroutine cmd_run(settings,test)
end do
+ ! Check if any apps/tests were found
+ if (col_width < 0) then
+ if (test) then
+ write(stderr,*) 'No tests to run'
+ else
+ write(stderr,*) 'No executables to run'
+ end if
+ stop
+ end if
+
! Check all names are valid
if (any(.not.found)) then