fortran_tester
 All Classes Files Functions Variables Pages
Data Types | Private Member Functions | List of all members
tester Module Reference

Routines to test Fortran programs. More...

Data Types

type  tester_t
 The main tester class. More...
 

Private Member Functions

subroutine init (this, tolerance32, tolerance64)
 Initialize the tester. More...
 
subroutine print (this, errorstop)
 Print tests results. More...
 
subroutine assert_equal_i8 (this, i1, i2)
 Check if two integers (8 bits) are equal. More...
 
subroutine assert_equal_i16 (this, i1, i2)
 Check if two integers (16 bits) are equal. More...
 
subroutine assert_equal_i32 (this, i1, i2)
 Check if two integers (32 bits) are equal. More...
 
subroutine assert_equal_i64 (this, i1, i2)
 Check if two integers (64 bits) are equal. More...
 
subroutine assert_equal_r32 (this, r1, r2)
 Check if two reals (32 bits) are equal. More...
 
subroutine assert_equal_r64 (this, r1, r2)
 Check if two reals (64 bits) are equal. More...
 
subroutine assert_equal_c32 (this, c1, c2)
 Check if two complex numbers (32 bits) are equal. More...
 
subroutine assert_equal_c64 (this, c1, c2)
 Check if two complex numbers (64 bits) are equal. More...
 
subroutine assert_equal_l (this, l1, l2)
 Check if two logicals are equal. More...
 
subroutine assert_equal_i8_1 (this, i1, i2)
 Check if two integer (8 bits) arrays (rank 1) are equal. More...
 
subroutine assert_equal_i16_1 (this, i1, i2)
 Check if two integer (16 bits) arrays (rank 1) are equal. More...
 
subroutine assert_equal_i32_1 (this, i1, i2)
 Check if two integer (32 bits) arrays (rank 1) are equal. More...
 
subroutine assert_equal_i64_1 (this, i1, i2)
 Check if two integer (64 bits) arrays (rank 1) are equal. More...
 
subroutine assert_equal_r32_1 (this, r1, r2)
 Check if two real (32 bits) arrays (rank 1) are equal. More...
 
subroutine assert_equal_r64_1 (this, r1, r2)
 Check if two real (64 bits) arrays (rank 1) are equal. More...
 
subroutine assert_equal_c32_1 (this, c1, c2)
 Check if two complex (32 bits) arrays (rank 1) are equal. More...
 
subroutine assert_equal_c64_1 (this, c1, c2)
 Check if two complex (64 bits) arrays (rank 1) are equal. More...
 
subroutine assert_equal_l_1 (this, l1, l2)
 Check if two logical arrays (rank 1) are equal. More...
 
subroutine assert_positive_i8 (this, i)
 Check if a integer (32 bits) is positive. More...
 
subroutine assert_positive_i16 (this, i)
 Check if a integer (16 bits) is positive. More...
 
subroutine assert_positive_i32 (this, i)
 Check if a integer (32 bits) is positive. More...
 
subroutine assert_positive_i64 (this, i)
 Check if a integer (32 bits) is positive. More...
 
subroutine assert_positive_r32 (this, r)
 Check if a real (32 bits) is positive. More...
 
subroutine assert_positive_r64 (this, r)
 Check if a real (64 bits) is positive. More...
 
subroutine assert_positive_i8_1 (this, i)
 Check if a integer (8 bits) array (rank 1) is positive. More...
 
subroutine assert_positive_i16_1 (this, i)
 Check if a integer (16 bits) array (rank 1) is positive. More...
 
subroutine assert_positive_i32_1 (this, i)
 Check if a integer (32 bits) array (rank 1) is positive. More...
 
subroutine assert_positive_i64_1 (this, i)
 Check if a integer (64 bits) array (rank 1) is positive. More...
 
subroutine assert_positive_r32_1 (this, r)
 Check if a real (32 bits) array (rank 1) is positive. More...
 
subroutine assert_positive_r64_1 (this, r)
 Check if a real (64 bits) array (rank 1) is positive. More...
 
subroutine assert_close_r32 (this, r1, r2)
 Check if two reals (32 bits) are close with respect a tolerance. More...
 
subroutine assert_close_r64 (this, r1, r2)
 Check if two reals (64 bits) are close with respect a tolerance. More...
 
subroutine assert_close_r32_1 (this, r1, r2)
 Check if two real (32 bits) arrays (rank 1) are close with respect a tolerance. More...
 
subroutine assert_close_r64_1 (this, r1, r2)
 Check if two real (64 bits) arrays (rank 1) are close with respect a tolerance. More...
 
subroutine assert_close_c32 (this, c1, c2)
 Check if two complex numbers (32 bits) are close with respect a tolerance. More...
 
