Browse Source

return code 1 when not all tests pass

master
Markus Bergholz 4 years ago
parent
commit
89d8942b16
  1. 10
      mUnittest.m

10
mUnittest.m

@ -20,14 +20,18 @@ function ret = mUnittest(script)
end
% print summary
summary();
if (summary())
ret = 0;
else
ret = 1;
end
else
ret = 1;
end%if
end%function mUnittest
function summary()
function ret = summary()
% get number of passed and failed tests
result = assert();
@ -48,6 +52,8 @@ function summary()
fid = fopen(sprintf('%sReport.xml', className()), 'w');
fprintf(fid, '<testsuite tests="%d" time="%.f">%s\n</testsuite>',num, t, xml);
fclose(fid);
ret = f == 0;
end

Loading…
Cancel
Save