print Subroutine

private subroutine print(this, errorstop)

Print tests results.

Type Bound

tester_t

Arguments

Type IntentOptional Attributes Name
class(tester_t), intent(in) :: this

The tester.

logical, intent(in), optional :: errorstop

Flag to activate error stop if one test fails.


Source Code

  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
       write(*,*) 'fortran_tester: tests failed'
       if (do_errorstop) then
          stop 1
       end if
    end if

  end subroutine print