subroutine assert_close_c64 (this, r1, c2)
 Check if two complex numbers (64 bits) are close with respect a tolerance. More...
 
subroutine assert_close_c32_1 (this, c1, c2)
 Check if two complex (32 bits) arrays (rank 1) are close with respect a tolerance. More...
 
subroutine assert_close_c64_1 (this, c1, c2)
 Check if two real (64 bits) arrays (rank 1) are close with respect a tolerance. More...
 

Detailed Description

Routines to test Fortran programs.

fortran_tester is a pure-Fortran module. It provides a datatype to hold test results and routines to test for equality, closeness, and positivity of variables. The routines are overloaded and the resulting interface consists of a small number of names.

Definition at line 11 of file tester.f90.

Member Function/Subroutine Documentation

subroutine tester::assert_close_c32 ( class(tester_t), intent(inout)  this,
complex(real32), intent(in)  c1,
complex(real32), intent(in)  c2 
)
private

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

Parameters
[in,out]thisThe tester.
[in]c1Value to compare.
[in]c2Value to compare.

Definition at line 657 of file tester.f90.

subroutine tester::assert_close_c32_1 ( class(tester_t), intent(inout)  this,
complex(real32), dimension(:), intent(in)  c1,
complex(real32), dimension(:), intent(in)  c2 
)
private

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

Parameters
[in,out]thisThe tester.
[in]c1Value to compare.
[in]c2Value to compare.

Definition at line 685 of file tester.f90.

subroutine tester::assert_close_c64 ( class(tester_t), intent(inout)  this,
complex(real64), intent(in)  r1,
complex(real64), intent(in)  c2 
)
private

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

Parameters
[in,out]thisThe tester.
[in]r1Value to compare.
[in]c2Value to compare.

Definition at line 671 of file tester.f90.

subroutine tester::assert_close_c64_1 ( class(tester_t), intent(inout)  this,
complex(real64), dimension(:), intent(in)  c1,
complex(real64), dimension(:), intent(in)  c2 
)
private

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

Parameters
[in,out]thisThe tester.
[in]c1Value to compare.
[in]c2Value to compare.

Definition at line 703 of file tester.f90.

subroutine tester::assert_close_r32 ( class(tester_t), intent(inout)  this,
real(real32), intent(in)  r1,
real(real32), intent(in)  r2 
)
private

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

Parameters
[in,out]thisThe tester.
[in]r1Value to compare.
[in]r2Value to compare.

Definition at line 593 of file tester.f90.

subroutine tester::assert_close_r32_1 ( class(tester_t), intent(inout)  this,
real(real32), dimension(:), intent(in)  r1,
real(real32), dimension(:), intent(in)  r2 
)
private

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

Parameters
[in,out]thisThe tester.
[in]r1Value to compare.
[in]r2Value to compare.

Definition at line 621 of file tester.f90.

subroutine tester::assert_close_r64 ( class(tester_t), intent(inout)  this,
real(real64), intent(in)  r1,
real(real64), intent(in)  r2 
)
private

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

Parameters
[in,out]thisThe tester.
[in]r1Value to compare.
[in]r2Value to compare.

Definition at line 607 of file tester.f90.

subroutine tester::assert_close_r64_1 ( class(tester_t), intent(inout)  this,
real(real64), dimension(:), intent(in)  r1,
real(real64), dimension(:), intent(in)  r2 
)
private

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

Parameters
[in,out]thisThe tester.
[in]r1Value to compare.
[in]r2Value to compare.

Definition at line 639 of file tester.f90.

subroutine tester::assert_equal_c32 ( class(tester_t), intent(inout)  this,
complex(real32), intent(in)  c1,
complex(real32), intent(in)  c2 
)
private

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

Parameters
[in,out]thisThe tester.
[in]c1Value to compare.
[in]c2Value to compare.

Definition at line 237 of file tester.f90.

subroutine tester::assert_equal_c32_1 ( class(tester_t), intent(inout)  this,
complex(real32), dimension(:), intent(in)  c1,
complex(real32), dimension(:), intent(in)  c2 
)
private

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

Parameters
[in,out]thisThe tester.
[in]c1Value to compare.
[in]c2Value to compare.

Definition at line 384 of file tester.f90.

subroutine tester::assert_equal_c64 ( class(tester_t), intent(inout)  this,
complex(real64), intent(in)  c1,
complex(real64), intent(in)  c2 
)
private

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

Parameters
[in,out]thisThe tester.
[in]c1Value to compare.
[in]c2Value to compare.

Definition at line 250 of file tester.f90.

subroutine tester::assert_equal_c64_1 ( class(tester_t), intent(inout)  this,
complex(real64), dimension(:), intent(in)  c1,
complex(real64), dimension(:), intent(in)  c2 
)
private

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

