Interative test fixed for Linux.
[scilab.git] / scilab / modules / api_scilab / tests / nonreg_tests / build_bug_12426_gateway.sce
1 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2 // Copyright (C) 2013 - Scilab Enterprises - Simon MARCHETTO
3 //
4 // This file must be used under the terms of the CeCILL.
5 // This source file is licensed as described in the file COPYING, which
6 // you should have received as part of this distribution.  The terms
7 // are also available at
8 // http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
9
10 gatewayName = "bug_12426_gateway";
11 lib1 = "api_scilab";
12 lib1include = SCI + "/modules/" + lib1 + "/includes";
13 func1 = "addErrorMessage";
14
15 previous_dir = pwd();
16 cd(get_absolute_file_path("build_" + gatewayName + ".sce"));
17 current_dir = pwd();
18 mkdir(TMPDIR + "/" + gatewayName);
19 cd(TMPDIR + "/" + gatewayName);
20
21 ilib_name = gatewayName;
22 files = ["sci_" + func1 + ".c"];
23
24 for i = 1 : size(files, "*")
25     copyfile(current_dir + "/" + files(i), TMPDIR + "/" + gatewayName);
26 end
27
28 if getos() == "Windows" then
29     libs   = SCI  + "/bin/" + lib1;
30     cflags = "-I " + lib1include;
31
32 elseif isdir(lib1include)
33     // Unix source version
34     libs   = SCI + "/modules/" + lib1 + "/.libs/libsci" + lib1;
35     cflags = "-I " + lib1include;
36 else
37     // Unix binary version
38     SCI_LIB     = strsubst(SCI,"/share\/scilab$/", "lib/scilab", "r");
39     SCI_INCLUDE = strsubst(SCI,"/share\/scilab$/", "include/scilab", "r");
40     libs        = SCI_LIB + "/libscilab-cli";
41     cflags      = "-I " + SCI_INCLUDE;
42 end
43
44 // name known in scilab, C function called
45 table = [func1, "sci_" + func1];
46
47 ilib_build(ilib_name, table, files, libs, [], "", cflags);
48
49 cd(previous_dir);
50
51 clear ilib_build;
52 clear table;
53 clear libs;
54 clear files;
55 clear ilib_name;
56 clear previous_dir;
57 clear gateway_c_dir;
58 clear SCI_LIB;
59 clear SCI_INCLUDE;