ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation. |
This is the derived type test_type for generating objects that facilitate testing of a series of procedures or concepts within a unified testing framework. More...
Public Member Functions | |
procedure, pass | summarize => setTestSummary |
procedure, pass | assert => setTestAsserted |
procedure, pass | run => setTestFunc |
type(test_type) function | test_typer (host, inp, out, traceable) |
Generate and return an object of type test_type. More... | |
Public Attributes | |
logical(LK), public | traceable |
The protected scalar object of type logical of default kind LK, that can be used to control the display of debugging information for failed tests. See also the corresponding optional argument of the constructor.More... | |
type(dir_type), public | dir |
The public scalar object of type dir_type containing the input and output directories for the test data.More... | |
type(func_type), public | func |
The scalar object of type func_type containing the name of the current procedure being tested and the timer starting at the beginning of the current test (corresponding to the most recent call to the run() method of the object of type test_type.More... | |
type(scope_type), public | host |
The scalar object of type scope_type containing the name of the current host (scoping unit) being tested and the timer starting at the beginning of the creating the object of type test_type. More... | |
type(display_type), public | disp |
The public scalar of type display_type containing tools for displaying information in the desired output, for example, debugging information when a test fails.More... | |
type(image_type), public | image |
The public scalar of type image_type containing information about the parallel processes in parallel mode.More... | |
type(file_type), public | file |
The public scalar of type file_type that serves as convenience to store the unit number and file path of any working file during the testing.More... | |
Private Attributes | |
integer(IK) | counter = 0_IK |
The private scalar object of type integer of default kind IK, containing count of individual assertions made by the run() method of an object of type test_type.More... | |
logical(LK) | asserted = .true._LK |
The private scalar of type logical of default kind LK that is .true. if and only if all tests within the current test suite performed by an object of test_type have passed successfully. It is used for test summary.More... | |
This is the derived type test_type for generating objects that facilitate testing of a series of procedures or concepts within a unified testing framework.
This procedure is a constructor of test_type.
See also the documentation of test_typer, the constructor of test_type.
[in] | host | : The input scalar of type character of default kind SK containing the name of the host of the procedure or code that is being tested.Frequently, in modern Fortran, this is the name of the module containing the procedure being tested. This name is used only for information display purposes. (optional, default = SK_"" , that is, the target procedures to be tested are assumed to be external and not in a module or in any specific host scope.) |
[in] | inp | : The input scalar of type character of arbitrary length type parameter, containing the input directory for the current testing suite (i.e., all tests performed with the output object of this constructor).The specified value for this argument filles the corresponding inp component of the dir component of the output test object.(optional, default = SK_"./input" ) |
[in] | out | : The input scalar of type character of arbitrary length type parameter, containing the output directory for the current testing suite (i.e., all tests performed with the output object of this constructor).The specified value for this argument filles the corresponding out component of the out component of the output test object.(optional, default = SK_"./output" ) |
[in] | traceable | : The input scalar of type logical of default kind LK, that can be used to control the display of debugging information for failed tests.Specifying this argument directly sets the corresponding traceable component of the output test object.By convention, setting traceable to .true. is used within the test implementations to allow displaying information about assertion failures should any occur.The ability to display descriptive information about the source of a test failure and its origins if often desired at the time of debugging. Therefore, this component is set to .true. when runtime checks are enabled (i.e., FFP macro CHECK_ENABLED=1 is set, frequently corresponding to the debug mode) and .false. otherwise (frequently corresponding to the release mode).This optional input argument overrides the default behavior. Note that if traceable is set to .true._LK , the program will error stop by encountering the first test failure.(optional, default = .true._LK if the library is built with preprocessor macro CHECK_ENABLED=1 , otherwise .false._LK ) |
test
: The output scalar object of type test_type containing the specifics of the runtime system shell.
Possible calling interfaces ⛓
image_type()%sync
.impure
.
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
Definition at line 209 of file pm_test.F90.
procedure, pass pm_test::test_type::assert |
Definition at line 223 of file pm_test.F90.
procedure, pass pm_test::test_type::run |
Definition at line 224 of file pm_test.F90.
procedure, pass pm_test::test_type::summarize |
Definition at line 222 of file pm_test.F90.
type(test_type) function pm_test::test_type::test_typer | ( | character(*, SK), intent(in), optional | host, |
character(*, SK), intent(in), optional | inp, | ||
character(*, SK), intent(in), optional | out, | ||
logical(LK), intent(in), optional | traceable | ||
) |
Generate and return an object of type test_type.
This procedure is a constructor of test_type.
See also the documentation of test_type.
[in] | host | : The input scalar of type character of default kind SK containing the name of the host of the procedure or code that is being tested.Frequently, in modern Fortran, this is the name of the module containing the procedure being tested. This name is used only for information display purposes. (optional, default = SK_"@unknown_scope" , that is, the target procedures to be tested are assumed to be external and not in a module or in any specific host scope.) |
[in] | inp | : The input scalar of type character of arbitrary length type parameter, containing the input directory for the current testing suite (i.e., all tests performed with the output object of this constructor).The specified value for this argument filles the corresponding inp component of the dir component of the output test object.(optional, default = SK_"./input" ) |
[in] | out | : The input scalar of type character of arbitrary length type parameter, containing the output directory for the current testing suite (i.e., all tests performed with the output object of this constructor).The specified value for this argument filles the corresponding out component of the out component of the output test object.(optional, default = SK_"./output" ) |
[in] | traceable | : The input scalar of type logical of default kind LK, that can be used to control the display of debugging information for failed tests.Specifying this argument directly sets the corresponding traceable component of the output test object.By convention, setting traceable to .true. is used within the test implementations to allow displaying information about assertion failures should any occur.The ability to display descriptive information about the source of a test failure and its origins if often desired at the time of debugging. Therefore, this component is set to .true. when runtime checks are enabled (i.e., FFP macro CHECK_ENABLED=1 is set, frequently corresponding to the debug mode) and .false. otherwise (frequently corresponding to the release mode).This optional input argument overrides the default behavior. Note that if traceable is set to .true._LK , the program will error stop by encountering the first test failure.(optional, default = .true._LK if the library is built with preprocessor macro CHECK_ENABLED=1 , otherwise .false._LK ) |
test
: The output scalar object of type test_type containing the specifics of the runtime system shell.
Possible calling interfaces ⛓
impure
.
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
Definition at line 412 of file pm_test.F90.
References pm_test::setInitial().
|
private |
The private
scalar of type logical
of default kind LK that is .true.
if and only if all tests within the current test suite performed by an object of test_type have passed successfully. It is used for test summary.
Definition at line 211 of file pm_test.F90.
|
private |
The private
scalar object of type integer
of default kind IK, containing count of individual assertions made by the run()
method of an object of type test_type.
Definition at line 210 of file pm_test.F90.
type(dir_type), public pm_test::test_type::dir |
The public
scalar object of type dir_type containing the input and output directories for the test data.
Definition at line 213 of file pm_test.F90.
type(display_type), public pm_test::test_type::disp |
The public
scalar of type display_type containing tools for displaying information in the desired output, for example, debugging information when a test fails.
Definition at line 216 of file pm_test.F90.
type(file_type), public pm_test::test_type::file |
The public
scalar of type file_type that serves as convenience to store the unit number and file path of any working file during the testing.
Definition at line 218 of file pm_test.F90.
type(func_type), public pm_test::test_type::func |
The scalar object of type func_type containing the name of the current procedure being tested and the timer starting at the beginning of the current test (corresponding to the most recent call to the run()
method of the object of type test_type.
Definition at line 214 of file pm_test.F90.
type(scope_type), public pm_test::test_type::host |
The scalar object of type scope_type containing the name of the current host (scoping unit) being tested and the timer starting at the beginning of the creating the object of type test_type.
Definition at line 215 of file pm_test.F90.
type(image_type), public pm_test::test_type::image |
The public
scalar of type image_type containing information about the parallel processes in parallel mode.
Definition at line 217 of file pm_test.F90.
logical(LK), public pm_test::test_type::traceable |
The protected
scalar object of type logical
of default kind LK, that can be used to control the display of debugging information for failed tests. See also the corresponding optional
argument of the constructor.
Definition at line 212 of file pm_test.F90.