Code covered by the BSD License  

Highlights from
Data Manipulation Toolbox

from Data Manipulation Toolbox by Dahua Lin
Manipulation of data such as string, array, cell array and struct, and a unit testing framework

testsuite(name, units)
function tsuite = testsuite(name, units)
%TESTSUITE Constructs a test suite 
%
% [ Syntax ]
%   - tsuite = testsuite(name, units)
%
% [ Arguments ]
%   - name:     the name of the test suite
%   - units:    the cell array of units
% 
% [ Description ]
%   - tsuite = testsuite(name, units) constructs a test suite, which is a
%     set of test units (test cases or test suites). By this way, we can
%     can build a hierarchy of test units.
%
% [ History ]
%   - Created by Dahua Lin, on Jun 29, 2007
%

%% parse and verify input arguments

typecheck(name, 'The name of the suite should be a string', 'string');
typecheck(units, 'The units should be a cell array of test units', 'cell');

if ~isempty(units)
    cellfun(@(u) typecheck(u, ...
        'Each element in the units should be either a testcase or a testsuite', ...
        'testcase', 'testsuite'), units);
end

%% main 

tsuite = struct('name', name, 'units', []);
tsuite.units = units;

tsuite = class(tsuite, 'testsuite');

Contact us at files@mathworks.com