tester Module

Routines to test Fortran programs


Uses

  • module~~tester~~UsesGraph module~tester tester iso_fortran_env iso_fortran_env module~tester->iso_fortran_env

Used by

  • module~~tester~~UsedByGraph module~tester tester program~flap_test_group flap_test_group program~flap_test_group->module~tester program~test_tester_05 test_tester_05 program~test_tester_05->module~tester program~test_tester_1 test_tester_1 program~test_tester_1->module~tester program~test_tester_1~2 test_tester_1 program~test_tester_1~2->module~tester program~test_tester_2 test_tester_2 program~test_tester_2->module~tester program~test_tester_3 test_tester_3 program~test_tester_3->module~tester program~test_tester_4 test_tester_4 program~test_tester_4->module~tester program~test_tester_6 test_tester_6 program~test_tester_6->module~tester program~test_tester_7 test_tester_7 program~test_tester_7->module~tester program~test_tester_8 test_tester_8 program~test_tester_8->module~tester

Derived Types

type, public ::  tester_t

The main tester class.

Components

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.

Type-Bound Procedures

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.


Subroutines

private subroutine init(this, tolerance32, tolerance64)

Initialize the tester.

Arguments

Type IntentOptional 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.

private subroutine print(this, errorstop)

Print tests results.

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.

private subroutine assert_equal_i8(this, i1, i2)

Check if two integers (8 bits) are equal.

Arguments

Type IntentOptional 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.

private subroutine assert_equal_i16(this, i1, i2)

Check if two integers (16 bits) are equal.

Arguments

Type IntentOptional 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.

private subroutine assert_equal_i32(this, i1, i2)

Check if two integers (32 bits) are equal.

Arguments

Type IntentOptional 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.

private subroutine assert_equal_i64(this, i1, i2)

Check if two integers (64 bits) are equal.

Arguments

Type IntentOptional 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.

private subroutine assert_equal_r32(this, r1, r2)

Check if two reals (32 bits) are equal.

Arguments

Type IntentOptional 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.

private subroutine assert_equal_r64(this, r1, r2)

Check if two reals (64 bits) are equal.

Arguments

Type IntentOptional 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.

private subroutine assert_equal_c32(this, c1, c2)

Check if two complex numbers (32 bits) are equal.

Arguments

Type IntentOptional 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.

private subroutine assert_equal_c64(this, c1, c2)

Check if two complex numbers (64 bits) are equal.

Arguments

Type IntentOptional 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.

private subroutine assert_equal_l(this, l1, l2)

Check if two logicals are equal.

Arguments

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

The tester.

logical, intent(in) :: l1

Value to compare.

logical, intent(in) :: l2

Value to compare.

private subroutine assert_equal_i8_1(this, i1, i2)

Check if two integer (8 bits) arrays (rank 1) are equal.

Arguments

Type IntentOptional 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.

private subroutine assert_equal_i16_1(this, i1, i2)

Check if two integer (16 bits) arrays (rank 1) are equal.

Arguments

Type IntentOptional 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.

private subroutine assert_equal_i32_1(this, i1, i2)

Check if two integer (32 bits) arrays (rank 1) are equal.

Arguments

Type IntentOptional 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.

private subroutine assert_equal_i64_1(this, i1, i2)

Check if two integer (64 bits) arrays (rank 1) are equal.

Arguments

Type IntentOptional 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.

private subroutine assert_equal_r32_1(this, r1, r2)

Check if two real (32 bits) arrays (rank 1) are equal.

Arguments

Type IntentOptional 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.

private subroutine assert_equal_r64_1(this, r1, r2)

Check if two real (64 bits) arrays (rank 1) are equal.

Arguments

Type IntentOptional 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.

private subroutine assert_equal_c32_1(this, c1, c2)

Check if two complex (32 bits) arrays (rank 1) are equal.

Arguments

Type IntentOptional 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.

private subroutine assert_equal_c64_1(this, c1, c2)

Check if two complex (64 bits) arrays (rank 1) are equal.