Parameters
[in,out]thisThe tester.
[in]c1Value to compare.
[in]c2Value to compare.

Definition at line 402 of file tester.f90.

subroutine tester::assert_equal_i16 ( class(tester_t), intent(inout)  this,
integer(int16), intent(in)  i1,
integer(int16), intent(in)  i2 
)
private

Check if two integers (16 bits) are equal.

Parameters
[in,out]thisThe tester.
[in]i1Value to compare.
[in]i2Value to compare.

Definition at line 172 of file tester.f90.

subroutine tester::assert_equal_i16_1 ( class(tester_t), intent(inout)  this,
integer(int16), dimension(:), intent(in)  i1,
integer(int16), dimension(:), intent(in)  i2 
)
private

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

Parameters
[in,out]thisThe tester.
[in]i1Value to compare.
[in]i2Value to compare.

Definition at line 294 of file tester.f90.

subroutine tester::assert_equal_i32 ( class(tester_t), intent(inout)  this,
integer(int32), intent(in)  i1,
integer(int32), intent(in)  i2 
)
private

Check if two integers (32 bits) are equal.

Parameters
[in,out]thisThe tester.
[in]i1Value to compare.
[in]i2Value to compare.

Definition at line 185 of file tester.f90.

subroutine tester::assert_equal_i32_1 ( class(tester_t), intent(inout)  this,
integer(int32), dimension(:), intent(in)  i1,
integer(int32), dimension(:), intent(in)  i2 
)
private

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

Parameters
[in,out]thisThe tester.
[in]i1Value to compare.
[in]i2Value to compare.

Definition at line 312 of file tester.f90.

subroutine tester::assert_equal_i64 ( class(tester_t), intent(inout)  this,
integer(int64), intent(in)  i1,
integer(int64), intent(in)  i2 
)
private

Check if two integers (64 bits) are equal.

Parameters
[in,out]thisThe tester.
[in]i1Value to compare.
[in]i2Value to compare.

Definition at line 198 of file tester.f90.

subroutine tester::assert_equal_i64_1 ( class(tester_t), intent(inout)  this,
integer(int64), dimension(:), intent(in)  i1,
integer(int64), dimension(:), intent(in)  i2 
)
private

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

Parameters
[in,out]thisThe tester.
[in]i1Value to compare.
[in]i2Value to compare.

Definition at line 330 of file tester.f90.

subroutine tester::assert_equal_i8 ( class(tester_t), intent(inout)  this,
integer(int8), intent(in)  i1,
integer(int8), intent(in)  i2 
)
private

Check if two integers (8 bits) are equal.

Parameters
[in,out]thisThe tester.
[in]i1Value to compare.
[in]i2Value to compare.

Definition at line 159 of file tester.f90.

subroutine tester::assert_equal_i8_1 ( class(tester_t), intent(inout)  this,
integer(int8), dimension(:), intent(in)  i1,
integer(int8), dimension(:), intent(in)  i2 
)
private

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

Parameters
[in,out]thisThe tester.
[in]i1Value to compare.
[in]i2Value to compare.

Definition at line 276 of file tester.f90.

subroutine tester::assert_equal_l ( class(tester_t), intent(inout)  this,
logical, intent(in)  l1,
logical, intent(in)  l2 
)
private

Check if two logicals are equal.

Parameters
[in,out]thisThe tester.
[in]l1Value to compare.
[in]l2Value to compare.

Definition at line 263 of file tester.f90.

subroutine tester::assert_equal_l_1 ( class(tester_t), intent(inout)  this,
logical, dimension(:), intent(in)  l1,
logical, dimension(:), intent(in)  l2 
)
private

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

Parameters
[in,out]thisThe tester.
[in]l1Value to compare.
[in]l2Value to compare.

Definition at line 420 of file tester.f90.

subroutine tester::assert_equal_r32 ( class(tester_t), intent(inout)  this,
real(real32), intent(in)  r1,
real(real32), intent(in)  r2 
)
private

Check if two reals (32 bits) are equal.

Parameters
[in,out]thisThe tester.
[in]r1Value to compare.
[in]r2Value to compare.

Definition at line 211 of file tester.f90.

subroutine tester::assert_equal_r32_1 ( class(tester_t), intent(inout)  this,
real(real32), dimension(:), intent(in)  r1,
real(real32), dimension(:), intent(in)  r2 
)
private

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

Parameters
[in,out]thisThe tester.
[in]r1Value to compare.
[in]r2Value to compare.

Definition at line 348 of file tester.f90.

subroutine tester::assert_equal_r64 ( class(tester_t), intent(inout)  this,
real(real64), intent(in)  r1,
real(real64), intent(in)  r2 
)
private

