Newer
Older
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
function [passed,results] = run_gdat_tests(test_case)
% test runner for gdat
% F. Felici, EPFL federico.felici@epfl.ch
if nargin==0
test_case = 'all'; % deafult
end
%% populate suite
switch test_case
case 'all'
suite = matlab.unittest.TestSuite.fromClass(?test_requestnames);
otherwise
error('not yet implemented')
end
%% run it
fprintf('Start test case: %s\n%s\n\n',test_case,datestr(now));
results = run(suite);
disp(table(results));
fprintf('\nTotal test duration: %5.2fs\n',sum(table(results).Duration))
%% display results
if all([results.Passed])
fprintf('\nPassed all tests\n')
passed = true;
else
fprintf('\nSome tests Failed or Incomplete\n')
if any([results.Incomplete])
fprintf('\nIncomplete:\n')
disp(table(results([results.Incomplete])))
end
if any([results.Failed])
fprintf('\nFailed:\n')
disp(table(results([results.Failed])));
end
passed = false;
end
end