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.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
character(len=:), | public, | allocatable | :: | test_description_substring |
Print the test results and increment the tallies of passing tests and total tests
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(test_t), | intent(in) | :: | test | |||
integer, | intent(inout) | :: | passes | |||
integer, | intent(inout) | :: | tests |
The result is an array of test results for subsequent reporting in the "report" type-bound procedure
The result is the name of the test specimen (the subject of testing)
Facilitate testing and test reporting
procedure, public :: report | |
procedure(results_interface), public, deferred, nopass :: results | |
procedure(subject_interface), public, deferred, nopass :: subject |