Salome HOME
Merge from V6_4_BR 05/12/2011
[modules/smesh.git] / src / Tools / padder / unittests / autotest.sh.in
1 #!/bin/bash
2 #  Copyright (C) 2010  CEA/DEN, EDF R&D, OPEN CASCADE
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.
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 # -* Makefile *- 
21 #
22 # Author : Guillaume Boulant (EDF) 
23 #
24
25
26 # This script should be executed in a SALOME shell session,
27 # for example the shell obtained from the command runSession
28 # provided by the SALOME application.
29
30 # This list contains the filenames where test suites are to be
31 # executed. The path are defined relative to the PYTHON installation
32 # directory of the SALOME module.
33 listfiles="\
34     configreader.py \
35     unittests/test_meshJobManager.py \
36     gui/inputdata.py"
37
38 INSTALL_DIR=@prefix@
39 PYTHON_DIR=$INSTALL_DIR/lib/python@PYTHON_VERSION@/site-packages/salome
40 PYTHONPATH=$PYTHON_DIR:$PYTHONPATH
41 export PYTHONPATH
42
43 stderr=2
44 while getopts 'ql' OPTION
45 do
46     case $OPTION in
47         q) stderr=1 ;;
48         l) for f in $listfiles; do echo $f; done; exit 0;;
49         ?) printf "Usage: %s: [-q] [-l]\n" $(basename $0) >&2; exit 2;;
50     esac
51 done
52 shift $(($OPTIND - 1))
53
54 here=$(pwd)
55 package_path="salome/smesh/spadder"
56 cd $PYTHON_DIR
57 for file in $listfiles; do
58     # Uncomment this line (and comment the next one) to display
59     # the start line of a test and not only the result:
60     python $package_path/$file 2>&$stderr | grep '^\[TEST'
61     #python $package_path/$file $filter | grep '^\[TEST' | grep -v 'test in progress'
62 done
63 cd $here