From 6e8bd16cf6263403c9d40996fc7d9cbea9247183 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Scylla=29?= Date: Fri, 29 Nov 2013 11:43:47 +0100 Subject: [PATCH] Do not define LOG if Matlab unitary tests are run from Octave. --- matlab/utilities/tests/mtest.m | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/matlab/utilities/tests/mtest.m b/matlab/utilities/tests/mtest.m index 788ced58b..203fa584f 100644 --- a/matlab/utilities/tests/mtest.m +++ b/matlab/utilities/tests/mtest.m @@ -80,7 +80,12 @@ for i=1:nn fprintf(tid,['LOG = NaN;\n']); fprintf(tid,'catch\n'); fprintf(tid,'exception = lasterror;\n'); - fprintf(tid,['LOG = getReport(exception,''extended'');\n']); + if isoctave + fprintf(fid, 'LOG = ''%s'';\n','The Log output is not available with Octave!'); + %fprintf(fid,['LOG = sprintf(''LOG = Error in %%s (line %%d)\\n'', strvcat(exception.stack.name), strvcat(exception.stack.line));\n']); + else + fprintf(tid,['LOG = getReport(exception,''extended'');\n']); + end fprintf(tid,['T = NaN;\n']); fprintf(tid,['t = NaN;\n']); fprintf(tid,['end\n']); @@ -93,7 +98,9 @@ for i=1:nn fprintf(['\n']) fprintf(['Call to ' FNAME ' test routine n°' int2str(i) ' failed (' datestr(now) ')!\n']) fprintf(['\n']) - disp(LOG) + if ~isoctave + disp(LOG) + end check = 0; if nargout>1 info(i,3) = {0};