Added ilib_include_flag macro to handle platform
[scilab.git] / scilab / modules / dynamic_link / tests / unit_tests / ilib_include_flag.dia.ref
1 // =============================================================================                                                                                                                                  
2 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab                                                                                                                                                                                                                                                                                                                              
3 // Copyright (C) 2010 - DIGITEO - Vincent LEJEUNE
4 // Copyright (C) 2011 - DIGITEO - Allan CORNET
5 //
6 //  This file is distributed under the same license as the Scilab package.
7 // =============================================================================
8 // Check failure case
9 if ( execstr('ilib_include_flag(3)','errcatch') == 0 ) then bugmes();quit;end
10 // not a dir, should fail
11 if ( execstr('ilib_include_flag(/usr/include/stdlib.h)','errcatch')  == 0 ) then bugmes();quit;end
12  // should not exist, should fail
13 if ( execstr('ilib_include_flag(/usr/my_exotic_dir/);','errcatch')  == 0 ) then bugmes();quit;end
14 cd TMPDIR;
15 mkdir("myincludespath");
16 if getos() == "Windows" then 
17   ref_flag = " -I""" + WSCI + "/bin"" " + "-I""" + WSCI + "/modules"" -I""" + getlongpathname(TMPDIR) + filesep() + "myincludespath""";
18   ref_flag = strsubst(ref_flag, "/", filesep());
19 else
20   ref_flag = " -I" + SCI + "/bin " + "-I" + SCI + "/modules -I" + TMPDIR + filesep() + "myincludespath";
21 end 
22 includes_path = [ "bin" , "modules" , TMPDIR + filesep() + "myincludespath"];
23 cd SCI;
24 output_flag = ilib_include_flag(includes_path);
25 if (ref_flag ~= output_flag) then bugmes();quit;end