unit_tests Module

A module containing functions for running unit tests Is the relative error of the first argument with respect to the correct answer less than err? If the correct value is 0.0, then err is treated as an absolute error

Announce the start of the given test (to let the user know which one failed!)

Take the logical result of the test (true for pass), and either announce its success or announce its failure then stop.

Announce the start of the given partial test (to let the user know which one failed!)

Take the logical result of the check (partial test) (true for pass), and either announce its success or announce its failure.

Returns true when the verbosity is greater than or equal to the argument

Print a debug message if verbosity is higher than given verbosity_level. Also print list mode/trinity job id if appropriate

Set job id, for running in list mode or within trinity

Trinity or list mode job id


Contents


Variables

Type Visibility Attributes Name Initial
integer, public :: job_id

Interfaces

public interface agrees_with

  • private function agrees_with_real(val, correct, err)

    Arguments

    Type IntentOptional Attributes Name
    real, intent(in) :: val
    real, intent(in) :: correct
    real, intent(in) :: err

    Return Value logical

  • private function agrees_with_real_1d_array(val, correct, err)

    Arguments

    Type IntentOptional Attributes Name
    real, intent(in), dimension(:) :: val
    real, intent(in), dimension(:) :: correct
    real, intent(in) :: err

    Return Value logical

  • private function agrees_with_complex_1d_array(val, correct, err)

    Arguments

    Type IntentOptional Attributes Name
    complex, intent(in), dimension(:) :: val
    complex, intent(in), dimension(:) :: correct
    real, intent(in) :: err

    Return Value logical

  • private function agrees_with_integer(val, correct)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: val
    integer, intent(in) :: correct

    Return Value logical

private interface should_be

  • private subroutine should_be_int(val, rslt)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: val
    integer, intent(in) :: rslt
  • private subroutine should_be_real(val, rslt)

    Arguments

    Type IntentOptional Attributes Name
    real, intent(in) :: val
    real, intent(in) :: rslt

Functions

private function proc_message()

Arguments

None

Return Value character(len=16)

private function agrees_with_integer(val, correct)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: val
integer, intent(in) :: correct

Return Value logical

private function agrees_with_complex_1d_array(val, correct, err)

Arguments

Type IntentOptional Attributes Name
complex, intent(in), dimension(:) :: val
complex, intent(in), dimension(:) :: correct
real, intent(in) :: err

Return Value logical

private function agrees_with_real_1d_array(val, correct, err)

Arguments

Type IntentOptional Attributes Name
real, intent(in), dimension(:) :: val
real, intent(in), dimension(:) :: correct
real, intent(in) :: err

Return Value logical

private function agrees_with_real(val, correct, err)

Arguments

Type IntentOptional Attributes Name
real, intent(in) :: val
real, intent(in) :: correct
real, intent(in) :: err

Return Value logical

public function should_print(verbosity_level)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: verbosity_level

Return Value logical


Subroutines

private subroutine should_be_int(val, rslt)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: val
integer, intent(in) :: rslt

private subroutine should_be_real(val, rslt)

Arguments

Type IntentOptional Attributes Name
real, intent(in) :: val
real, intent(in) :: rslt

public subroutine announce_test(test_name)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: test_name

public subroutine process_test(rslt, test_name)

Arguments

Type IntentOptional Attributes Name
logical, intent(in) :: rslt
character(len=*), intent(in) :: test_name

public subroutine announce_check(test_name)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: test_name

public subroutine process_check(test_result, rslt, test_name)

Arguments

Type IntentOptional Attributes Name
logical, intent(inout) :: test_result
logical, intent(in) :: rslt
character(len=*), intent(in) :: test_name

public subroutine announce_module_test(module_name)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: module_name

public subroutine close_module_test(module_name)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: module_name

public subroutine print_with_stars(str1, str2)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: str1
character(len=*), intent(in) :: str2

public subroutine debug_message(verbosity_level, message)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: verbosity_level
character(len=*), intent(in) :: message

public subroutine set_job_id(jid)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: jid