-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathexSubfunctionTests.m
33 lines (27 loc) · 1.06 KB
/
exSubfunctionTests.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
%% <../index.html MATLAB xUnit Test Framework>: How to Put Multiple Test Cases in One M-file
% The Quick Start example showed how you can write a simple M-file
% to be a single test case. This example shows you how to put multiple
% test cases in one M-file.
%
% Name your M-file beginning or ending with "test", like
% "testMyFunc". Start by putting the following two lines at the
% beginning of the file. It's important that the output variable
% name on line 1 be |testSuite|.
%
% function testSuite = testMyFunc
% testSuite = buildFunctionHandleTestSuite(localfunctions);
%
% Next, add subfunctions to the file. Each subfunction beginning
% or ending with "test" becomes an individual test case.
%
% The directory example_subfunction_tests contains a test M-file
% containing subfunction test cases for the |fliplr| function.
cd example_subfunction_tests
type testFliplr
%%
% As usual, run the test cases using |runxunit|:
runxunit
%%
% <../index.html Back to MATLAB xUnit Test Framework>
%%
% Copyright 2008-2010 The MathWorks, Inc.