From 4d87eddee8151d704839f08979b3c23cf63535cb Mon Sep 17 00:00:00 2001 From: LKedward Date: Sun, 8 Nov 2020 11:46:22 +0000 Subject: Add check to run cmd for when there are no apps/tests to run --- fpm/src/fpm.f90 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3