Routines to test Fortran programs
The main tester class.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer(kind=int32), | public | :: | n_errors | = | 0_int32 |
Number of errors. |
|
integer(kind=int32), | public | :: | n_tests | = | 0_int32 |
Number of tests. |
|
real(kind=real32), | public | :: | tolerance32 | = | 2._real32*epsilon(1._real32) |
Real tolerance, 32 bits. |
|
real(kind=real64), | public | :: | tolerance64 | = | 2._real64*epsilon(1._real64) |
Real tolerance, 64 bits. |
procedure, public :: init | ../../../../ Initialize the tester. |
procedure, public :: print | ../../../../ Print tests results. |
generic, public :: assert_equal => assert_equal_i8, assert_equal_i16, assert_equal_i32, assert_equal_i64, assert_equal_r32, assert_equal_r64, assert_equal_c32, assert_equal_c64, assert_equal_l, assert_equal_i8_1, assert_equal_i16_1, assert_equal_i32_1, assert_equal_i64_1, assert_equal_r32_1, assert_equal_r64_1, assert_equal_c32_1, assert_equal_c64_1, assert_equal_l_1 | ../../../../ Check if two values (integer, real, complex or logical) are equal. |
procedure, private :: assert_equal_i8 | ../../../../ Check if two integers (8 bits) are equal. |
procedure, private :: assert_equal_i16 | ../../../../ Check if two integers (16 bits) are equal. |
procedure, private :: assert_equal_i32 | ../../../../ Check if two integers (32 bits) are equal. |
procedure, private :: assert_equal_i64 | ../../../../ Check if two integers (64 bits) are equal. |
procedure, private :: assert_equal_r32 | ../../../../ Check if two reals (32 bits) are equal. |
procedure, private :: assert_equal_r64 | ../../../../ Check if two reals (64 bits) are equal. |
procedure, private :: assert_equal_c32 | ../../../../ Check if two complex numbers (32 bits) are equal. |
procedure, private :: assert_equal_c64 | ../../../../ Check if two complex numbers (64 bits) are equal. |
procedure, private :: assert_equal_l | ../../../../ Check if two logicals are equal. |
procedure, private :: assert_equal_i8_1 | ../../../../ Check if two integer (8 bits) arrays (rank 1) are equal. |
procedure, private :: assert_equal_i16_1 | ../../../../ Check if two integer (16 bits) arrays (rank 1) are equal. |
procedure, private :: assert_equal_i32_1 | ../../../../ Check if two integer (32 bits) arrays (rank 1) are equal. |
procedure, private :: assert_equal_i64_1 | ../../../../ Check if two integer (64 bits) arrays (rank 1) are equal. |
procedure, private :: assert_equal_r32_1 | ../../../../ Check if two real (32 bits) arrays (rank 1) are equal. |
procedure, private :: assert_equal_r64_1 | ../../../../ Check if two real (64 bits) arrays (rank 1) are equal. |
procedure, private :: assert_equal_c32_1 | ../../../../ Check if two complex (32 bits) arrays (rank 1) are equal. |
procedure, private :: assert_equal_c64_1 | ../../../../ Check if two complex (64 bits) arrays (rank 1) are equal. |
procedure, private :: assert_equal_l_1 | ../../../../ Check if two logical arrays (rank 1) are equal. |
generic, public :: assert_positive => assert_positive_i8, assert_positive_i16, assert_positive_i32, assert_positive_i64, assert_positive_r32, assert_positive_r64, assert_positive_i8_1, assert_positive_i16_1, assert_positive_i32_1, assert_positive_i64_1, assert_positive_r32_1, assert_positive_r64_1 | ../../../../ Check if a number (integer or real) is positive. |
procedure, private :: assert_positive_i8 | ../../../../ Check if a integer (8 bits) is positive. |
procedure, private :: assert_positive_i16 | ../../../../ Check if a integer (16 bits) is positive. |
procedure, private :: assert_positive_i32 | ../../../../ Check if a integer (32 bits) is positive. |
procedure, private :: assert_positive_i64 | ../../../../ Check if a integer (64 bits) is positive. |
procedure, private :: assert_positive_r32 | ../../../../ Check if a real (32 bits) is positive. |
procedure, private :: assert_positive_r64 | ../../../../ Check if a real (64 bits) is positive. |
procedure, private :: assert_positive_i8_1 | ../../../../ Check if a integer (8 bits) array (rank 1) is positive. |
procedure, private :: assert_positive_i16_1 | ../../../../ Check if a integer (16 bits) array (rank 1) is positive. |
procedure, private :: assert_positive_i32_1 | ../../../../ Check if a integer (32 bits) array (rank 1) is positive. |
procedure, private :: assert_positive_i64_1 | ../../../../ Check if a integer (64 bits) array (rank 1) is positive. |
procedure, private :: assert_positive_r32_1 | ../../../../ Check if a real (32 bits) array (rank 1) is positive. |
procedure, private :: assert_positive_r64_1 | ../../../../ Check if a real (64 bits) array (rank 1) is positive. |
generic, public :: assert_close => assert_close_r32, assert_close_r64, assert_close_c32, assert_close_c64, assert_close_r32_1, assert_close_r64_1, assert_close_c32_1, assert_close_c64_1 | ../../../../ Check if two values (real or complex) are close with respect a tolerance. |
procedure, private :: assert_close_r32 | ../../../../ Check if two reals (32 bits) are close with respect a tolerance. |
procedure, private :: assert_close_r64 | ../../../../ Check if two reals (64 bits) are close with respect a tolerance. |
procedure, private :: assert_close_c32 | ../../../../ Check if two complex numbers (32 bits) are close with respect a tolerance. |
procedure, private :: assert_close_c64 | ../../../../ Check if two complex numbers (64 bits) are close with respect a tolerance. |
procedure, private :: assert_close_r32_1 | ../../../../ Check if two real (32 bits) arrays (rank 1) are close with respect a tolerance. |
procedure, private :: assert_close_r64_1 | ../../../../ Check if two real (64 bits) arrays (rank 1) are close with respect a tolerance. |
procedure, private :: assert_close_c32_1 | ../../../../ Check if two complex (32 bits) arrays (rank 1) are close with respect a tolerance. |
procedure, private :: assert_close_c64_1 | ../../../../ Check if two complex (64 bits) arrays (rank 1) are close with respect a tolerance. |
Initialize the tester.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tester_t), | intent(out) | :: | this |
The tester. |
||
real(kind=real32), | intent(in), | optional | :: | tolerance32 |
Real tolerance, 32 bits. |
|
real(kind=real64), | intent(in), | optional | :: | tolerance64 |
Real tolerance, 64 bits. |
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. |
Check if two integers (8 bits) are equal.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tester_t), | intent(inout) | :: | this |
The tester. |
||
integer(kind=int8), | intent(in) | :: | i1 |
Value to compare. |
||
integer(kind=int8), | intent(in) | :: | i2 |
Value to compare. |
Check if two integers (16 bits) are equal.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tester_t), | intent(inout) | :: | this |
The tester. |
||
integer(kind=int16), | intent(in) | :: | i1 |
Value to compare. |
||
integer(kind=int16), | intent(in) | :: | i2 |
Value to compare. |
Check if two integers (32 bits) are equal.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tester_t), | intent(inout) | :: | this |
The tester. |
||
integer(kind=int32), | intent(in) | :: | i1 |
Value to compare. |
||
integer(kind=int32), | intent(in) | :: | i2 |
Value to compare. |
Check if two integers (64 bits) are equal.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tester_t), | intent(inout) | :: | this |
The tester. |
||
integer(kind=int64), | intent(in) | :: | i1 |
Value to compare. |
||
integer(kind=int64), | intent(in) | :: | i2 |
Value to compare. |
Check if two reals (32 bits) are equal.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tester_t), | intent(inout) | :: | this |
The tester. |
||
real(kind=real32), | intent(in) | :: | r1 |
Value to compare. |
||
real(kind=real32), | intent(in) | :: | r2 |
Value to compare. |
Check if two reals (64 bits) are equal.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tester_t), | intent(inout) | :: | this |
The tester. |
||
real(kind=real64), | intent(in) | :: | r1 |
Value to compare. |
||
real(kind=real64), | intent(in) | :: | r2 |
Value to compare. |
Check if two complex numbers (32 bits) are equal.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tester_t), | intent(inout) | :: | this |
The tester. |
||
complex(kind=real32), | intent(in) | :: | c1 |
Value to compare. |
||
complex(kind=real32), | intent(in) | :: | c2 |
Value to compare. |
Check if two complex numbers (64 bits) are equal.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tester_t), | intent(inout) | :: | this |
The tester. |
||
complex(kind=real64), | intent(in) | :: | c1 |
Value to compare. |
||
complex(kind=real64), | intent(in) | :: | c2 |
Value to compare. |
Check if two logicals are equal.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tester_t), | intent(inout) | :: | this |
The tester. |
||
logical, | intent(in) | :: | l1 |
Value to compare. |
||
logical, | intent(in) | :: | l2 |
Value to compare. |
Check if two integer (8 bits) arrays (rank 1) are equal.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tester_t), | intent(inout) | :: | this |
The tester. |
||
integer(kind=int8), | intent(in), | dimension(:) | :: | i1 |
Value to compare. |
|
integer(kind=int8), | intent(in), | dimension(:) | :: | i2 |
Value to compare. |
Check if two integer (16 bits) arrays (rank 1) are equal.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tester_t), | intent(inout) | :: | this |
The tester. |
||
integer(kind=int16), | intent(in), | dimension(:) | :: | i1 |
Value to compare. |
|
integer(kind=int16), | intent(in), | dimension(:) | :: | i2 |
Value to compare. |
Check if two integer (32 bits) arrays (rank 1) are equal.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tester_t), | intent(inout) | :: | this |
The tester. |
||
integer(kind=int32), | intent(in), | dimension(:) | :: | i1 |
Value to compare. |
|
integer(kind=int32), | intent(in), | dimension(:) | :: | i2 |
Value to compare. |
Check if two integer (64 bits) arrays (rank 1) are equal.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tester_t), | intent(inout) | :: | this |
The tester. |
||
integer(kind=int64), | intent(in), | dimension(:) | :: | i1 |
Value to compare. |
|
integer(kind=int64), | intent(in), | dimension(:) | :: | i2 |
Value to compare. |
Check if two real (32 bits) arrays (rank 1) are equal.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tester_t), | intent(inout) | :: | this |
The tester. |
||
real(kind=real32), | intent(in), | dimension(:) | :: | r1 |
Value to compare. |
|
real(kind=real32), | intent(in), | dimension(:) | :: | r2 |
Value to compare. |
Check if two real (64 bits) arrays (rank 1) are equal.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tester_t), | intent(inout) | :: | this |
The tester. |
||
real(kind=real64), | intent(in), | dimension(:) | :: | r1 |
Value to compare. |
|
real(kind=real64), | intent(in), | dimension(:) | :: | r2 |
Value to compare. |
Check if two complex (32 bits) arrays (rank 1) are equal.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tester_t), | intent(inout) | :: | this |
The tester. |
||
complex(kind=real32), | intent(in), | dimension(:) | :: | c1 |
Value to compare. |
|
complex(kind=real32), | intent(in), | dimension(:) | :: | c2 |
Value to compare. |
Check if two complex (64 bits) arrays (rank 1) are equal.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tester_t), | intent(inout) | :: | this |
The tester. |
||
complex(kind=real64), | intent(in), | dimension(:) | :: | c1 |
Value to compare. |
|
complex(kind=real64), | intent(in), | dimension(:) | :: | c2 |
Value to compare. |
Check if two logical arrays (rank 1) are equal.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tester_t), | intent(inout) | :: | this |
The tester. |
||
logical, | intent(in), | dimension(:) | :: | l1 |
Value to compare. |
|
logical, | intent(in), | dimension(:) | :: | l2 |
Value to compare. |
Check if a integer (32 bits) is positive.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tester_t), | intent(inout) | :: | this |
The tester. |
||
integer(kind=int8), | intent(in) | :: | i |
Value to check. |
Check if a integer (16 bits) is positive.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tester_t), | intent(inout) | :: | this |
The tester. |
||
integer(kind=int16), | intent(in) | :: | i |
Value to check. |
Check if a integer (32 bits) is positive.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tester_t), | intent(inout) | :: | this |
The tester. |
||
integer(kind=int32), | intent(in) | :: | i |
Value to check. |
Check if a integer (32 bits) is positive.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tester_t), | intent(inout) | :: | this |
The tester. |
||
integer(kind=int64), | intent(in) | :: | i |
Value to check. |
Check if a real (32 bits) is positive.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tester_t), | intent(inout) | :: | this |
The tester. |
||
real(kind=real32), | intent(in) | :: | r |
Value to check. |
Check if a real (64 bits) is positive.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tester_t), | intent(inout) | :: | this |
The tester. |
||
real(kind=real64), | intent(in) | :: | r |
Value to check. |
Check if a integer (8 bits) array (rank 1) is positive.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tester_t), | intent(inout) | :: | this |
The tester. |
||
integer(kind=int8), | intent(in), | dimension(:) | :: | i |
Value to check. |
Check if a integer (16 bits) array (rank 1) is positive.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tester_t), | intent(inout) | :: | this |
The tester. |
||
integer(kind=int16), | intent(in), | dimension(:) | :: | i |
Value to check. |
Check if a integer (32 bits) array (rank 1) is positive.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tester_t), | intent(inout) | :: | this |
The tester. |
||
integer(kind=int32), | intent(in), | dimension(:) | :: | i |
Value to check. |
Check if a integer (64 bits) array (rank 1) is positive.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tester_t), | intent(inout) | :: | this |
The tester. |
||
integer(kind=int64), | intent(in), | dimension(:) | :: | i |
Value to check. |
Check if a real (32 bits) array (rank 1) is positive.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tester_t), | intent(inout) | :: | this |
The tester. |
||
real(kind=real32), | intent(in), | dimension(:) | :: | r |
Value to check. |
Check if a real (64 bits) array (rank 1) is positive.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tester_t), | intent(inout) | :: | this |
The tester. |
||
real(kind=real64), | intent(in), | dimension(:) | :: | r |
Value to check. |
Check if two reals (32 bits) are close with respect a tolerance.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tester_t), | intent(inout) | :: | this |
The tester. |
||
real(kind=real32), | intent(in) | :: | r1 |
Value to compare. |
||
real(kind=real32), | intent(in) | :: | r2 |
Value to compare. |
Check if two reals (64 bits) are close with respect a tolerance.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tester_t), | intent(inout) | :: | this |
The tester. |
||
real(kind=real64), | intent(in) | :: | r1 |
Value to compare. |
||
real(kind=real64), | intent(in) | :: | r2 |
Value to compare. |
Check if two real (32 bits) arrays (rank 1) are close with respect a tolerance.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tester_t), | intent(inout) | :: | this |
The tester. |
||
real(kind=real32), | intent(in), | dimension(:) | :: | r1 |
Value to compare. |
|
real(kind=real32), | intent(in), | dimension(:) | :: | r2 |
Value to compare. |
Check if two real (64 bits) arrays (rank 1) are close with respect a tolerance.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tester_t), | intent(inout) | :: | this |
The tester. |
||
real(kind=real64), | intent(in), | dimension(:) | :: | r1 |
Value to compare. |
|
real(kind=real64), | intent(in), | dimension(:) | :: | r2 |
Value to compare. |
Check if two complex numbers (32 bits) are close with respect a tolerance.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tester_t), | intent(inout) | :: | this |
The tester. |
||
complex(kind=real32), | intent(in) | :: | c1 |
Value to compare. |
||
complex(kind=real32), | intent(in) | :: | c2 |
Value to compare. |
Check if two complex numbers (64 bits) are close with respect a tolerance.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tester_t), | intent(inout) | :: | this |
The tester. |
||
complex(kind=real64), | intent(in) | :: | r1 |
Value to compare. |
||
complex(kind=real64), | intent(in) | :: | c2 |
Value to compare. |
Check if two complex (32 bits) arrays (rank 1) are close with respect a tolerance.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tester_t), | intent(inout) | :: | this |
The tester. |
||
complex(kind=real32), | intent(in), | dimension(:) | :: | c1 |
Value to compare. |
|
complex(kind=real32), | intent(in), | dimension(:) | :: | c2 |
Value to compare. |
Check if two real (64 bits) arrays (rank 1) are close with respect a tolerance.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tester_t), | intent(inout) | :: | this |
The tester. |
||
complex(kind=real64), | intent(in), | dimension(:) | :: | c1 |
Value to compare. |
|
complex(kind=real64), | intent(in), | dimension(:) | :: | c2 |
Value to compare. |