unit

NAME

unit - functions for unit testing.

FUNCTIONS

After execution of run_test_cases, following variables will have value:

If you want to ignore some test case, just prefix them with underscore, so unit::run_test_cases will not see them.

If you want to run few subsets of test cases in one file, define each subset in it own subshell and execute unit::run_test_cases in each subshell.

Each test case is executed in it own subshell, so you can call exit in the test case or assign variables without any effect on subsequent test cases.

unit::run_test_cases will also call unit::set_up and unit::tear_down functions before and after each test case. By default, they do nothing. Override them to do something useful.

NOTES

All assert functions are executing exit instead of returning error code.