KerMor  0.9
Model order reduction for nonlinear dynamical systems and nonlinear approximation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MUnit Class Reference

Class Unit Testing Framework for Matlab. More...

Detailed Description

Class Unit Testing Framework for Matlab.

This class allows to run tests within a OO-Based Matlab program

according to the conventions mentioned below
Any test method has to satisfy
  • The method's name begins with "TestFunctionPrefix"
  • Static
  • No input arguments
  • One (optional) output argument indicating success or failure of the test Possible exceptions do not have to be taken care of as they are caught automatically by the system, resulting in a failure of the test.

The most convenient way of calling MUnit is to use

done = {};
done = MUnit.RunClassTests(cd, done);

After testing, you can simply re-run the last command, and the subsequently successful tests (after e.g. fixing) will automatically be added to the done cell array.

See Also
TestFunctionPrefix
Author
Daniel Wirtz
Date
12.03.2010
Change in 0.7:
(Daniel Wirtz, 2014-04-15) Added a convenience interface for easy skipping of previously successful tests (via passing an "exclude" cell array and retrieving a "successful" cell array)
Change in 0.3:
(Daniel Wirtz, 2011-04-26) Added linebreaks after each message to avoid loss of lines when using cprintf

Definition at line 17 of file MUnit.m.

Static Public Member Functions

static function
succeeded = 
RunClassTests (dir, returnonerror, exclude)
 Runs class tests recursively within the specified path. More...
 

Static Public Attributes

static const  TestFunctionPrefix = "test_"
 The prefix for any function that will be detected in the MUnit testing process. More...
 
static const  GreenCol = "[0 .5 0]"
 Green color (the default is hardly readable) More...
 
static const  BlueCol = "*"[0 0 .8]""
 Blue color. More...
 
static const  WarnCol = "*"[1 .4 0]""
 Warning color. More...
 

Member Function Documentation

function succeeded = MUnit.RunClassTests (   dir,
  returnonerror,
  exclude 
)
static

Runs class tests recursively within the specified path.

If no path is given, the current directory (cd) is used.

Within the path any static methods from classes beginning with the TestFunctionPrefix are detected and executed.

After running all tests a summary is provided.

Definition at line 98 of file MUnit.m.

References KerMor.App(), cprintf(), and GreenCol.

Here is the call graph for this function:

Member Data Documentation

MUnit.BlueCol = "*"[0 0 .8]""
static

Blue color.


Default: "*"[0 0 .8]""

Definition at line 78 of file MUnit.m.

MUnit.GreenCol = "[0 .5 0]"
static

Green color (the default is hardly readable)


Default: "[0 .5 0]"

Definition at line 69 of file MUnit.m.

Referenced by RunClassTests(), and approx.BaseApprox.test_ApproxProjections().

MUnit.TestFunctionPrefix = "test_"
static

The prefix for any function that will be detected in the MUnit testing process.

Defaults to test_


Default: "test_"

Definition at line 57 of file MUnit.m.

MUnit.WarnCol = "*"[1 .4 0]""
static

Warning color.


Default: "*"[1 .4 0]""

Definition at line 87 of file MUnit.m.


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