Holds tests and manages their executtion. Represents a set of procedures to test a certain feature. First node of the test linked list.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
class(Test), | public, | pointer | :: | test | Current test whose attributes are available to be set. |
Constructor interface for a TestSuite object.
Construct a new test suite.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | ts_name | Name of the test suite. |
Return the new test suite.
Destruct a test suite by deallocating its test pointer attribute.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(TestSuite), | intent(inout) | :: | self |
Add a Test object to the test suite and make it available for setup.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(TestSuite), | intent(inout) | :: | self | |||
class(Test), | intent(inout), | target | :: | ut | Object derived from the Test abstract type. |
Compact alternative to add a TestRealVal object to the test suite.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(TestSuite), | intent(inout) | :: | self | |||
type(TestRealVal), | intent(in) | :: | ut | An initialized TestRealVal object with the desired name. |
||
real(kind=wp), | intent(in) | :: | res | See TestRealVal. |
||
real(kind=wp), | intent(in) | :: | tgt | See TestRealVal. |
Compact alternative to add a TestRealArrVal object to the test suite.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(TestSuite), | intent(inout) | :: | self | |||
type(TestRealArrVal), | intent(in) | :: | ut | An initialized TestRealArrVal object with the desired name. |
||
real(kind=wp), | allocatable, dimension(:) | :: | res | See TestRealArrVal. |
||
real(kind=wp), | allocatable, dimension(:) | :: | tgt | See TestRealArrVal. |
Add a Test object to the test suite and make it available for setup.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(TestSuite), | intent(inout) | :: | self | |||
class(Test), | intent(inout), | target | :: | ut | Object derived from the Test abstract type. |
type, public :: TestSuite
!! Holds tests and manages their executtion.
!! Represents a set of procedures to test a certain feature.
!! First node of the test linked list.
integer, private :: n_tests
!! Number of tests in a test suite.
character(len=NAME_LENGTH), private :: test_suite_name
!! Name of the test suite.
class(Test), public, pointer :: test
!! Current test whose attributes are available to be set.
contains
procedure, public, pass :: addUnitTest
procedure, private, pass :: addTestRealVal
procedure, private, pass :: addTestRealArrVal
generic, public :: add => addUnitTest, addTestRealVal, addTestRealArrVal
procedure, public, pass :: runTests
final :: deleteTestSuite
end type TestSuite