[top]
NAME
XXX_tsuite -- munit test suite to test XXX.
USAGE
INPUTS
OUTPUTS
ts = tsuite structure for XXX testsuite.
SIDE EFFECTS
DESCRIPTION
AUTHOR
Charlie Cornish
CREATION DATE
COPYRIGHT
CREDITS
REVISION
$Revision$
[top]
NAME
tsuite_tcase -- munit test case to test tsuite functions.
USAGE
INPUTS
OUTPUTS
tc = tsuite structure for tsuite_tcase.
SIDE EFFECTS
DESCRIPTION
AUTHOR
Charlie Cornish
CREATION DATE
2004-Apr-27
COPYRIGHT
CREDITS
REVISION
$Revision: 80 $
[top]
NAME
XXX_tsensemble -- munit test suite to test XXX.
USAGE
INPUTS
OUTPUTS
ts = tsensemble structure for XXX testsensemble.
SIDE EFFECTS
DESCRIPTION
AUTHOR
Charlie Cornish
CREATION DATE
COPYRIGHT
CREDITS
REVISION
$Revision$
[top]
NAME
XXX_tcase -- munit test case to test XXX.
USAGE
run_tcase('XXX_tcase')
INPUTS
OUTPUTS
tc = tcase structure for XXX testcase.
SIDE EFFECTS
DESCRIPTION
SEE ALSO
XXX
AUTHOR
Charlie Cornish
CREATION DATE
COPYRIGHT
CREDITS
REVISION
$Revision$
[top]
NAME
tcase_tcase -- munit test case to test tcase functions.
USAGE
INPUTS
OUTPUTS
tc = tcase structure for tcase_tcase.
SIDE EFFECTS
DESCRIPTION
AUTHOR
Charlie Cornish
CREATION DATE
2004-Apr-27
COPYRIGHT
CREDITS
REVISION
$Revision: 97 $
[top]
NAME
tc_summary_tcase -- munit test case to test tcase summary functions.
USAGE
INPUTS
OUTPUTS
tc = tcase structure for tc_summary_tcase.
SIDE EFFECTS
DESCRIPTION
AUTHOR
Charlie Cornish
CREATION DATE
2004-Apr-27
COPYRIGHT
CREDITS
REVISION
$Revision: 92 $
NAME
run_tsuite -- Run a MUnit test suite. SYNOPSIS run_tsuite(tsuite, [mode], [logfile])
INPUTS
* tsuite -- test suite. * mode -- (optional) level of detail for output diagnostics. * logfile -- (optional) name of log file for writing output. * tcase_list -- (optional) name(s) or ordinal number(s) of specific tests to run. (string or integer, or cell array of strings or integer).
OUTPUTS
* ts_summary -- a test suite summary struct (ts_summary_s).
SIDE EFFECTS
SYNOPSIS run_tsuite(tsuite) % default run_tsuite(tsuite, mode) % specify level of detail mode. run_tsuite(tsuite, '', logfile) % specify log file. run_tsuite(tsuite, '', '', tcase_list) % specify tcases to run.
DESCRIPTION
run_tsuite is the main driver for running a test suite. mode argument controls level of detail of output as follows: * 'silent' -- no output. * 'minimal' -- print test case summary. * 'normal' -- print names of failed tests and test case summary. * 'verbose' -- print all test names and their status, and test case summary. * 'details' -- print diagnostics while running tests as well all test names and their status, and test case summary. If logfile is specified, output is written to logfile. Note: Info printed by tested functions is still displayed to console.
EXAMPLE
WARNINGS
ERRORS
NOTES
BUGS
TODO
ALGORITHM
REFERENCES
SEE ALSO
TOOLBOX munit/munit CATEGORY Application Drivers
AUTHOR
Charlie Cornish
CREATION DATE
2004-04-28
COPYRIGHT
(c) 2004, 2005 Charles R. Cornish
CREDITS
REVISION
$Revision: 112 $
NAME
run_tcase -- Run a MUnit test case and print the test results. SYNOPSIS tc_summary = run_tcase(tcase, [mode], [logfile], [test_list])
INPUTS
* tcase -- test case (string, function handle, or tcase_s). * mode -- (optional) level of detail for output diagnostics. * logfile -- (optional) name of log file for writing output. * test_list -- (optional) name(s) or ordinal number(s) of specific tests to run. (string or integer, or cell array of strings or integer).
OUTPUTS
* tc_summary -- test case summary struct (tc_summary_s). SYNOPSIS run_tcase(tcase) % default run_tcase(tcase, mode) % specify level of detail mode. run_tcase(tcase, '', logfile) % specify log file. run_tcase(tcase, '', '', test_list) % specify tests to run.
SIDE EFFECTS
DESCRIPTION
run_tcase is the main driver for running a test case. tcase is one of the following: * string containing name of test case (i.e. file/function) to run. * function handle of the test case to run (@tcase). * a test case struct (tcase_s). The mode argument controls level of detail of output as follows: * 'silent' -- no output. * 'minimal' -- print test case summary. * 'normal' -- print names of failed tests and test case summary. * 'verbose' -- print all test names and their status, and test case summary. * 'details' -- print diagnostics while running tests as well all test names and their status, and test case summary. If logfile is specified, output is written to logfile. Note that info printed by tested functions is still displayed to command window. The test_list argument allows the optional execution of specific test(s) within test case. By default, all tests within a test case are run. If test_list is a string or cell array of strings, then the tests with the matching names are run. If test_list is a number or cell array of numbers, then the tests with matching order in the test list are run, i.e. if test_list = {1, 3}, then the first and third tests are run. If items in test_list that do not match by test name or test order number are ignored.
EXAMPLE
WARNINGS
ERRORS
MUNIT:UnknownTestCase
NOTES
BUGS
TODO
ALGORITHM
REFERENCES
SEE ALSO
TOOLBOX munit/munit CATEGORY Application Drivers
AUTHOR
Charlie Cornish
CREATION DATE
2004-Apr-28
COPYRIGHT
(c) 2004, 2005 Charles R. Cornish
CREDITS
REVISION
$Revision: 112 $
NAME
MUnit Variables
DESCRIPTION
Description of variables used in MUnit. TOOLBOX munit/munit CATEGORY
NAME
mode -- mode for level of detail of print output.
DESCRIPTION
mode controls the level of detail of print output as follows: * 'silent' -- no output. * errors * 'minimal' -- print * errors * test case and/or test suite summaries. * 'normal' -- print * errors * test results report of failed tests * test case and/or test suite summaries. * 'verbose' -- print * errors * full test results report. * test case and/or test suite summaries. * 'details' -- print * errors * diagnostics while running tests * full test results report. * test case and/or test suite summaries. Note: For all modes, info printed durning execution of tested functions is displayed to command window.
NAME
tcase -- test case.
DESCRIPTION
The tcase variable specifies a test case and can be one of the following types: * a string containing name of a test case function * a function handle (@tcase) to a test case function * a test case struct (tcase_s).
NAME
trstatus -- numeric status code of a test result.
DESCRIPTION
trstatus can take on the following values: * 1 -- 'SUCCESS' * 0 -- 'FAIL' * -1 -- 'ERROR' * NaN -- otherwise
SEE ALSO
MU_lookup_tresult_status_by_name
NAME
tsuite -- test suite
DESCRIPTION
The tsuite variable specifies a test suite and can be one of the following types: * a string containing name of a test suite function * a function handle (@tsuite) to a test suite function * a test suite struct (tsuite_s).
[top]
NAME
Template Files
DESCRIPTION
MUnit template files: * files: tsuite_template.m tcase_template.m
NAME
MUnit Structures -- structs used in MUnit.
DESCRIPTION
MATLAB struts used in MUnit. TOOLBOX munit/munit CATEGORY
NAME
tc_summary_s -- test case summary struct.
DESCRIPTION
The test result summary struct (tc_summary_s) summarizes the execution of tests in a test case and has the following fields: * ntests -- number of tests run * npass -- number of tests passed * nfails -- number of test failed * nerrs -- number of tests returning errors * percentPassed -- percent of tests passed * failedTests -- list of failed tests (cell string array) * failedTestNums -- ordinal number of the failed test in test case (vector). * erroredTests -- list of tests that errored (cell string array) * erroredTestNums -- ordinal number of the erroed test in test case (vector). * elapsedWallTime -- elapsed wall time to run test case * elapsedCPUTime -- elapsed cpu time to run test case. The MU_summarize_tresults function creates a tc_summary_s struct and updates all fields, except elapsedwalltime and elapsedcputime.
SEE ALSO
MU_summarize_tresults
NAME
tcase_s -- test case structure.
DESCRIPTION
tcase_s struct has fields: * name -- name of test case (string) * pathstr -- optional path to location of tcase mfile (string). * tests -- cell array of function handles to test functions (@tfh). * tresults -- test case results (vector of tresult_s). The MU_tcase_new function creates and initializes an empty tcase_s struct.
SEE ALSO
MU_tcase_new
NAME
tresult_s -- test result structure.
DESCRIPTION
tresult_s struct contains the results of an executed test and has the following fields: * trstatus -- test result status code. * tcname -- name of associated test case. * testfh -- function handle of test. * message -- supplementary message associated with test execution.
NAME
ts_result_s -- test suite result structure.
DESCRIPTION
tresult_s struct contains the results of an executed test suite and has the following fields: * tcase -- name of associated test case. * tresults -- vector of tresult_s structs for associated test case. * tc_summary -- tc_summary_s struct for associated test case.
NAME
ts_summary_s -- test suite summary struct.
DESCRIPTION
The test result summary struct (ts_summary_s) summarizes the execution of tests in a suite of test cases and has the following fields: * tsname -- name of test suite. * ntcases -- number of test cases run. * ntests -- number of tests run. * npass -- number of tests passed. * nfails -- number of test failed. * nerrs -- number of tests returning errors. * percentPassed -- percent of tests passed.
NAME
tsuite_s -- test suite structure.
DESCRIPTION
tsuite_s struct has fields: * name -- name of test suite (string). * pathstr -- optional path to location of tsuite mfile (string). * tcases -- vector of test case structures (tcase_s). * trsummaries -- optional path to location of tcase mfile (string). The MU_tsuite_new function creates and initializes an empty tsuite_s struct.
SEE ALSO
MU_tsuite_new
NAME
lib.assert -- MUnit Library assert functions.
DESCRIPTION
Functions in MUnit library used to assert the comparison of actual test results to expected values.
NAME
lib.tresult -- MUnit Library reporting functions.
DESCRIPTION
Functions in MUnit library used for creating and print test results and tcase/tsuite summaries.
NAME
lib.tcase -- MUnit Library tcase functions.
DESCRIPTION
Functions in MUnit library used to create, run, summarize and report a test case:
NAME
lib.tsuite -- MUnit Library tsuite functions.
DESCRIPTION
Functions in MUnit library used to create, run, summarize and report a test suite.
NAME
lib.utils -- MUnit Library utils functions.
DESCRIPTION
Functions in MUnit library used for various utility purposes.
NAME
MUnit Library
DESCRIPTION
The MUnit library is a collection of functions to be used implement test cases and test suites, assert tests, and compile and print test results. The functions in the MUnit library are intended to be use in creating and executing test via the test case and test suite framework and are not indeeded to be called directly from the command line. Functions in the MUnit library are prefixed by MU_. Functions within the MUnit library are categorized as follows: lib.assert -- Assert functions to compare of actual test results to expected values. lib.tcase -- Functions for implementing a test case. lib.tsuite -- Functions for implementing a test suite. lib.report -- Functions for creating and printing test results and test case/suite summaries. TOOLBOX munit/munit CATEGORY
[top]
NAME
Introduction
DESCRIPTION
Add detailed introduction.
NAME
MUNIT:AssertionFailedError -- assertion failed.
DESCRIPTION
MUNIT:AssertionFailedError indicates that an assertion has failed.
NAME
MUNIT:InvalidArgumentType -- Invalid argument type.
DESCRIPTION
MUNIT:InvalidArgumentType indicates that the argument to function has invalid data type.
NAME
MUNIT:MissingRequiredArgument -- required argument missing.
DESCRIPTION
MUNIT:MissingRequiredArgument indicates that a required argument is missing from the argument list to the function call.
NAME
MUNIT:UnknownTest -- Test function not found.
DESCRIPTION
MUNIT:UnknownTest indicates that a test specified by a test function handle (@tfh) or alternatively by the file test_location does not exist or could not be found.
NAME
MUNIT:UnknownTestCase -- Test case not found.
DESCRIPTION
MUNIT:UnknownTestCase indicates that a test case specified by a file name, function handle, or test case struct does not exist or could not be found.
NAME
MUNIT:UnknownTestSuite -- Test suite not found.
DESCRIPTION
MUNIT:UnknownTestSuite indicates that a test suite specified by a file name, function handle, or test suite struct does not exist or could not be found.
NAME
MUnit Errors -- errror message ids.
DESCRIPTION
MATLAB error message ids used in MUnit. TOOLBOX munit/munit CATEGORY
NAME
MUnit Drivers -- MUnit applications for executing test cases and test suites.
DESCRIPTION
The MUnit driver applications are functions to be run from the command shell to execute a test case or a test suite. Driver applications include: * run_tcase * run_tsuite
NAME
MUnit Utilities -- MUnit applications analyzing and listing test cases and suites.
DESCRIPTION
The MUnit utility applications are functions to be run from the command shell to analyze and list a test case or a test suite. Utility applications include: * list_tcase * list_tsuite
NAME
MUnit Applications
DESCRIPTION
The MUnit test framework consists of several applications to execute and manage the test cases and test suites. The application functions are categorized as: * Drivers -- execute test cases and test suites. * Utilities -- manage test cases and test suites. TOOLBOX munit/munit CATEGORY
NAME
MUnit-API -- MUnit Application Programming Interface
DESCRIPTION
The MUnit API is a library of functions and associated structures, error codes and standard variable names that implement the MUnit test framework.
[top]
NAME
Overview
DESCRIPTION
MUnit is a framework for unit testing of MATLAB functions.
SEE ALSO
MUnit_Introduction, MUnit_Applications, MUnit_API, MUnit_Templates
[top]
NAME
MU_tsuite_run -- Run a test suite. SYNOPSIS tr = MU_tsuite_run(ts, [mode], [tests_to_run])
INPUTS
* ts -- a test suite struct (tsuite_s). * mode -- (optional) mode for level of detail of output. * tests_to_run -- (optional) name(s) of specific tests to run (string or cell array of strings).
OUTPUTS
* ts_results -- vector of test suite result structs (ts_result_s).
DESCRIPTION
Function runs the test cases in the test suite ts. See MUnit_Variables for a description of mode. Note: For all modes, info printed by tested functions is still displayed to command window.
SEE ALSO
mode, MU_tcase_run, MU_print_tresults_report MU_print_tcase_summary TOOLBOX munit/munit CATEGORY MUNIT Library: Test Suite Functions
NAME
MU_tsuite_new -- Creates a new (empty) test suite structure. SYNOPSIS tc = MU_tsuite_new(name)
INPUTS
* name -- name of test suite (string).
OUTPUTS
* ts -- an empty test suitestruct (tsuite_s).
DESCRIPTION
Function creates and returns a new test suite structure. name must be specified and non-blank. tsuite_s struct has fields: * name -- name of test suite (string). * tcases -- vector of tcase structures (tcase_s). * trsummaries -- vector of trsummary structs (trsummary_s). Note: length(ts.trsummaries) = length(ts.tscases) after run of tsuite.
EXAMPLE
ts = MU_tsuite_new('mytestsuite');
ERRORS
MUNIT:MissingRequiredArgument
SEE ALSO
TOOLBOX munit/munit CATEGORY MUNIT Library: Test Suite Functions
NAME
MU_tsuite_list_tests -- List the tests in a test case. SYNOPSIS MU_tsuite_list_tests(tc)
INPUTS
* ts -- a loaded test case struct (tsuite_s).
OUTPUTS
(none)
DESCRIPTION
Function prints the test cases for the specified test suite.
SEE ALSO
TOOLBOX munit/munit CATEGORY MUNIT Library: Test Suite Functions
NAME
MU_tsuite_create -- Create and load a test tsuite. SYNOPSIS ts = MU_tsuite_create(tsuite)
INPUTS
* tsuite -- name of test suite (string or function handle).
OUTPUTS
* ts -- loaded tsuite struc (tsuite_s).
DESCRIPTION
Function creates via MU_tcase_new and loads the tsuite found in tsuite file (tsuite) or function handle (@tsuite).
EXAMPLE
tsuite = 'mytestsuite'; ts = MU_tsuite_create(tsuite); % use a filename. ts = MU_tsuite_create(@tsuite); % use a function handle
ERRORS
MUNIT:MissingRequiredArgument MUNIT:UnknownTestSuite
SEE ALSO
MU_tcase_new TOOLBOX munit/munit CATEGORY MUNIT Library: Test Suite Functions
NAME
MU_tsuite_add_tcase -- Add a test case struct to test suite struc.
USAGE
[ts] = MU_tsuite_add_tcase(ts, tc)
INPUTS
* ts -- test suite struct (tsuite_s). * tc -- test case struct (tcase_s).
OUTPUTS
* ts -- test suite struct (tsuite_s).
DESCRIPTION
Function adds a tcase to a tsuite structure.
SEE ALSO
MU_tsuite_create TOOLBOX munit/munit CATEGORY MUNIT Library: Test Suite Functions
NAME
MU_tresult_create -- Create a new test result struct (tresult_s). SYNPOSIS tr = MU_tresult_create(tcname, tfh)
INPUTS
* tcname -- name of test case associated with test result (string). * tfh -- function handle of test associated with test result (@tfh).
OUTPUTS
* tr -- test result struct (tresult_s).
DESCRIPTION
Function creates and initializes a test result struct (tresult_s). Test result struct has the following fields: * trstatus -- result of test execution. * tcname -- name of associated test case. * testfh -- function handle of test. * message -- supplementary message associated with test execution.
SEE ALSO
TOOLBOX munit/munit CATEGORY MUNIT Library: Reporting Functions
NAME
MU_tcase_run_test -- Run specified test within a test case. SYNOPSIS tr = MU_tcase_run_test(tc, tfh, [mode])
INPUTS
* tc -- a loaded test case struct (tcase_s). * tfh -- function handle to test function. * mode -- (optional) mode for level of detail of output.
OUTPUTS
* tr -- a test result struct (tresult_s).
DESCRIPTION
Function runs a specified test for test case. See MUnit_Variables for a description of mode.
SEE ALSO
mode, MU_tresult_create, MU_lookup_tresult_status_by_name TOOLBOX munit/munit CATEGORY MUNIT Library: Test Case Functions
NAME
MU_tcase_run -- Run a test case. SYNOPSIS tresults = MU_tcase_run(tc, [mode], [tests_to_run])
INPUTS
* tc -- loaded test case struct (tcase_s). * mode -- (optional) mode for level of detail of output (string). * tests_to_run -- (optional) name(s) of specific tests to run (string or cell array of strings).
OUTPUTS
* tresults -- vector of test result structures (tresult_s).
DESCRIPTION
Function runs the tests in a test case and returns the test results for each test. See MUnit_Variables for a description of mode. Note: For all modes, info printed by tested functions is still displayed to command window. The tests_to_run argument allows the optional execution of specific test(s) within test case. By default, all tests within a test case are run. If tests_to_run is not empty, then only the tests with the matching names are run.
SEE ALSO
mode, MU_tcase_run_test, tcase_s, tresult_s TOOLBOX munit/munit CATEGORY MUNIT Library: Test Case Functions
NAME
MU_tcase_new -- Creates a new (empty) test case structure. SYNOPSIS tc = MU_tcase_new(name)
INPUTS
* name -- name of test case (string).
OUTPUTS
* tc -- an empty test case struct (tcase_s).
SIDE EFFECTS
name must be specified and non-blank; otherwise error.
DESCRIPTION
Function creates and returns a new (empty) test case structure tcase_s. tcase_s structure has fields: * name -- name of test case (string). * pathstr -- optional path to location of tcase mfile (string). * tests -- cell array of function handles to test functions. * tresults -- test case results (vector of tresult_s). name is the only required argument. pathstr, tests, and tresults are initialized to empty.
EXAMPLE
tc = MU_tcase_new('mytestcase');
ERRORS
MUNIT:MissingRequiredArgument
SEE ALSO
TOOLBOX munit/munit CATEGORY MUNIT Library: Test Case Functions
NAME
MU_tcase_list_tests -- List the tests in a test case. SYNOPSIS MU_tcase_list_tests(tc)
INPUTS
* tc -- a loaded test case struct (tcase_s).
OUTPUTS
(none)
DESCRIPTION
Function prints the tests for the specified test.
SEE ALSO
TOOLBOX munit/munit CATEGORY MUNIT Library: Test Case Functions
NAME
MU_tcase_create -- Create and load a tcase. SYNOPSIS tc = MU_tcase_create(tcase)
INPUTS
* tcase -- name of test case (string or function handle).
OUTPUTS
* tc -- loaded tcase_s struct (tcase_s).
DESCRIPTION
Function creates via MU_tcase_new and loads the tcase found in tcase file (tcase) or function handle (@tcase).
EXAMPLE
tcase = 'mytestcase'; tc = MU_tcase_create(tcase); % use a filename. tc = MU_tcase_create(@tcase); % use a function handle
ERRORS
MUNIT:MissingRequiredArgument MUNIT:UnknownTestCase
SEE ALSO
MU_tcase_new TOOLBOX munit/munit CATEGORY MUNIT Library: Test Case Functions
NAME
MU_tcase_add_test -- Add a test to test case. SYNPOSIS [tc] = MU_tcase_add_test(tc, tfh, [test_location])
INPUTS
* tc -- test case struct (tcase_s). * tfh -- function handle to the test function (@tfh). * test_location -- (optional) location of test if different from tc.name (string).
OUTPUTS
* tc -- test case struct (tcase_s).
EXAMPLE
tc = MU_tcase_add_test(tc, @test1) % Default tc = MU_tcase_add_test(tc, @test2, test2_location) % Specify test location.
DESCRIPTION
Function adds a test to a test case by verifying that the function handle to the test function exists, and, if successful, adds its test function handle to the set of tests for the test case tc. To verify the existance of the function handle tfh, a check is made to determine if a function with a name associated with the tfh is found in the test case file ( = tc.name). Alternatively, if test_location is specified, the test referenced by @tfh may reside in a file other than the the tcase function file. A check is made to verify that test function associated with @tfh exists in the file specitifed by test_location.
ERRORS
MUNIT:UnknownTest -- Test function not found.
SEE ALSO
MU_tcase_create TOOLBOX munit/munit CATEGORY MUNIT Library: TestCase Functions
NAME
MU_summarize_ts_results -- Summarize the test suite results. SYNOPSIS ts_summary = MU_summarize_ts_results(ts_results)
INPUTS
* tcname -- name of associated test suite. * ts_results -- vector of test suite result structs (ts_result_s).
OUTPUTS
* ts_summary -- a test suite summary struct (ts_summary_s).
DESCRIPTION
Function summarizes the test case summaries contained in the ts_results vector and returns the test suite summary in ts_summary struct. Test suite summary struct (ts_summary_s) has the following fields: * tsname -- name of associated test suite. * ntcases -- number of test cases. * ntests -- number of tests run. * npass -- number of tests passed. * nfails -- number of test failed. * nerrs -- number of tests returning errors. * percentPassed -- percent of tests passed.
SEE ALSO
TOOLBOX munit/munit CATEGORY MUNIT Library: Reporting Functions
NAME
MU_summarize_tresults -- Summarize a set of test results. SYNOPSIS tc_summary = MU_summarize_tresults(tresults)
INPUTS
* tc -- test case struct (tcase_s). * tresults -- vector of test result structs (tresult_s).
OUTPUTS
* tc_summary -- test case summary struct (tc_summary_s).
DESCRIPTION
Function summarizes the results of the test results in the tresults vector and returns summary in test result summary struct. Test result summary struct (tc_summary_s) struct has the following fields: * tcname -- name of associated test case * ntests -- number of tests run * npass -- number of tests passed * nfails -- number of test failed * nerrs -- number of tests returning errors * percentPassed -- percent of tests passed * failedTests -- list of failed tests (cell string array) * failedTestNums -- ordinal number of the failed test in test case (vector). * erroredTests -- list of tests that errored (cell string array) * erroredTestNums -- ordinal number of the erroed test in test case (vector). * elapsedWallTime -- elapsed wall time to run test case * elapsedCPUTime -- elapsed cpu time to run test case.
SEE ALSO
TOOLBOX munit/munit CATEGORY MUNIT Library: Reporting Functions
NAME
MU_print_tsuite_summary -- Print summary for a test suite. SYNOPSIS MU_tcase_print_summary(ts, [mode])
INPUTS
* ts -- a test suite struct (tsuite_s). * mode -- (optional) mode for level of detail of output.
OUTPUTS
* ts_summary -- a test suite summary struct (ts_summary_s).
SIDE EFFECTS
Test suite summary displayed or printed to log file.
DESCRIPTION
Function prints the summary for test suite. See MUnit_Variables for a description of mode.
SEE ALSO
TOOLBOX munit/munit CATEGORY MUNIT Library: Reporting Functions
NAME
MU_print_tresults_report.m -- Print test case results. SYNOPSIS MU_print_tresults_report.m(tresults, [mode])
INPUTS
* tcname -- name of associated test case. * tresults -- vector of test result structs (tresult_s). * mode -- (optional) mode for level of detail of output.
OUTPUTS
(none)
SIDE EFFECTS
Test results printed to command window.
DESCRIPTION
Function prints the test results in the tresults vector. See MUnit_Variables for a description of mode.
SEE ALSO
TOOLBOX munit/munit CATEGORY MUNIT Library: Reporting Functions
NAME
MU_print_tresults -- Print test case results. SYNOPSIS MU_print_tresults(tresults, [mode])
INPUTS
* tresults -- vector of test result structs (tresult_s). * mode -- (optional) mode for level of detail of output.
OUTPUTS
nrec -- number of test result records printed (interger).
SIDE EFFECTS
Test results printed to command window.
DESCRIPTION
Function prints the test results in the tresults vector. See MUnit_Variables for a description of mode.
SEE ALSO
tresult_s TOOLBOX munit/munit CATEGORY MUNIT Library: Reporting Functions
NAME
MU_print_tcase_summary -- Print a test case summary. SYNOPSIS MU_print_tcase_summary(tc_summary)
INPUTS
tc_summary = test case summary struct.
OUTPUTS
(none)
SIDE EFFECTS
Test case summary printed to display or log file.
DESCRIPTION
Function prints a summary of a test case run. See MUnit_Variables for a description of mode. TOOLBOX munit/munit CATEGORY MUNIT Library: Reporting Functions
NAME
MU_lookup_tresult_status_by_name -- Return the numeric test result status code by test result status name. SYNOPSIS trstatus = MU_lookup_tresult_status_by_name(name)
INPUTS
* name -- test result status name (string).
OUTPUTS
* trstatus -- numeric test result status code (integer)
DESCRIPTION
Function lookups and returns the numeric test result status code for specified test result status name as follows: * 'SUCCESS' = 1 * 'FAIL' = 0 * 'ERROR' = -1 * otherwise = NaN;
SEE ALSO
TOOLBOX munit/munit CATEGORY MUNIT Library: Test Result Functions
NAME
MU_lookup_mode_num_by_name -- Return the numeric mode code by mode name. SYNOPSIS mode_num = MU_lookup_mode_num_by_name(mode)
INPUTS
* mode -- mode name (string).
OUTPUTS
* mode_num -- numeric mode code (integer)
DESCRIPTION
Function lookups and returns the numeric mode code for for specified mode as follows: * 'silent' = 1 * 'minimal' = 2 * 'normal' = 3 * 'verbose' = 4 * 'details' = 5 * 'stoponerror' = 6 stoponerror mode always execution to stop upon error and display the stack leading up to the error.
SEE ALSO
TOOLBOX munit/munit CATEGORY MUNIT Library: Test Result Functions
NAME
MU_fail_line -- Encode function name, line number and message of failure into error message string and call MU_fail. SYNPOSIS MU_fail_line([funcname], [linenum], [message])
INPUTS
* funcname -- (optional) name of function that failed (assertion occurred) (string). * linenum -- (optional) line number where error occurred in funcname (integer). * message -- (optional) supplemental message (string).
OUTPUTS
(none)
DESCRIPTION
Function is a wrapper function that encodes the function name and line number where an assertion error occurred along with supplmental message into error string and then calls MU_fail which throws an assertion error.
ERRORS
MUNIT:AssertionFailedError (via MU_fail). TOOLBOX munit/munit CATEGORY MUNIT Library: Error Assert Functions
NAME
MU_fail -- Throw error for a failed assertion. SYNPOSIS MU_fail([msg])
INPUTS
* msg -- (optional) error message (string).
OUTPUTS
(none)
SIDE EFFECTS
MUNIT:AssertionFailedError is thrown.
DESCRIPTION
Function throws the MUNIT:AssertionFailedError and passes the specified message.
ERRORS
MUNIT:AssertionFailedError TOOLBOX munit/munit CATEGORY MUNIT Library: Error Assert Functions
NAME
MU_assert_numsigdig_diff -- Assert that expected and actual values are equal within number of significant digits. SYNOPSIS MU_assert_numsigdig_diff(expected_value, actual_value, [numsigdig], [message])
INPUTS
* expected_value -- expected value. * actual_value -- actual value. * numsigdig -- (optional) minimum tolerance or threshold Valid values: integers >= 0 Default: 0 * message -- (optional) supplemental message (character string). * mode -- (optional) level of detail for output diagnostics.
OUTPUTS
(none)
DESCRIPTION
Function checks that expected and actual values are equal within numsigdig sigificiant digits. If not, it calls MU_fail to throw MUNIT:AssertionFailedError. mode argument controls level of detail of output as follows: 'details' = print diagnostics while running tests as well all test names and their status, and test case summary. otherwise, no output printed.
ERRORS
MUNIT:AssertionFailedError (via MU_fail).
SEE ALSO
numsigdig_diff TOOLBOX munit/munit CATEGORY MUNIT Library: Assert Functions
NAME
MU_assert_istrue -- Assert that actual value is Boolean true. SYNPOSIS MU_assert_istrue(actual_value, [message])
INPUTS
* actual_value -- actual values (object) * message -- (optional) supplemental message (character string).
OUTPUTS
(none)
DESCRIPTION
Function checks actual value evaluates to Boolena true. If not, it calls MU_fail to throw MUNIT:AssertionFailedError.
ERRORS
MUNIT:AssertionFailedError (via MU_fail). TOOLBOX munit/munit CATEGORY MUNIT Library: Assert Functions
NAME
MU_assert_isnotempty -- Assert that actual value is not empty. SYNPOSIS MU_assert_isnotempty(actual_value, [message])
INPUTS
* actual_value -- actual values (object) * message -- (optional) supplemental message (character string).
OUTPUTS
(none)
DESCRIPTION
Function checks actual value is not empty. If empty, it calls MU_fail to throw MUNIT:AssertionFailedError.
ERRORS
MUNIT:AssertionFailedError (via MU_fail). TOOLBOX munit/munit CATEGORY MUNIT Library: Assert Functions
NAME
MU_assert_isequalwithequalnans -- Assert that expected and actual values are equal with equal NaNs. SYNPOSIS MU_assert_isequalwithequalnans(expected_values, actual_values, [message])
INPUTS
* expected_value -- vector or array of expected values (number). * actual_value -- vector or array of actual values (number). * message -- (optional) supplemental message (string).
OUTPUTS
(none)
DESCRIPTION
Function checks that expected and actual values are equal, treating NaNs as equals. If not, it calls MU_fail to throw MUNIT:AssertionFailedError.
ERRORS
MUNIT:AssertionFailedError (via MU_fail). TOOLBOX munit/munit CATEGORY MUNIT Library: Assert Functions
NAME
MU_assert_isequal -- Assert that expected and actual values are equal. SYNPOSIS MU_assert_isequal(expected_value, actual_value, [message])
INPUTS
* expected_value -- vector or array of expected values (number). * actual_value -- vector or array of actual values (number). * message -- (optional) supplemental message (string).
OUTPUTS
(none)
DESCRIPTION
Function checks that expected and actual values are equal. If not, it calls MU_fail to throw MUNIT:AssertionFailedError.
ERRORS
MUNIT:AssertionFailedError (via MU_fail). TOOLBOX munit/munit CATEGORY MUNIT Library: Assert Functions
NAME
MU_assert_isempty -- Assert that actual value is empty. SYNPOSIS MU_assert_isempty(actual_value, [message])
INPUTS
* actual_value -- actual values (object) * message -- (optional) supplemental message (character string).
OUTPUTS
(none)
DESCRIPTION
Function checks actual value is empty. If not empty, it calls MU_fail to throw MUNIT:AssertionFailedError.
ERRORS
MUNIT:AssertionFailedError (via MU_fail). TOOLBOX munit/munit CATEGORY MUNIT Library: Assert Functions
NAME
MU_assert_fuzzy_diff -- Assert that expected and actual values are within fuzzy diff tolerance. SYNOPSIS MU_assert_fuzzy_diff(expected_value, actual_value, [fuzzy_tol], [message])
INPUTS
* expected_value -- vector or array of expected values (number). * actual_value -- vector or array of actual values (number). * fuzzy_tol -- (optional) minimum tolerance or threshold Valid values: >= 0 Default: 0 * message -- (optional) supplemental message (string).
DESCRIPTION
Function checks that expected and actual values are equal within fuzzy tolerance. If not, it calls MU_fail to throw MUNIT:AssertionFailedError.
ERRORS
MUNIT:AssertionFailedError (via MU_fail).
SEE ALSO
fuzzy_diff TOOLBOX munit/munit CATEGORY MUNIT Library: Assert Functions
NAME
fuzzy_diff -- Compare two arrays and identify or summarize those elements with differences exceeding the fuzzy tolerance.
USAGE
result = fuzzy_diff(a, b, [fuzzy_tol], [mode])
INPUTS
* a -- first array or vector of values * b -- second array or vector of values * fuzzy_tol -- (optional) minimum tolerance or threshold Valid values: >= 0 Default: 0 * mode -- (optional) format of returned result Valid Values: 'detailed', 'summary' Default: 'detailed'
OUTPUTS
result = array or scalar containing the result of comparison.
DESCRIPTION
fuzzy_diff compares two arrays and allows approximate equality when strict equality may not exist due to minor differences due to rounding errors. fuzzy_diff subtracts two arrays and identifies those elements whose differences exceed the fuzzy tolerance threshold. The function has 2 modes of operation specified via mode: detailed = return an array of size(a) with elements = 0, for differences between a and b < fuzzy_tolerance = a-b, for differences between a and b >= fuzzy_tolerance summary = return a number whose values = 0, for no differences within fuzzy_tolerance > 0, number of elements >= fuzzy_tolerance
NAME
MU_assert_expression -- Assert that expression is true. SYNPOSIS MU_assert_expression(expression, [message])
INPUTS
* expression -- expression to evaluate (string). * message -- (optional) supplemental message (string).
OUTPUTS
(none)
DESCRIPTION
Function evaluates the expression in the caller's workspace and evaluates whether it is true or not. If not true, it calls MU_fail to throw MUNIT:AssertionFailedError.
ERRORS
MUNIT:AssertionFailedError (via MU_fail). TOOLBOX munit/munit CATEGORY MUNIT Library: Assert Functions
NAME
MU_assert_error -- Assert that expected and actual error message ids are equal. SYNOPSIS MU_assert_error(expected_msg_id, actual_msg_id, [message])
INPUTS
* expected_msg_id -- expected message id. * actual_msg_id -- actual message id. * message -- (optional) supplemental message (string)
OUTPUTS
(none)
DESCRIPTION
Function checks that expected and actual error message ids are equal. If not, it calls MU_fail to throw MUNIT:AssertionFailedError.
ERRORS
MUNIT:AssertionFailedError (via MU_fail). TOOLBOX munit/munit CATEGORY MUNIT Library: Assert Functions
AUTHOR
Charlie Cornish
CREATION DATE
2004-Apr-27
COPYRIGHT
(c) Charles R. Cornish 2004, 2005
CREDITS
REVISION
$Revision: 111 $
NAME
list_tsuite -- List the test cases in a MUnit test suite. SYNOPSIS list_tsuite(tsuite, [logfile])
INPUTS
* tsuite -- test suite (string or function handle). * logfile -- (optional) name of log file for writing output.
OUTPUTS
(none)
USAGE
list_tsuite(tsuite) % default list_tsuite(tsuite, logfile) % specify log file.
SIDE EFFECTS
Prints the names of the test cases in the specified test suite.
DESCRIPTION
list_tsuite is a utility application for listing test cases in a test suite. tsuite is one of the following: * string containing name of test case (i.e. file/function) to run. * function handle of the test case to run. * a test case struct. If logfile is specified, output is written to logfile.
EXAMPLE
WARNINGS
ERRORS
MUNIT:UnknownTestSuite
NOTES
BUGS
TODO
ALGORITHM
REFERENCES
SEE ALSO
TOOLBOX munit/munit CATEGORY Application Utilties
AUTHOR
Charlie Cornish
CREATION DATE
2005-Nov-08
COPYRIGHT
CREDITS
REVISION
$Revision: 82 $
NAME
list_tcase -- List the tests in a MUnit test case. SYNOPSIS list_tcase(tcase, [logfile])
INPUTS
* tcase -- test case (string or function handle). * logfile -- (optional) name of log file for writing output.
OUTPUTS
(none)
USAGE
list_tcase(tcase) % default list_tcase(tcase, logfile) % specify log file.
SIDE EFFECTS
Prints the tests in the specified test case.
DESCRIPTION
list_tcase is a utility application for listing tests in a test case. tcase is one of the following: * string containing name of test case (i.e. file/function) to run. * function handle of the test case to run. * a test case struct. If logfile is specified, output is written to logfile.
EXAMPLE
WARNINGS
ERRORS
MUNIT:UnknownTestCase
NOTES
BUGS
TODO
ALGORITHM
REFERENCES
SEE ALSO
TOOLBOX munit/munit CATEGORY Application Utilties
AUTHOR
Charlie Cornish
CREATION DATE
2005-Nov-08
COPYRIGHT
CREDITS
REVISION
$Revision: 84 $
[top]
NAME
assert_tcase -- munit test case to test assert functions.
USAGE
run_tcase(@assert_tcase)
INPUTS
(none)
OUTPUTS
tc = tcase structure for assert_tcase.
SIDE EFFECTS
DESCRIPTION
AUTHOR
Charlie Cornish
CREATION DATE
2004-Apr-27
COPYRIGHT
CREDITS
REVISION
$Revision: 91 $