mom_unit_testing module reference

<undocumented>

More…

Data Types

unittestnode

UnitTest node of TestSuite's linked list.

Functions/Subroutines

create_unit_test_basic()

Return a new unit test without a cleanup function.

create_unit_test_full()

Return a new unit test with an explicit cleanup function.

run_unit_test()

Launch a unit test with a custom cleanup procedure.

create_test_suite()

Return a new test suite.

add_unit_test_basic()

add_unit_test_full()

run_test_suite()

init_string_char()

Initialize string with a character array.

init_string_int()

Convert an integer to a string.

create_test_file()

Create a text file for unit testing.

delete_test_file()

Delete a file created during testing.

Detailed Description

<undocumented>

Type Documentation

type  mom_unit_testing/unittestnode

UnitTest node of TestSuite’s linked list.

Type fields:
  • % test :: type(unittest), pointer, private Node contents.

  • % next :: type(unittestnode), pointer, private Pointer to next node in list.

[source]

Function/Subroutine Documentation

function  mom_unit_testing/create_unit_test_basic(proc, name, fatal)

Return a new unit test without a cleanup function.

Parameters:
  • proc :: proc Subroutine which defines the unit test

  • name :: name [in] Name of the unit test

  • fatal :: fatal [in] True if the test is expected to raise a FATAL error

Called from:

mom_unit_testing::unittest::run

[source]

function  mom_unit_testing/create_unit_test_full(proc, name, fatal, cleanup)

Return a new unit test with an explicit cleanup function.

Parameters:
  • proc :: proc Subroutine which defines the unit test

  • name :: name [in] Name of the unit test

  • fatal :: fatal True if the test is expected to raise a FATAL error

  • cleanup :: cleanup Cleanup subroutine, called after test

Called from:

mom_unit_testing::unittest::create_unit_test_basic mom_unit_testing::unittest::run

[source]

subroutine mom_unit_testing/run_unit_test(test)

Launch a unit test with a custom cleanup procedure.

Call to:

mom_error_handler::enable_fatal_errors

[source]

function  mom_unit_testing/create_test_suite()

Return a new test suite.

Called from:

mom_unit_testing::testsuite::run

[source]

subroutine mom_unit_testing/add_unit_test_basic(suite, test, name, fatal)
Call to:

add_unit_test_full

[source]

subroutine mom_unit_testing/add_unit_test_full(suite, test, name, fatal, cleanup)
Called from:

add_unit_test_basic

[source]

subroutine mom_unit_testing/run_test_suite(suite)

[source]

function  mom_unit_testing/init_string_char(c)

Initialize string with a character array.

Parameters:

c :: c [in] List of character arrays

Return:

undefined :: String output

[source]

function  mom_unit_testing/init_string_int(n)

Convert an integer to a string.

Parameters:

n :: n [in] Integer input

Return:

undefined :: String output

[source]

subroutine mom_unit_testing/create_test_file(filename, lines, mode)

Create a text file for unit testing.

Parameters:
  • filename :: filename [in] Name of file to be created

  • lines :: lines [in] list of strings to write to file

  • mode :: mode [in] Permissions of new file

[source]

subroutine mom_unit_testing/delete_test_file(filename)

Delete a file created during testing.

Parameters:

filename :: filename [in] Name of file to be deleted

Called from:

mom_file_parser_tests::cleanup_file_parser mom_file_parser_tests::cleanup_open_param_file_component mom_file_parser_tests::cleanup_open_param_file_netcdf

[source]

[source]