Print tests results.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tester_t), | intent(in) | :: | this | The tester. |
||
logical, | intent(in), | optional | :: | errorstop | Flag to activate error stop if one test fails. |
subroutine print(this, errorstop)
class(tester_t), intent(in) :: this !< The tester.
logical, intent(in), optional :: errorstop !< Flag to activate error stop if one test fails.
logical :: do_errorstop
if (present(errorstop)) then
do_errorstop = errorstop
else
do_errorstop = .true.
end if
write(*,*) 'fortran_tester:', this% n_errors, ' error(s) for', this% n_tests, 'test(s)'
if (this% n_errors == 0) then
write(*,*) 'fortran_tester: all tests succeeded'
else
if (do_errorstop) then
error stop 'fortran_tester: tests failed'
else
write(*,*) 'fortran_tester: tests failed'
end if
end if
end subroutine print