Skip to content
Snippets Groups Projects
run_gdat_tests.m 926 B
Newer Older
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