openEMS/TESTSUITE/run_testsuite.m

57 lines
1.5 KiB
Matlab
Raw Normal View History

2010-12-16 09:33:06 +00:00
%
% run the testsuite
%
clc
clear
close all
drawnow
2012-11-16 20:44:46 +00:00
if isOctave
2010-12-16 09:33:06 +00:00
confirm_recursive_rmdir(0);
2012-11-16 20:44:46 +00:00
page_screen_output(0); % do not buffer output
page_output_immediately(1); % do not buffer output
2010-12-16 09:33:06 +00:00
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} ')'] );
2012-11-16 20:44:46 +00:00
2010-12-16 09:33:06 +00:00
% 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 );
2012-11-16 20:44:46 +00:00
fflush(1); % flush stdout
2010-12-16 09:33:06 +00:00
pass = feval( fname, options{o}, 'run_testsuite' );
end
end
cd(oldpwd);
end
end
end
disp( '***' );
disp( ['*** ' datestr(now) ' ALL TESTS DONE'] );
disp( '***' );