sourcery_test_m Module

Define an abstract test_t type with deferred bindings ("subject" and "results") used by a type-bound procedure ("report") for reporting test results. The "report" procedure thus represents an implementation of the Template Method pattern.


Uses

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

Used by

  • module~~sourcery_test_m~~UsedByGraph module~sourcery_test_m sourcery_test_m module~sourcery_m sourcery_m module~sourcery_m->module~sourcery_test_m module~sourcery_test_s sourcery_test_s module~sourcery_test_s->module~sourcery_test_m module~sourcery_string_s sourcery_string_s module~sourcery_string_s->module~sourcery_m

Variables

Type Visibility Attributes Name Initial
character(len=:), public, allocatable :: test_description_substring

Interfaces

interface

  • private module subroutine report(test, passes, tests)

    Print the test results and increment the tallies of passing tests and total tests

    Arguments

    Type IntentOptional Attributes Name
    class(test_t), intent(in) :: test
    integer, intent(inout) :: passes
    integer, intent(inout) :: tests

Abstract Interfaces

abstract interface

  • private function results_interface() result(test_results)

    The result is an array of test results for subsequent reporting in the "report" type-bound procedure

    Arguments

    None

    Return Value type(test_result_t), allocatable, (:)

abstract interface

  • private pure function subject_interface() result(specimen)

    The result is the name of the test specimen (the subject of testing)

    Arguments

    None

    Return Value character(len=:), allocatable


Derived Types

type, public, abstract ::  test_t

Facilitate testing and test reporting

Type-Bound Procedures

procedure, public :: report
procedure(results_interface), public, deferred, nopass :: results
procedure(subject_interface), public, deferred, nopass :: subject