-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathruntests.m
51 lines (41 loc) · 1.3 KB
/
runtests.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
function [ results ] = runtests( varargin )
%RUNTESTS Runs the testsuite
%
% [ RESULTS ] = RUNTESTS( VARARGIN ) Runs the test suite (VERBOSELY if
% any input argument is given). To run a single test suite/case enter
% the testSuite:testCase can be specified as an argument. If two input
% arguments are given verbose tests are run and output to the file
% given by the second argument. RESULTS is a NTESTSUITES x 2 array
% with the number of passed tests in first column and failed in second.
% The SSRCDIR with source files (which are added to the path) and
% STESTDIR with mloct_test files are specified manually below.
% Initial version 180216.
% Copyright 2013-2022 Precise Simulation Ltd.
% License: AGPL v3, see LICENSE for more details or contact
% Precise Simulation for alternative licensing options.
sSrcDir = 'src';
sTestDir = 'test';
sTest = '';
fid = 1;
isVerbose = false;
if( nargin>=1 )
arg1 = varargin{1};
isVerbose = true;
if( ischar(arg1) && length(arg1)>1 )
sTest = arg1;
end
if( nargin>=2 )
arg2 = varargin{2};
if( ischar(arg2) )
fid = fopen( arg2, 'a+' );
end
end
end
addpath( genpath('test/mloct_test') );
results = mloct_test_run( sSrcDir, sTestDir, sTest, fid, isVerbose );
if( fid>1 )
fclose( fid );
end
if( ~nargout )
clear results
end