summaryrefslogtreecommitdiff
path: root/matlab/test/lib/runTest.m
blob: f96b91b2c0c1ea678dcedebb86522c143c289410 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
%
% This function runs a MATLAB test client. The first argument must the path name of the test directory. All
% other arguments are passed to the test client.
%
function runTest(varargin)
    if length(varargin) == 0
        fprintf('testdir argument required\n');
        exit(1);
    end

    testdir = varargin{1};
    varargin(1) = []; % Removes first argument.

    cd(testdir);

    try
        client(varargin);
        exit(0);
    catch ex
        disp(getReport(ex, 'extended'));
        exit(1);
    end
end