testAll.m 764 Bytes
Newer Older
Laurent Heirendt's avatar
Laurent Heirendt committed
1
% include the root folder and all subfolders.
Laurent Heirendt's avatar
Laurent Heirendt committed
2
addpath(genpath(pwd));
Laurent Heirendt's avatar
Laurent Heirendt committed
3
4
5
6
7
8
9
10
11
12
13
14
15
16

try

    % save the userpath
    originalUserPath = path;

    result = runtests('./test/', 'Recursively', true, 'BaseFolder', '*verified*');

    sumFailed = 0;
    sumIncomplete = 0;

    % print out a summary table
    table(result)

Laurent Heirendt's avatar
Laurent Heirendt committed
17
18
19
20
21
    for i = 1:size(result,2)
        sumFailed = sumFailed + result(i).Failed;
        sumIncomplete = sumIncomplete + result(i).Incomplete;
    end

Laurent Heirendt's avatar
Laurent Heirendt committed
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
    % restore the original path
    restoredefaultpath;
    addpath(originalUserPath);

    if sumFailed > 0 || sumIncomplete > 0
        exit_code = 1;
    end

    % ensure that we ALWAYS call exit
    if ~isempty(strfind(getenv('HOME'), 'jenkins'))
        exit(exit_code);
    end
catch
    exit(1);
end