Scilab: redirect test case error to std-err

This commit is contained in:
Simon Marchetto 2013-09-23 14:19:21 +02:00
commit c4114b2c5f

View file

@ -12,7 +12,7 @@ testbuilddir = swigtestname + ".build";
// Does the library exists? If not then exit! // Does the library exists? If not then exit!
libname = "lib" + swigtestname + "lib" + getdynlibext(); libname = "lib" + swigtestname + "lib" + getdynlibext();
if ~isfile(fullfile(testbuilddir, libname)) then if ~isfile(fullfile(testbuilddir, libname)) then
mprintf("*** LIBRARY NOT FOUND: %s ***\n", "lib" + swigtestname + "lib" + getdynlibext()); mfprintf(0, "*** LIBRARY NOT FOUND: %s ***\n", libname);
exit(1) exit(1)
end end
@ -20,21 +20,21 @@ end
try try
exec(fullfile(testbuilddir, "loader.sce"), -1); exec(fullfile(testbuilddir, "loader.sce"), -1);
catch catch
mprintf("*** LOADER EXECUTION FAILED ***\n"); mfprintf(0, "*** LOADER EXECUTION FAILED ***\n");
exit(1) exit(1)
end end
// Module initialization // Module initialization
try try
moduleInit = sprintf("%s_Init()", swigtestname); moduleInit = sprintf("%s_Init()", swigtestname);
ierr = execstr(moduleInit); execstr(moduleInit);
catch catch
mprintf("*** MODULE INIT FAILED ***\n"); mfprintf(0, "*** MODULE INIT FAILED ***\n");
exit(ierr) exit(1)
end end
// Error management function // Error management function
function swigtesterror() function swigtesterror()
mprintf("*** TEST FAILED ***\n") mfprintf(0, "*** TEST FAILED ***\n")
exit(1) exit(1)
endfunction endfunction