unit_test Derived Type

type, public :: unit_test


Inherited by

type~~unit_test~~InheritedByGraph type~unit_test unit_test type~unit_tests unit_tests type~unit_tests->type~unit_test test

Components

Type Visibility Attributes Name Initial
character(len=64), private :: group
character(len=64), private :: msg
character(len=64), private :: name
logical, private :: result = .false.
logical, private :: silent = .false.

Type-Bound Procedures

  • private subroutine unit_test_r0(this, res, expected, tol, msg, name, group)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Arguments

    Type IntentOptional Attributes Name
    class(unit_test), intent(inout) :: this
    real(kind=rk), intent(in) :: res
    real(kind=rk), intent(in) :: expected
    real(kind=rk), intent(in), optional :: tol
    character(len=*), intent(in), optional :: msg
    character(len=*), intent(in), optional :: name
    character(len=*), intent(in), optional :: group
  • private subroutine unit_test_r1(this, res, expected, tol, msg, name, group)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Arguments

    Type IntentOptional Attributes Name
    class(unit_test), intent(inout) :: this
    real(kind=rk), intent(in), dimension(:) :: res
    real(kind=rk), intent(in), dimension(:) :: expected
    real(kind=rk), intent(in), optional :: tol
    character(len=*), intent(in), optional :: msg
    character(len=*), intent(in), optional :: name
    character(len=*), intent(in), optional :: group
  • private subroutine unit_test_r2(this, res, expected, tol, msg, name, group)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Arguments

    Type IntentOptional Attributes Name
    class(unit_test), intent(inout) :: this
    real(kind=rk), intent(in), dimension(:,:) :: res
    real(kind=rk), intent(in), dimension(:,:) :: expected
    real(kind=rk), intent(in), optional :: tol
    character(len=*), intent(in), optional :: msg
    character(len=*), intent(in), optional :: name
    character(len=*), intent(in), optional :: group
  • private subroutine unit_test_i0(this, res, expected, msg, name, group)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Arguments

    Type IntentOptional Attributes Name
    class(unit_test), intent(inout) :: this
    integer, intent(in) :: res
    integer, intent(in) :: expected
    character(len=*), intent(in), optional :: msg
    character(len=*), intent(in), optional :: name
    character(len=*), intent(in), optional :: group
  • private subroutine unit_test_i1(this, res, expected, msg, name, group)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Arguments

    Type IntentOptional Attributes Name
    class(unit_test), intent(inout) :: this
    integer, intent(in), dimension(:) :: res
    integer, intent(in), dimension(:) :: expected
    character(len=*), intent(in), optional :: msg
    character(len=*), intent(in), optional :: name
    character(len=*), intent(in), optional :: group
  • private subroutine unit_test_i2(this, res, expected, msg, name, group)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Arguments

    Type IntentOptional Attributes Name
    class(unit_test), intent(inout) :: this
    integer, intent(in), dimension(:,:) :: res
    integer, intent(in), dimension(:,:) :: expected
    character(len=*), intent(in), optional :: msg
    character(len=*), intent(in), optional :: name
    character(len=*), intent(in), optional :: group
  • private subroutine unit_test_l0(this, res, expected, msg, name, group)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Arguments

    Type IntentOptional Attributes Name
    class(unit_test), intent(inout) :: this
    logical, intent(in) :: res
    logical, intent(in) :: expected
    character(len=*), intent(in), optional :: msg
    character(len=*), intent(in), optional :: name
    character(len=*), intent(in), optional :: group
  • private subroutine unit_test_l1(this, res, expected, msg, name, group)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Arguments

    Type IntentOptional Attributes Name
    class(unit_test), intent(inout) :: this
    logical, intent(in), dimension(:) :: res
    logical, intent(in), dimension(:) :: expected
    character(len=*), intent(in), optional :: msg
    character(len=*), intent(in), optional :: name
    character(len=*), intent(in), optional :: group
  • private subroutine unit_test_l2(this, res, expected, msg, name, group)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Arguments

    Type IntentOptional Attributes Name
    class(unit_test), intent(inout) :: this
    logical, intent(in), dimension(:,:) :: res
    logical, intent(in), dimension(:,:) :: expected
    character(len=*), intent(in), optional :: msg
    character(len=*), intent(in), optional :: name
    character(len=*), intent(in), optional :: group
  • private subroutine unit_test_cx0(this, res, expected, tol, msg, name, group)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Arguments

    Type IntentOptional Attributes Name
    class(unit_test), intent(inout) :: this
    complex(kind=rk), intent(in) :: res
    complex(kind=rk), intent(in) :: expected
    real(kind=rk), intent(in), optional :: tol
    character(len=*), intent(in), optional :: msg
    character(len=*), intent(in), optional :: name
    character(len=*), intent(in), optional :: group
  • private subroutine unit_test_cx1(this, res, expected, tol, msg, name, group)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Arguments

    Type IntentOptional Attributes Name
    class(unit_test), intent(inout) :: this
    complex(kind=rk), intent(in), dimension(:) :: res
    complex(kind=rk), intent(in), dimension(:) :: expected
    real(kind=rk), intent(in), optional :: tol
    character(len=*), intent(in), optional :: msg
    character(len=*), intent(in), optional :: name
    character(len=*), intent(in), optional :: group
  • private subroutine unit_test_cx2(this, res, expected, tol, msg, name, group)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Arguments

    Type IntentOptional Attributes Name
    class(unit_test), intent(inout) :: this
    complex(kind=rk), intent(in), dimension(:,:) :: res
    complex(kind=rk), intent(in), dimension(:,:) :: expected
    real(kind=rk), intent(in), optional :: tol
    character(len=*), intent(in), optional :: msg
    character(len=*), intent(in), optional :: name
    character(len=*), intent(in), optional :: group

