Skip to content

Commit 4d87edd

Browse files
committed
Add check to run cmd for when there are no apps/tests to run
1 parent e15996c commit 4d87edd

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

fpm/src/fpm.f90

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ subroutine cmd_run(settings,test)
330330
end if
331331

332332
! Enumerate executable targets to run
333-
col_width = 10
333+
col_width = -1
334334
found(:) = .false.
335335
allocate(executables(0))
336336
do i=1,size(model%targets)
@@ -374,6 +374,16 @@ subroutine cmd_run(settings,test)
374374

375375
end do
376376

377+
! Check if any apps/tests were found
378+
if (col_width < 0) then
379+
if (test) then
380+
write(stderr,*) 'No tests to run'
381+
else
382+
write(stderr,*) 'No executables to run'
383+
end if
384+
stop
385+
end if
386+
377387
! Check all names are valid
378388
if (any(.not.found)) then
379389

0 commit comments

Comments
 (0)