ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
pm_test::test_type Interface Reference

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...
 

Detailed Description

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.

Parameters
[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)
Returns
test : The output scalar object of type test_type containing the specifics of the runtime system shell.


Possible calling interfaces

use pm_test, only: test_type
type(test_type) :: test
test = test_type(host = host, inp = inp, out = out, traceable = traceable)
This module contains a simple unit-testing framework for the Fortran libraries, including the ParaMon...
Definition: pm_test.F90:42
This is the derived type test_type for generating objects that facilitate testing of a series of proc...
Definition: pm_test.F90:209
Warning
This procedure must be called by all images/processes in parallel mode as it contains a call to image_type()%sync.
Remarks
The procedures under discussion are impure.
See also
test_type


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.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

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.

Author:
Amir Shahmoradi, Tuesday March 7, 2017, 3:50 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin

Definition at line 209 of file pm_test.F90.

Member Function/Subroutine Documentation

◆ assert()

procedure, pass pm_test::test_type::assert

Definition at line 223 of file pm_test.F90.

◆ run()

procedure, pass pm_test::test_type::run

Definition at line 224 of file pm_test.F90.

◆ summarize()

procedure, pass pm_test::test_type::summarize

Definition at line 222 of file pm_test.F90.

◆ test_typer()

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.

Parameters
[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)
Returns
test : The output scalar object of type test_type containing the specifics of the runtime system shell.


Possible calling interfaces

use pm_test, only: test_type
type(test_type) :: test
test = test_type(host = host, inp = inp, out = out, traceable = traceable)
Warning
This procedure must be called by all images/processes in parallel mode as it contains a call to image_type()%sync()`.
Remarks
The procedures under discussion are impure.
See also
test_type


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.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

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.

Author:
Amir Shahmoradi, Tuesday March 7, 2017, 3:50 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin

Definition at line 412 of file pm_test.F90.

References pm_test::setInitial().

Here is the call graph for this function:

Member Data Documentation

◆ dir

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.

◆ disp

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.

◆ file

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.

◆ func

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.

◆ host

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.

◆ image

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.

◆ traceable

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.


The documentation for this interface was generated from the following file: