File: run_testsuite.m

package info (click to toggle)
openems 0.0.35%2Bgit20190103.6a75e98%2Bdfsg.1-3.2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 8,544 kB
  • sloc: cpp: 40,417; python: 2,028; yacc: 580; makefile: 459; lex: 350; sh: 176; ruby: 19
file content (58 lines) | stat: -rw-r--r-- 1,560 bytes parent folder | download | duplicates (3)
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
58
%
% run the testsuite
%

clc
clear
close all
drawnow

if isOctave
    confirm_recursive_rmdir(0);
    page_screen_output(0);      % do not buffer output
    page_output_immediately(1); % do not buffer output
end

folder = fileparts( mfilename( 'fullpath' ) );
cd( folder );
addpath( [folder filesep 'helperscripts'] );

% openEMS options
options = {'--engine=multithreaded', '--engine=sse-compressed', '--engine=sse', '--engine=basic'};

for o=1:numel(options)

    disp( [datestr(now) ' *** TESTSUITE started (options: ' options{o} ')'] );

    % now list the tests
    folders = dir();
    for f=1:numel(folders)
        if folders(f).isdir
            if strcmp(folders(f).name,'.') || strcmp(folders(f).name,'..')
                continue
            end
            if strcmp(folders(f).name,'helperscripts')
                continue
            end
            oldpwd = pwd;
            cd( folders(f).name );
            scripts = dir('*.m');
            for s=1:numel(scripts)
                if ~scripts(s).isdir
                    % execute function
                    disp( [datestr(now) ' executing: ' folders(f).name '/' scripts(s).name] );
                    [~,fname] = fileparts( scripts(s).name );
                    if isOctave
                        fflush(1); % flush stdout
                    end
                    pass = feval( fname, options{o}, 'run_testsuite' );
                end
            end
            cd(oldpwd);
        end
    end
end

disp( '***' );
disp( ['*** ' datestr(now) ' ALL TESTS DONE'] );
disp( '***' );