@@ -297,6 +297,7 @@ subroutine cmd_run(settings,test)
297
297
type (build_target_t), pointer :: exe_target
298
298
type (srcfile_t), pointer :: exe_source
299
299
integer :: run_scope
300
+ integer , allocatable :: stat(:)
300
301
character (len= :),allocatable :: line
301
302
logical :: toomany
302
303
@@ -417,18 +418,31 @@ subroutine cmd_run(settings,test)
417
418
call compact_list()
418
419
else
419
420
421
+ allocate (stat(size (executables)))
420
422
do i= 1 ,size (executables)
421
423
if (exists(executables(i)% s)) then
422
424
if (settings% runner .ne. ' ' )then
423
- call run(settings% runner// ' ' // executables(i)% s// " " // settings% args,echo= settings% verbose)
425
+ call run(settings% runner// ' ' // executables(i)% s// " " // settings% args, &
426
+ echo= settings% verbose, exitstat= stat(i))
424
427
else
425
- call run(executables(i)% s// " " // settings% args,echo= settings% verbose)
428
+ call run(executables(i)% s// " " // settings% args,echo= settings% verbose, &
429
+ exitstat= stat(i))
426
430
endif
427
431
else
428
432
write (stderr,* )' fpm::run<ERROR>' ,executables(i)% s,' not found'
429
433
stop 1
430
434
end if
431
435
end do
436
+
437
+ if (any (stat /= 0 )) then
438
+ do i= 1 ,size (stat)
439
+ if (stat(i) /= 0 ) then
440
+ write (* ,* ) ' <ERROR> Execution failed for "' ,basename(executables(i)% s),' "'
441
+ end if
442
+ end do
443
+ stop 1
444
+ end if
445
+
432
446
endif
433
447
contains
434
448
subroutine compact_list_all ()
0 commit comments