sourcery_test_description_m Module

Define an abstraction for describing test intentions and test functions


Uses

  • module~~sourcery_test_description_m~~UsesGraph module~sourcery_test_description_m sourcery_test_description_m module~sourcery_string_m sourcery_string_m module~sourcery_test_description_m->module~sourcery_string_m module~sourcery_test_result_m sourcery_test_result_m module~sourcery_test_description_m->module~sourcery_test_result_m assert_m assert_m module~sourcery_string_m->assert_m module~sourcery_test_result_m->module~sourcery_string_m

Used by

  • module~~sourcery_test_description_m~~UsedByGraph module~sourcery_test_description_m sourcery_test_description_m module~sourcery_m sourcery_m module~sourcery_m->module~sourcery_test_description_m module~sourcery_test_description_s sourcery_test_description_s module~sourcery_test_description_s->module~sourcery_test_description_m module~sourcery_string_s sourcery_string_s module~sourcery_string_s->module~sourcery_m

Interfaces

public interface test_description_t

  • private module function construct_from_character(description, test_function) result(test_description)

    The result is a test_description_t object with the components defined by the dummy arguments

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: description
    procedure(test_function_i), intent(in), pointer :: test_function

    Return Value type(test_description_t)

  • private module function construct_from_string_t(description, test_function) result(test_description)

    The result is a test_description_t object with the components defined by the dummy arguments

    Arguments

    Type IntentOptional Attributes Name
    type(string_t), intent(in) :: description
    procedure(test_function_i), intent(in), pointer :: test_function

    Return Value type(test_description_t)

interface

  • private impure elemental module function contains_text(self, substring) result(match)

    The result is .true. if the test description includes the value of substring

    Arguments

    Type IntentOptional Attributes Name
    class(test_description_t), intent(in) :: self
    type(string_t), intent(in) :: substring

    Return Value logical

interface

  • private elemental module function equals(lhs, rhs) result(lhs_eq_rhs)

    The result is .true. if the components of the lhs & rhs are equal

    Arguments

    Type IntentOptional Attributes Name
    class(test_description_t), intent(in) :: lhs
    class(test_description_t), intent(in) :: rhs

    Return Value logical

interface

  • private impure elemental module function run(self) result(test_result)

    The result encapsulates the test description and test outcome

    Arguments

    Type IntentOptional Attributes Name
    class(test_description_t), intent(in) :: self

    Return Value type(test_result_t)


Abstract Interfaces

abstract interface

  • public function test_function_i() result(passes)

    Arguments

    None

    Return Value logical


Derived Types

type, public ::  test_description_t

Encapsulate test descriptions and test-functions

Components

Type Visibility Attributes Name Initial
type(string_t), private :: description_
procedure(test_function_i), private, pointer, nopass :: test_function_ => null()

Constructor

private module function construct_from_character (description, test_function)

The result is a test_description_t object with the components defined by the dummy arguments

private module function construct_from_string_t (description, test_function)

The result is a test_description_t object with the components defined by the dummy arguments

Type-Bound Procedures

procedure, public :: contains_text
generic, public :: operator(==) => equals
procedure, public :: run
procedure, private :: equals