1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2009 - DIGITEO - Allan CORNET
4// Copyright (C) 2010 - DIGITEO - Vincent COUVERT
5//
6//  This file is distributed under the same license as the Scilab package.
7// =============================================================================
8//
9// <-- CLI SHELL MODE -->
10// <-- NO CHECK REF -->
11
12// Try to find the path of Scilab executable
13if (getos() <> "Windows") & (isempty(fileinfo(SCI + "/bin/scilab"))) then
14  // Linux binary version or Linux packaged version
15  SCIPATH = SCI + "/../../";
16else
17  // Linux source version
18  // Windows source or binary version
19  SCIPATH = SCI;
20end
21
22for i = 1:10
23	exitcode = unix(SCIPATH + "/bin/scilab -nwni -e ""exit(" + string(i) + ")""");
24    assert_checkequal(exitcode, i);
25end
26