-
Notifications
You must be signed in to change notification settings - Fork 2
/
executeTests.m
57 lines (35 loc) · 1.29 KB
/
executeTests.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
52
53
54
55
56
57
function isNotOk = executeTests
global testVerbose
% verbose = false to suppress text and figures from tests
testVerbose = false;
disp( 'Starting Hermes Test Suite' );
hermes_dir = pwd;
addpath( genpath( [hermes_dir, filesep, 'src' ]));
tests_dir = [hermes_dir, filesep, 'unit' ];
addpath( genpath( tests_dir ));
addpath( genpath( [hermes_dir, filesep, 'parameters' ]));
isNotOk = false;
buildMexFiles( );
try
resultTests = table( runtests( tests_dir, 'Recursively', true ) );
disp( resultTests );
fprintf ( 'Totals: \n %d Passed, %d Failed, %d Incomplete \n', ...
sum ( resultTests.Passed ), sum ( resultTests.Failed ), ...
sum ( resultTests.Incomplete ) );
fprintf ( ' %ld seconds testing time \n\n', sum ( resultTests.Duration ) );
isNotOk = any( [resultTests.Failed] );
disp('verifying use of toolboxes')
toolboxes = license('inuse');
for toolboxIndex = 1 : length( toolboxes )
if ~strcmp( toolboxes( toolboxIndex ).feature, 'matlab' )
%isNotOk = true;
fprintf( 'WARNING : toolbox %s is being used\n', ...
toolboxes( toolboxIndex ).feature )
end
end
disp( 'Finishing Hermes Test Suite' );
catch e
disp( getReport( e, 'extended' ) );
end;
clear testVerbose
end