Salome HOME
Update copyrights
[modules/smesh.git] / src / Tools / padder / unittests / autotest.sh.in
1 #!/bin/bash
2 # Copyright (C) 2010-2019  EDF R&D
3 #
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
8 #
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 # Lesser General Public License for more details.
13 #
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 #
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #
20 # Author : Guillaume Boulant (EDF) 
21 #
22
23
24 # This script should be executed in a SALOME shell session,
25 # for example the shell obtained from the command runSession
26 # provided by the SALOME application.
27
28 # This list contains the filenames where test suites are to be
29 # executed. The path are defined relative to the PYTHON installation
30 # directory of the SALOME module.
31 listfiles="\
32     configreader.py \
33     unittests/usecase_meshJobManager.py \
34     gui/inputdata.py"
35
36 INSTALL_DIR=@CMAKE_INSTALL_PREFIX@
37 PYTHON_DIR=$INSTALL_DIR/lib/python@PYTHON_VERSION@/site-packages/salome
38 PYTHONPATH=$PYTHON_DIR:$PYTHONPATH
39 export PYTHONPATH
40
41 stderr=2
42 while getopts 'ql' OPTION
43 do
44     case $OPTION in
45         q) stderr=1 ;;
46         l) for f in $listfiles; do echo $f; done; exit 0;;
47         ?) printf "Usage: %s: [-q] [-l]\n" $(basename $0) >&2; exit 2;;
48     esac
49 done
50 shift $(($OPTIND - 1))
51
52 here=$(pwd)
53 package_path="salome/smesh/spadder"
54 cd $PYTHON_DIR
55 for file in $listfiles; do
56     # Uncomment this line (and comment the next one) to display
57     # the start line of a test and not only the result:
58     python $package_path/$file 2>&$stderr | grep '^\[TEST'
59     #python $package_path/$file $filter | grep '^\[TEST' | grep -v 'test in progress'
60 done
61 cd $here