48 procedure :: assertEqualInt
49 procedure :: assertEqualReal
53 procedure :: assertSetEqual2dIntArray
81 use Driver_data,
ONLY : dr_globalMe
90 character(
4) :: rank_str
91 character(MAX_STRING_LENGTH) :: fileName
99 call cpu_time(my_t_end)
107 write(
*,
*)
"SUCCESS - ",
&
110 write(
*,
*)
"FAILURE - ",
&
114 write(
*,
*)
'Walltime = ', my_walltime,
' s'
118 write(rank_str,
"(I4.4)") dr_globalMe
119 filename
= "unitTest_" // rank_str
121 OPEN(file_unit,
file=filename)
123 write(file_unit,
'(A)')
'SUCCESS all results conformed with expected values.'
125 write(file_unit,
'(A)')
'FAILURE'
132 logical,
intent(IN) :: a
133 character(
*),
intent(IN) :: msg
135 character(
256) :: buffer
= ""
138 write(buffer,
'(A)') msg
139 write(
*,
*)
TRIM(
ADJUSTL(buffer))
146 logical,
intent(IN) :: a
147 character(
*),
intent(IN) :: msg
149 character(
256) :: buffer
= ""
152 write(buffer,
'(A)') msg
153 write(
*,
*)
TRIM(
ADJUSTL(buffer))
160 integer,
intent(IN) :: a
161 integer,
intent(IN) :: b
162 character(
*),
intent(IN) :: msg
164 character(
256) :: buffer
= ""
167 write(buffer,
'(A,I5,A,I5)') msg, a,
" != ", b
168 write(
*,
*)
TRIM(
ADJUSTL(buffer))
175 real,
intent(IN) :: a
176 real,
intent(IN) :: b
177 character(
*),
intent(IN) :: msg
179 character(
256) :: buffer
= ""
182 write(buffer,
'(A,F15.8,A,F15.8)') msg, a,
" != ", b
183 write(
*,
*)
TRIM(
ADJUSTL(buffer))
190 real,
intent(IN) :: a
191 real,
intent(IN) :: b
192 real,
intent(IN) :: prec
193 character(
*),
intent(IN) :: msg
195 character(
256) :: buffer
= ""
197 if (ABS(b
- a)
> prec)
then
198 write(buffer,
'(A,F15.8,A,F15.8)') msg, a,
" != ", b
199 write(
*,
*)
TRIM(
ADJUSTL(buffer))
206 integer,
intent(IN) :: A(:, :)
207 integer,
intent(IN) :: B(:, :)
208 character(
*),
intent(IN) :: msg
221 if (
ALL(A(j, :)
== B(k, :)))
then
227 if (
.NOT. in_set)
then
228 write(
*,
*) msg,
" - ", A(j, :),
" of A not in B"
237 if (
ALL(B(j, :)
== A(k, :)))
then
243 if (
.NOT. in_set)
then
244 write(
*,
*) msg,
" - ", B(j, :),
" of B not in A"
subroutine Driver_abort(errorMessage)
integer, save my_n_failed
subroutine finish_test_run
subroutine assertEqualInt(a, b, msg)
subroutine start_test_run()
subroutine assertEqualReal(a, b, msg)
subroutine assertSetEqual2dIntArray(A, B, msg)
subroutine assertTrue(a, msg)
subroutine assertFalse(a, msg)
subroutine assertAlmostEqual(a, b, prec, msg)
integer function ut_getFreeFileUnit()