Merge remote-tracking branch 'origin/master' into YaSp
[scilab.git] / scilab / modules / development_tools / macros / launchtest.sci
1 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2 // Copyright (C) 2006-2008 - INRIA - Sylvestre LEDRU <sylvestre.ledru@inria.fr>
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 // Purpose : this file provides functions to test scilab for each modules
11 // Under Linux/Unix it is called by the command "make check"
12 // Which will call the target check-local in the file Makefile.incl.am
13
14 function launchtest(myPath,myTests)
15     chdir(myPath)
16     maketests(myTests,"clean")
17     maketests(myTests,"test")
18 endfunction
19
20 function maketests(myTests,job)
21     lines(0) // to disable line control
22     if argn(2)<1 then job="tests",end
23     if job=="clean" then //remove .dia files
24         cleantests(myTests)
25     else
26         for k1=1:size(myTests,"*")  // loop on .tst files
27             scitest(myTests(k1))
28         end
29     end
30 endfunction
31
32 function cleantests(myTests)
33     if getos() == "Windows" then
34         path=SCI+"\tests\basic_tests"
35         file_to_clean=path+strsubst(myTests,".tst",".dia")
36         unix_s("del "+""""+strcat(file_to_clean,""" """)+"""")
37     else
38         path="./"
39         file_to_clean=path+strsubst(myTests,".tst",".dia")
40         unix_s("rm -f "+strcat(file_to_clean," "))
41     end
42 endfunction