]> SALOME platform Git repositories - modules/yacs.git/blob - src/yacsloader/Test/YacsLoaderTest.sh.in
Salome HOME
mergefrom branch BR_V511_PR tag mergeto_trunk_03feb09
[modules/yacs.git] / src / yacsloader / Test / YacsLoaderTest.sh.in
1 #!/bin/bash
2 #  Copyright (C) 2006-2008  CEA/DEN, 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.
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
21 if test -f @KERNEL_ROOT_DIR@/bin/salome/appli_gen.py ; then
22
23   # --- create a SALOME Application environment
24
25   @KERNEL_ROOT_DIR@/bin/salome/appli_gen.py
26   sed -i s/\"yes\"/\"no\"/ SalomeApp.xml
27   sed -i s/\,study\,cppContainer\,registry\,moduleCatalog// SalomeApp.xml
28   sed -i s/pyContainer/pyContainer\,study\,cppContainer\,registry\,moduleCatalog/ SalomeApp.xml
29
30 cat > CatalogResources.xml << EOF
31 <!DOCTYPE ResourcesCatalog>
32 <resources>
33    <machine hostname="localhost" />
34 </resources>
35 EOF
36
37   # ---------------------------------------------------------------------------
38   # --- first set of test in C++
39
40   # --- launch in background a SALOME session (servers)
41
42   ln -fs @top_srcdir@/src/yacsloader/samples .
43   ./runAppli > log1 2>&1
44
45   # --- wait a little to let the background process define
46   #     the CORBA naming service port and host
47
48   sleep 5
49
50   # --- execute the test script in SALOME session environment
51
52   chmod +x @builddir@/YacsLoaderInSessionTest.sh
53   ./runSession @builddir@/YacsLoaderInSessionTest.sh
54   ret1=$?
55
56   # ---------------------------------------------------------------------------
57   # --- second set of tests: Python scripts
58
59   chmod +x @builddir@/YacsLoaderInSessionTest2.sh
60   ./runSession @builddir@/YacsLoaderInSessionTest2.sh
61   ret2=$?
62
63   # ---------------------------------------------------------------------------
64
65   kill -9 `cat "/tmp/YACSTEST_PidEcho"`
66   ./runSession killSalome.py
67
68   echo "exec status YacsLoaderInSessionTest.sh "  $ret1
69   echo "exec status YacsLoaderInSessionTest2.sh " $ret2
70   let ret=$ret1+$ret2
71
72   # --- delete all the SALOME Application environment
73   
74   ./bin/salome/appli_clean.sh
75
76 else
77
78   ln -fs @top_srcdir@/src/yacsloader/samples .
79   chmod +x @builddir@/YacsLoaderInSessionTest.sh
80   @builddir@/YacsLoaderInSessionTest.sh
81   ret=$?
82   echo "exec status YacsLoaderInSessionTest.sh " $ret
83
84 fi
85
86 if [ $ret -ne 0 ]
87 then cat /tmp/${USER}/UnitTestsResult
88 else echo "Results are in /tmp/${USER}/UnitTestsResult"
89 fi
90
91 exit $ret