No BSD License  

Highlights from
MUnit: a unit testing framework in Matlab

MUnit: a unit testing framework in Matlab

by

 

05 Jun 2006 (Updated )

A complete unit testing framework in Matlab

testset(varargin)
function ts = testset(varargin)
% @TESTSET/TESTSET  Generates a new test set
%
% function ts = testset(name,desc,tests,callbacks)
%
%  This function is the constructor of the testSet class, remember that
% this class represents a composite TestUnit.
%
%  Params
%  ------
% IN:
%  name         = The string used as name
%  desc         = A description of the test
%  tests        = A cell pf tests, can be TestUnits or TestSets (olso mixed)
%  callbacks    =  The cell of callbacks functions to be called on reset and
%                 on execution completed.
% OUT:
%  ts           = The new test set
%
%  Pre
%  ---
% -  Name and desc must be strings, tests must be a cell of TestUnits () or TestSets.
%
%  Post
%  ----
% -  The generated object is a TestSet... and olso a TestUnit.
%
%  SeeAlso
%  -------
% TestUnit
%
%  Examples
%  --------
%   Generating a new empty test set:
%  >> ts = testset('MyNewTest','This is a newly created test');

% Check if the first parameter is an object of class TestSet:
if nargin>0 && isa(varargin{1},'testset')
    % Returning the same object
	ts = varargin{1};
    return;
end

% Generating the test set:
[ts,tu] = mktestset(varargin{:});

% Generating the new object subclassing:
ts = class(ts,'testset',tu);

Contact us