procedure, private :: print_msg

  • private subroutine print_msg(this, result)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Arguments

    Type IntentOptional Attributes Name
    class(unit_test), intent(inout) :: this
    logical, intent(in) :: result

procedure, private :: set_silent

  • private elemental subroutine set_silent(this)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Arguments

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

procedure, private :: unit_test_cx0

  • private subroutine unit_test_cx0(this, res, expected, tol, msg, name, group)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Arguments

    Type IntentOptional Attributes Name
    class(unit_test), intent(inout) :: this
    complex(kind=rk), intent(in) :: res
    complex(kind=rk), intent(in) :: expected
    real(kind=rk), intent(in), optional :: tol
    character(len=*), intent(in), optional :: msg
    character(len=*), intent(in), optional :: name
    character(len=*), intent(in), optional :: group

procedure, private :: unit_test_cx1

  • private subroutine unit_test_cx1(this, res, expected, tol, msg, name, group)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Arguments

    Type IntentOptional Attributes Name
    class(unit_test), intent(inout) :: this
    complex(kind=rk), intent(in), dimension(:) :: res
    complex(kind=rk), intent(in), dimension(:) :: expected
    real(kind=rk), intent(in), optional :: tol
    character(len=*), intent(in), optional :: msg
    character(len=*), intent(in), optional :: name
    character(len=*), intent(in), optional :: group

procedure, private :: unit_test_cx2

  • private subroutine unit_test_cx2(this, res, expected, tol, msg, name, group)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Arguments

    Type IntentOptional Attributes Name
    class(unit_test), intent(inout) :: this
    complex(kind=rk), intent(in), dimension(:,:) :: res
    complex(kind=rk), intent(in), dimension(:,:) :: expected
    real(kind=rk), intent(in), optional :: tol
    character(len=*), intent(in), optional :: msg
    character(len=*), intent(in), optional :: name
    character(len=*), intent(in), optional :: group

procedure, private :: unit_test_i0

  • private subroutine unit_test_i0(this, res, expected, msg, name, group)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Arguments

    Type IntentOptional Attributes Name
    class(unit_test), intent(inout) :: this
    integer, intent(in) :: res
    integer, intent(in) :: expected
    character(len=*), intent(in), optional :: msg
    character(len=*), intent(in), optional :: name
    character(len=*), intent(in), optional :: group

procedure, private :: unit_test_i1

  • private subroutine unit_test_i1(this, res, expected, msg, name, group)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Arguments

    Type IntentOptional Attributes Name
    class(unit_test), intent(inout) :: this
    integer, intent(in), dimension(:) :: res
    integer, intent(in), dimension(:) :: expected
    character(len=*), intent(in), optional :: msg
    character(len=*), intent(in), optional :: name
    character(len=*), intent(in), optional :: group

