Skip to content

Commit

Permalink
issue #31:
Browse files Browse the repository at this point in the history
Enhancement: tests checking demo snippets work now in a separate worker, the snippet with s_install is excluded from checking by tests
  • Loading branch information
irublev committed Feb 26, 2018
1 parent 4584717 commit b8440bc
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
2 changes: 1 addition & 1 deletion products/+elltool/+demo/+test/+mlunit/ETManualTC.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function tear_down(self)
snippetsPattern = [snippetsDir, filesep, '*.m'];
fileList = dir(snippetsPattern);
nFiles = length(fileList);
BAD_SNIPPET_NAMES = {};
BAD_SNIPPET_NAMES = {'s_chapter04_section01_snippet01.m'};
oldFolder = cd([rootDir, filesep, 'products']);
for iFile = 1 : nFiles
isBad = false;
Expand Down
34 changes: 34 additions & 0 deletions products/+elltool/+demo/+test/auxdfeval.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
function varargout=auxdfeval(processorFunc,varargin)
varargout=cell(1,nargout);
if nargout>0
[varargout{:}]=modgen.pcalc.auxdfeval(@processorfuncwithinstall,...
varargin{:});
else
modgen.pcalc.auxdfeval(@processorfuncwithinstall,varargin{:});
end

function varargout=processorfuncwithinstall(varargin)
welcomeString=sprintf('Installing Ellipsoidal Toolbox');
disp([welcomeString,'...']);
installexternals(true);
warning('on','all');
warning('off','MATLAB:dispatcher:pathWarning');
% switch off warnings for nargchk for Matlab R2016a and R2016b
SMatlabInfo=ver('Matlab');
if any(strcmp(SMatlabInfo.Release,{'(R2016a)','(R2016b)'}))
warning('off','MATLAB:nargchk:deprecated');
end
modgen.logging.log4j.Log4jConfigurator.configureSimply();
%
%% Configure CVX is needed
ellipsoidsinit();
disp([welcomeString,': done']);
%% Run task
varargout=cell(1,nargout);
if nargout>0
[varargout{:}]=feval(processorFunc,varargin{:});
else
feval(processorFunc,varargin{:});
end
end
end
5 changes: 4 additions & 1 deletion products/+elltool/+demo/+test/run_tests.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
'elltool.demo.test.mlunit.BasicTestCase');
%
testLists = cellfun(@(x) x.tests, suiteList, 'UniformOutput', false);
suite = mlunitext.test_suite(horzcat(testLists{:}));
suite = mlunitext.test_suite(horzcat(testLists{:}),...
'nParallelProcesses',1,...
'hExecFunc',@(varargin)elltool.demo.test.auxdfeval(varargin{:},...
'alwaysFork',true));
%
%resultList{2}=elltool.demo.test.run_demo_tests();
resultList{1}=runner.run(suite);
Expand Down

0 comments on commit b8440bc

Please sign in to comment.