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.

Function/Subroutine Documentation

function mom_unit_testing/create_unit_test_basic(proc, name, fatal) [type(unittest)]

Return a new unit test without a cleanup function.

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

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

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

Called from:

mom_unit_testing::unittest::run

function mom_unit_testing/create_unit_test_full(proc, name, fatal, cleanup) [type(unittest)]

Return a new unit test with an explicit cleanup function.

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

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

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

  • cleanup :: Cleanup subroutine, called after test

Called from:

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

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

function mom_unit_testing/create_test_suite() [type(testsuite)]

Return a new test suite.

Called from:

mom_unit_testing::testsuite::run

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

add_unit_test_full

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

add_unit_test_basic

subroutine mom_unit_testing/run_test_suite(suite)
function mom_unit_testing/init_string_char(c) [type(string)]

Initialize string with a character array.

Parameters:

c :: [in] List of character arrays

Return:

undefined :: String output

function mom_unit_testing/init_string_int(n) [type(string)]

Convert an integer to a string.

Parameters:

n :: [in] Integer input

Return:

undefined :: String output

subroutine mom_unit_testing/create_test_file(filename, lines, mode)

Create a text file for unit testing.

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

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

  • mode :: [in] Permissions of new file

subroutine mom_unit_testing/delete_test_file(filename)

Delete a file created during testing.

Parameters:

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