runTestRealVal Function

public function runTestRealVal(self) result(tests_passed)

Run test on real values and print summary report for images.

Arguments

Type IntentOptional AttributesName
class(TestRealVal), intent(in) :: self

Return Value integer

Return the tests that passed up to and including this one in the linked list.


Contents

Source Code


Variables

TypeVisibility AttributesNameInitial
integer, public :: i
integer, public :: img_passed
real(kind=wp), public, allocatable, codimension[:]:: res
real(kind=wp), public, allocatable, codimension[:]:: tgt

Source Code

function runTestRealVal(self) result(tests_passed)
    !! Run test on real values and print summary report for images.

    class(TestRealVal), intent(in) :: self
    integer :: tests_passed
        !! Return the tests that passed up to and including this one in
        !! the linked list.

    real(kind=wp), allocatable, codimension[:] :: res, tgt
    integer :: img_passed, i

    if (associated(self%next)) then
        tests_passed = self%next%run()
    else
        tests_passed = 0
    end if

    allocate(res[*], tgt[*])
    res = self%res
    tgt = self%tgt

    sync all
    img_passed = 0
    if (this_image() == 1) then
        print SUBTEST_START, self%test_name
        do i=1, num_images()
            if (self%compare(res[i], tgt[i])) then
                img_passed = img_passed + 1
            else
                call self%printFail(i, res[i], tgt[i])
            end if
        end do
        print SUBTEST_END, img_passed, num_images()
    end if

    if (img_passed == num_images()) tests_passed = tests_passed + 1
end function runTestRealVal