Check if two reals (64 bits) are equal.

Parameters
[in,out]thisThe tester.
[in]r1Value to compare.
[in]r2Value to compare.

Definition at line 224 of file tester.f90.

subroutine tester::assert_equal_r64_1 ( class(tester_t), intent(inout)  this,
real(real64), dimension(:), intent(in)  r1,
real(real64), dimension(:), intent(in)  r2 
)
private

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

Parameters
[in,out]thisThe tester.
[in]r1Value to compare.
[in]r2Value to compare.

Definition at line 366 of file tester.f90.

subroutine tester::assert_positive_i16 ( class(tester_t), intent(inout)  this,
integer(int16), intent(in)  i 
)
private

Check if a integer (16 bits) is positive.

Parameters
[in,out]thisThe tester.
[in]iValue to check.

Definition at line 455 of file tester.f90.

subroutine tester::assert_positive_i16_1 ( class(tester_t), intent(inout)  this,
integer(int16), dimension(:), intent(in)  i 
)
private

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

Parameters
[in,out]thisThe tester.
[in]iValue to check.

Definition at line 528 of file tester.f90.

subroutine tester::assert_positive_i32 ( class(tester_t), intent(inout)  this,
integer(int32), intent(in)  i 
)
private

Check if a integer (32 bits) is positive.

Parameters
[in,out]thisThe tester.
[in]iValue to check.

Definition at line 467 of file tester.f90.

subroutine tester::assert_positive_i32_1 ( class(tester_t), intent(inout)  this,
integer(int32), dimension(:), intent(in)  i 
)
private

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

Parameters
[in,out]thisThe tester.
[in]iValue to check.

Definition at line 541 of file tester.f90.

subroutine tester::assert_positive_i64 ( class(tester_t), intent(inout)  this,
integer(int64), intent(in)  i 
)
private

Check if a integer (32 bits) is positive.

Parameters
[in,out]thisThe tester.
[in]iValue to check.

Definition at line 479 of file tester.f90.

subroutine tester::assert_positive_i64_1 ( class(tester_t), intent(inout)  this,
integer(int64), dimension(:), intent(in)  i 
)
private

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

Parameters
[in,out]thisThe tester.
[in]iValue to check.

Definition at line 554 of file tester.f90.

subroutine tester::assert_positive_i8 ( class(tester_t), intent(inout)  this,
integer(int8), intent(in)  i 
)
private

Check if a integer (32 bits) is positive.

Parameters
[in,out]thisThe tester.
[in]iValue to check.

Definition at line 443 of file tester.f90.

subroutine tester::assert_positive_i8_1 ( class(tester_t), intent(inout)  this,
integer(int8), dimension(:), intent(in)  i 
)
private

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

Parameters
[in,out]thisThe tester.
[in]iValue to check.

Definition at line 515 of file tester.f90.

subroutine tester::assert_positive_r32 ( class(tester_t), intent(inout)  this,
real(real32), intent(in)  r 
)
private

Check if a real (32 bits) is positive.

Parameters
[in,out]thisThe tester.
[in]rValue to check.

Definition at line 491 of file tester.f90.

subroutine tester::assert_positive_r32_1 ( class(tester_t), intent(inout)  this,
real(real32), dimension(:), intent(in)  r 
)
private

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

Parameters
[in,out]thisThe tester.
[in]rValue to check.

Definition at line 567 of file tester.f90.

subroutine tester::assert_positive_r64 ( class(tester_t), intent(inout)  this,
real(real64), intent(in)  r 
)
private

Check if a real (64 bits) is positive.

Parameters
[in,out]thisThe tester.
[in]rValue to check.

Definition at line 503 of file tester.f90.

subroutine tester::assert_positive_r64_1 ( class(tester_t), intent(inout)  this,
real(real64), dimension(:), intent(in)  r 
)
private

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

Parameters
[in,out]thisThe tester.
[in]rValue to check.

Definition at line 580 of file tester.f90.

subroutine tester::init ( class(tester_t), intent(out)  this,
real(real32), intent(in), optional  tolerance32,
real(real64), intent(in), optional  tolerance64 
)
private

Initialize the tester.

Parameters
[out]thisThe tester.
[in]tolerance32Real tolerance, 32 bits.
[in]tolerance64Real tolerance, 64 bits.

Definition at line 111 of file tester.f90.

subroutine tester::print ( class(tester_t), intent(in)  this,
logical, intent(in), optional  errorstop 
)
private

Print tests results.

Parameters
[in]thisThe tester.
[in]errorstopFlag to activate error stop if one test fails.

Definition at line 134 of file tester.f90.


The documentation for this module was generated from the following file: