dm_test Module

Basic testing framework.


Uses

  • module~~dm_test~~UsesGraph module~dm_test dm_test module~dm_ansi dm_ansi module~dm_test->module~dm_ansi module~dm_ascii dm_ascii module~dm_test->module~dm_ascii module~dm_error dm_error module~dm_test->module~dm_error module~dm_kind dm_kind module~dm_test->module~dm_kind module~dm_time dm_time module~dm_test->module~dm_time module~dm_util dm_util module~dm_test->module~dm_util module~dm_uuid dm_uuid module~dm_test->module~dm_uuid module~dm_ansi->module~dm_ascii module~dm_error->module~dm_ascii module~dm_error->module~dm_kind iso_fortran_env iso_fortran_env module~dm_kind->iso_fortran_env module~dm_time->module~dm_error module~dm_time->module~dm_kind module~dm_time->module~dm_util module~dm_util->module~dm_error module~dm_util->module~dm_kind

Used by

  • module~~dm_test~~UsedByGraph module~dm_test dm_test module~dmpack dmpack module~dmpack->module~dm_test

Variables

Type Visibility Attributes Name Initial
integer, public, parameter :: TEST_LINE_LEN = 72
integer, public, parameter :: TEST_NAME_LEN = 32
integer, public, parameter :: TEST_STATE_UNKNOWN = 0
integer, public, parameter :: TEST_STATE_RUNNING = 1
integer, public, parameter :: TEST_STATE_PASSED = 2
integer, public, parameter :: TEST_STATE_FAILED = 3
logical, public, parameter :: TEST_PASSED = .true.
logical, public, parameter :: TEST_FAILED = .false.

Interfaces

public interface dm_test_dummy

Generic dummy type generator.

  • public impure elemental subroutine dm_test_dummy_beat(beat)

    Generates dummy beat data type.

    Arguments

    Type IntentOptional Attributes Name
    type(beat_type), intent(out) :: beat

    Beat type.

  • public impure elemental subroutine dm_test_dummy_log(log, timestamp)

    Generates dummy log data type.

    Arguments

    Type IntentOptional Attributes Name
    type(log_type), intent(out) :: log

    Log type.

    character(len=*), intent(in), optional :: timestamp

    Log timestamp (ISO 8601).

  • public pure elemental subroutine dm_test_dummy_node(node, id, name)

    Generates dummy sensor node data type.

    Arguments

    Type IntentOptional Attributes Name
    type(node_type), intent(out) :: node

    Node type.

    character(len=*), intent(in), optional :: id

    Node id.

    character(len=*), intent(in), optional :: name

    Node name.

  • public impure elemental subroutine dm_test_dummy_observ(observ, id, node_id, sensor_id, target_id, name, timestamp, nrequests, response_value)

    Generates dummy observation data type.

    Arguments

    Type IntentOptional Attributes Name
    type(observ_type), intent(out) :: observ

    Observation type.

    character(len=*), intent(in), optional :: id

    Observation id.

    character(len=*), intent(in), optional :: node_id

    Node id.

    character(len=*), intent(in), optional :: sensor_id

    Sensor id.

    character(len=*), intent(in), optional :: target_id

    Target id.

    character(len=*), intent(in), optional :: name

    Observation name.

    character(len=*), intent(in), optional :: timestamp

    Observation and request timestamp (ISO 8601).

    integer, intent(in), optional :: nrequests

    Number of requests.

    real(kind=r8), intent(in), optional :: response_value

    Response value.

  • public impure elemental subroutine dm_test_dummy_request(request, name, timestamp, nresponses, response_name, response_value)

    Generates dummy request data type.

    Arguments

    Type IntentOptional Attributes Name
    type(request_type), intent(out) :: request

    Request type.

    character(len=*), intent(in), optional :: name

    Request name.

    character(len=*), intent(in), optional :: timestamp

    Request timestamp (ISO 8601).

    integer, intent(in), optional :: nresponses

    Number of responses.

    character(len=*), intent(in), optional :: response_name

    Response name.

    real(kind=r8), intent(in), optional :: response_value

    Response value.

  • public pure elemental subroutine dm_test_dummy_sensor(sensor, node_id, id, name)

    Generates dummy sensor data type.

    Arguments

    Type IntentOptional Attributes Name
    type(sensor_type), intent(out) :: sensor

    Sensor type.

    character(len=*), intent(in), optional :: node_id

    Node id.

    character(len=*), intent(in), optional :: id

    Sensor id.

    character(len=*), intent(in), optional :: name

    Sensor name.

  • public pure elemental subroutine dm_test_dummy_target(target, id, name)

    Generates dummy target data type.

    Arguments

    Type IntentOptional Attributes Name
    type(target_type), intent(out) :: target

    Target type.

    character(len=*), intent(in), optional :: id

    Target id.

    character(len=*), intent(in), optional :: name

    Target name.


Abstract Interfaces

abstract interface

  • public function dm_test_callback()

    Logical test function that either returns TEST_PASSED or TEST_FAILED.

    Arguments

    None

    Return Value logical


Derived Types

type, public ::  test_type

Test type.

Components

Type Visibility Attributes Name Initial
character(len=TEST_NAME_LEN), public :: name = 'N/A'

Test name.

procedure(dm_test_callback), public, pointer, nopass :: proc => null()

Test procedure.


Functions

public function dm_test_skip(env_var) result(skip)

Returns .true. and outputs a debug message if environment variable of name env_var is set to 1.

Arguments

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

Name of the environment variable.

Return Value logical


Subroutines

public impure elemental subroutine dm_test_dummy_beat(beat)

Generates dummy beat data type.

Arguments

Type IntentOptional Attributes Name
type(beat_type), intent(out) :: beat

Beat type.

public impure elemental subroutine dm_test_dummy_log(log, timestamp)

Generates dummy log data type.

Arguments

Type IntentOptional Attributes Name
type(log_type), intent(out) :: log

Log type.

character(len=*), intent(in), optional :: timestamp

Log timestamp (ISO 8601).

public pure elemental subroutine dm_test_dummy_node(node, id, name)

Generates dummy sensor node data type.

Arguments

Type IntentOptional Attributes Name
type(node_type), intent(out) :: node

Node type.

character(len=*), intent(in), optional :: id

Node id.

character(len=*), intent(in), optional :: name

Node name.

public impure elemental subroutine dm_test_dummy_observ(observ, id, node_id, sensor_id, target_id, name, timestamp, nrequests, response_value)

Generates dummy observation data type.

Arguments

Type IntentOptional Attributes Name
type(observ_type), intent(out) :: observ

Observation type.

character(len=*), intent(in), optional :: id

Observation id.

character(len=*), intent(in), optional :: node_id

Node id.

character(len=*), intent(in), optional :: sensor_id

Sensor id.

character(len=*), intent(in), optional :: target_id

Target id.

character(len=*), intent(in), optional :: name

Observation name.

character(len=*), intent(in), optional :: timestamp

Observation and request timestamp (ISO 8601).

integer, intent(in), optional :: nrequests

Number of requests.

real(kind=r8), intent(in), optional :: response_value

Response value.

public impure elemental subroutine dm_test_dummy_request(request, name, timestamp, nresponses, response_name, response_value)

Generates dummy request data type.

Arguments

Type IntentOptional Attributes Name
type(request_type), intent(out) :: request

Request type.

character(len=*), intent(in), optional :: name

Request name.

character(len=*), intent(in), optional :: timestamp

Request timestamp (ISO 8601).

integer, intent(in), optional :: nresponses

Number of responses.

character(len=*), intent(in), optional :: response_name

Response name.

real(kind=r8), intent(in), optional :: response_value

Response value.

public pure elemental subroutine dm_test_dummy_sensor(sensor, node_id, id, name)

Generates dummy sensor data type.

Arguments

Type IntentOptional Attributes Name
type(sensor_type), intent(out) :: sensor

Sensor type.

character(len=*), intent(in), optional :: node_id

Node id.

character(len=*), intent(in), optional :: id

Sensor id.

character(len=*), intent(in), optional :: name

Sensor name.

public pure elemental subroutine dm_test_dummy_target(target, id, name)

Generates dummy target data type.

Arguments

Type IntentOptional Attributes Name
type(target_type), intent(out) :: target

Target type.

character(len=*), intent(in), optional :: id

Target id.

character(len=*), intent(in), optional :: name

Target name.

public subroutine dm_test_run(name, tests, stats, no_color)

Runs all tests in given array tests, returns test states in array stats.

Arguments

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

Test name.

type(test_type), intent(inout) :: tests(:)

Test types.

logical, intent(out) :: stats(:)

TEST_FAILED or TEST_PASSED.

logical, intent(in), optional :: no_color