Arguments

Type IntentOptional 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.

private subroutine assert_equal_l_1(this, l1, l2)

Check if two logical arrays (rank 1) are equal.

Arguments

Type IntentOptional 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.

private subroutine assert_positive_i8(this, i)

Check if a integer (32 bits) is positive.

Arguments

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

The tester.

integer(kind=int8), intent(in) :: i

Value to check.

private subroutine assert_positive_i16(this, i)

Check if a integer (16 bits) is positive.

Arguments

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

The tester.

integer(kind=int16), intent(in) :: i

Value to check.

private subroutine assert_positive_i32(this, i)

Check if a integer (32 bits) is positive.

Arguments

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

The tester.

integer(kind=int32), intent(in) :: i

Value to check.

private subroutine assert_positive_i64(this, i)

Check if a integer (32 bits) is positive.

Arguments

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

The tester.

integer(kind=int64), intent(in) :: i

Value to check.

private subroutine assert_positive_r32(this, r)

Check if a real (32 bits) is positive.

Arguments

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

The tester.

real(kind=real32), intent(in) :: r

Value to check.

private subroutine assert_positive_r64(this, r)

Check if a real (64 bits) is positive.

Arguments

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

The tester.

real(kind=real64), intent(in) :: r

Value to check.

private subroutine assert_positive_i8_1(this, i)

Check if a integer (8 bits) array (rank 1) is positive.

Arguments

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

The tester.

integer(kind=int8), intent(in), dimension(:) :: i

Value to check.

private subroutine assert_positive_i16_1(this, i)

Check if a integer (16 bits) array (rank 1) is positive.

Arguments

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

The tester.

integer(kind=int16), intent(in), dimension(:) :: i

Value to check.

private subroutine assert_positive_i32_1(this, i)

Check if a integer (32 bits) array (rank 1) is positive.

Arguments

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

The tester.

integer(kind=int32), intent(in), dimension(:) :: i

Value to check.

private subroutine assert_positive_i64_1(this, i)

Check if a integer (64 bits) array (rank 1) is positive.

Arguments

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

The tester.

integer(kind=int64), intent(in), dimension(:) :: i

Value to check.

private subroutine assert_positive_r32_1(this, r)

Check if a real (32 bits) array (rank 1) is positive.

Arguments

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

The tester.

real(kind=real32), intent(in), dimension(:) :: r

Value to check.

private subroutine assert_positive_r64_1(this, r)

Check if a real (64 bits) array (rank 1) is positive.

Arguments

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

The tester.

real(kind=real64), intent(in), dimension(:) :: r

Value to check.

private subroutine assert_close_r32(this, r1, r2)

Check if two reals (32 bits) are close with respect a tolerance.

Arguments

Type IntentOptional 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.

private subroutine assert_close_r64(this, r1, r2)

Check if two reals (64 bits) are close with respect a tolerance.

Arguments

Type IntentOptional 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.

private subroutine assert_close_r32_1(this, r1, r2)

Check if two real (32 bits) arrays (rank 1) are close with respect a tolerance.

Arguments

Type IntentOptional 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.

private subroutine assert_close_r64_1(this, r1, r2)

Check if two real (64 bits) arrays (rank 1) are close with respect a tolerance.

Arguments

Type IntentOptional 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.

private subroutine assert_close_c32(this, c1, c2)

Check if two complex numbers (32 bits) are close with respect a tolerance.

Arguments

Type IntentOptional 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.

private subroutine assert_close_c64(this, r1, c2)

Check if two complex numbers (64 bits) are close with respect a tolerance.

Arguments

Type IntentOptional 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.

private subroutine assert_close_c32_1(this, c1, c2)

Check if two complex (32 bits) arrays (rank 1) are close with respect a tolerance.

Arguments

Type IntentOptional 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.

private subroutine assert_close_c64_1(this, c1, c2)

Check if two real (64 bits) arrays (rank 1) are close with respect a tolerance.

Arguments

Type IntentOptional 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.