procedure, private :: unit_test_i2

  • private subroutine unit_test_i2(this, res, expected, msg, name, group)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Arguments

    Type IntentOptional Attributes Name
    class(unit_test), intent(inout) :: this
    integer, intent(in), dimension(:,:) :: res
    integer, intent(in), dimension(:,:) :: expected
    character(len=*), intent(in), optional :: msg
    character(len=*), intent(in), optional :: name
    character(len=*), intent(in), optional :: group

procedure, private :: unit_test_l0

  • private subroutine unit_test_l0(this, res, expected, msg, name, group)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Arguments

    Type IntentOptional Attributes Name
    class(unit_test), intent(inout) :: this
    logical, intent(in) :: res
    logical, intent(in) :: expected
    character(len=*), intent(in), optional :: msg
    character(len=*), intent(in), optional :: name
    character(len=*), intent(in), optional :: group

procedure, private :: unit_test_l1

  • private subroutine unit_test_l1(this, res, expected, msg, name, group)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Arguments

    Type IntentOptional Attributes Name
    class(unit_test), intent(inout) :: this
    logical, intent(in), dimension(:) :: res
    logical, intent(in), dimension(:) :: expected
    character(len=*), intent(in), optional :: msg
    character(len=*), intent(in), optional :: name
    character(len=*), intent(in), optional :: group

procedure, private :: unit_test_l2

  • private subroutine unit_test_l2(this, res, expected, msg, name, group)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Arguments

    Type IntentOptional Attributes Name
    class(unit_test), intent(inout) :: this
    logical, intent(in), dimension(:,:) :: res
    logical, intent(in), dimension(:,:) :: expected
    character(len=*), intent(in), optional :: msg
    character(len=*), intent(in), optional :: name
    character(len=*), intent(in), optional :: group

procedure, private :: unit_test_r0

  • private subroutine unit_test_r0(this, res, expected, tol, msg, name, group)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Arguments

    Type IntentOptional Attributes Name
    class(unit_test), intent(inout) :: this
    real(kind=rk), intent(in) :: res
    real(kind=rk), intent(in) :: expected
    real(kind=rk), intent(in), optional :: tol
    character(len=*), intent(in), optional :: msg
    character(len=*), intent(in), optional :: name
    character(len=*), intent(in), optional :: group

procedure, private :: unit_test_r1

  • private subroutine unit_test_r1(this, res, expected, tol, msg, name, group)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Arguments

    Type IntentOptional Attributes Name
    class(unit_test), intent(inout) :: this
    real(kind=rk), intent(in), dimension(:) :: res
    real(kind=rk), intent(in), dimension(:) :: expected
    real(kind=rk), intent(in), optional :: tol
    character(len=*), intent(in), optional :: msg
    character(len=*), intent(in), optional :: name
    character(len=*), intent(in), optional :: group

procedure, private :: unit_test_r2

  • private subroutine unit_test_r2(this, res, expected, tol, msg, name, group)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Arguments

    Type IntentOptional Attributes Name
    class(unit_test), intent(inout) :: this
    real(kind=rk), intent(in), dimension(:,:) :: res
    real(kind=rk), intent(in), dimension(:,:) :: expected
    real(kind=rk), intent(in), optional :: tol
    character(len=*), intent(in), optional :: msg
    character(len=*), intent(in), optional :: name
    character(len=*), intent(in), optional :: group

Source Code

   type unit_test
      character(len=64), private :: msg
      character(len=64), private :: name
      character(len=64), private :: group
      logical, private :: result = .false.
      logical, private :: silent = .false.
   contains
      procedure, private :: print_msg

      procedure, private :: unit_test_r0
      procedure, private :: unit_test_r1
      procedure, private :: unit_test_r2

      procedure, private :: unit_test_i0
      procedure, private :: unit_test_i1
      procedure, private :: unit_test_i2

      procedure, private :: unit_test_l0
      procedure, private :: unit_test_l1
      procedure, private :: unit_test_l2

      procedure, private :: unit_test_cx0
      procedure, private :: unit_test_cx1
      procedure, private :: unit_test_cx2

      generic :: check => unit_test_r0, unit_test_r1, unit_test_r2, &
         unit_test_i0, unit_test_i1, unit_test_i2, &
         unit_test_l0, unit_test_l1, unit_test_l2, &
         unit_test_cx0, unit_test_cx1, unit_test_cx2

      procedure, private :: set_silent
   end type unit_test