]> SALOME platform Git repositories - modules/med.git/blob - src/MEDMEM/DataTest/testreadCoordinate.sh
Salome HOME
correct small problem from the version in the MedFileV2_2 branch.
[modules/med.git] / src / MEDMEM / DataTest / testreadCoordinate.sh
1 #!/bin/sh
2 #
3 #  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 #  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5
6 #  This library is free software; you can redistribute it and/or 
7 #  modify it under the terms of the GNU Lesser General Public 
8 #  License as published by the Free Software Foundation; either 
9 #  version 2.1 of the License. 
10
11 #  This library is distributed in the hope that it will be useful, 
12 #  but WITHOUT ANY WARRANTY; without even the implied warranty of 
13 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
14 #  Lesser General Public License for more details. 
15
16 #  You should have received a copy of the GNU Lesser General Public 
17 #  License along with this library; if not, write to the Free Software 
18 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
19
20 #  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 #
22 #
23 #
24 #  File   : testreadCoordinate.sh
25 #  Module : MED
26
27 SALOME=${HOME}/V08
28 SALOME_LIB=${SALOME}/Build/lib
29 SALOME_PATH=${SALOME}/Build/MED/src/MEDMEM
30 LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${SALOME_LIB}
31 RESULT=PourMail
32
33 rm -rf ${RESULT}
34 echo " - Comparaison des Coordonnees : " >> ${RESULT}
35 echo -e " -------------------------------\n">> ${RESULT}
36
37 npb=0;
38 num=1
39 while [ true ]
40 do
41         ligne=`sed -n -e"$num,$num p" Maillages.txt`
42         num=`expr $num + 1 `
43         if [ "$ligne" = "" ] 
44         then 
45                 break 
46         fi
47         if [ `echo $ligne | cut -c1 ` = "#" ] 
48         then 
49                 echo "COMMENTAIRE" 
50                 continue
51         fi
52         fich=`echo $ligne | cut -f1 -d":"`
53         maill=`echo $ligne | cut -f2 -d":"`
54         nb=`echo $ligne | cut -f3 -d":"`
55         if [ "$nb" = "" ]
56         then
57                 Result=Rmem/Rmem.${fich}.coor.dump
58                 Compare=Ref/${fich}.coor.dump
59         else
60                 Result=Rmem/Rmem.${fich}.${nb}.coor.dump
61                 Compare=Ref/${fich}.${nb}.coor.dump
62         fi
63         ${SALOME_PATH}/readCoordinate Data/${fich} "${maill}" > $Result
64
65         echo "   Maillage " $maill "lu dans " $fich  >> ${RESULT} 
66         diff $Result $Compare >> /dev/null
67         rc=$?
68         if [ "$rc" != "0" ]
69         then
70            nb=`diff $Result $Compare| grep -v "Type de repere des coordonnees" | wc -l`
71            nb=`expr $nb + 0 `
72            if [ "$nb" != "2" ]
73            then
74                 echo " Difference entre les resultats des deux methodes de dumps : " >> ${RESULT}
75                 echo " Fichiers compares : $Result et $Compare " >> ${RESULT}
76                 diff $Result $Compare  >> ${RESULT}
77                 echo -e "\n">> ${RESULT}
78                 npb=`expr $npb + 1 `
79            else
80                 echo "   Pas de différence sur les coordonnees                  == test OK == " >> ${RESULT}
81            fi
82         else
83           echo "   Pas de différence sur les coordonnees                        == test OK == " >> ${RESULT}
84         fi
85         echo -e "\n" >> ${RESULT}
86 done