Run test on real values and print summary report for images.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(TestRealVal), | intent(in) | :: | self |
Return the tests that passed up to and including this one in the linked list.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public | :: | i | ||||
integer, | public | :: | img_passed | ||||
real(kind=wp), | public, | allocatable, codimension[:] | :: | res | |||
real(kind=wp), | public, | allocatable, codimension[:] | :: | tgt |
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