]> SALOME platform Git repositories - modules/med.git/blob - src/MEDMEM/DataTest/testreadEntete.sh
Salome HOME
correct small problem from the version in the MedFileV2_2 branch.
[modules/med.git] / src / MEDMEM / DataTest / testreadEntete.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   : testreadEntete.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 echo " - Comparaison des Entetes : " >> ${RESULT}
34 echo -e " ------------------------\n">> ${RESULT}
35
36 npb=0;
37 num=1
38 while [ true ]
39 do
40         ligne=`sed -n -e"$num,$num p" Maillages.txt`
41         num=`expr $num + 1 `
42         if [ "$ligne" = "" ] 
43         then 
44                 break 
45         fi
46         if [ `echo $ligne | cut -c1 ` = "#" ] 
47         then 
48                 echo "COMMENTAIRE" 
49                 continue
50         fi
51         fich=`echo $ligne | cut -f1 -d":"`
52         maill=`echo $ligne | cut -f2 -d":"`
53         nb=`echo $ligne | cut -f3 -d":"`
54         if [ "$nb" = "" ]
55         then
56                 Result=Rmem/Rmem.${fich}.ent.dump
57                 Compare=Ref/${fich}.ent.dump
58         else
59                 Result=Rmem/Rmem.${fich}.${nb}.ent.dump
60                 Compare=Ref/${fich}.${nb}.ent.dump
61         fi
62         ${SALOME_PATH}/readEntete Data/${fich} "${maill}" > $Result
63
64         echo "   Maillage " $maill "lu dans " $fich  >> ${RESULT} 
65         diff $Result $Compare >> /dev/null
66         rc=$?
67         if [ "$rc" != "0" ]
68         then
69            nb=`diff $Result $Compare| grep -v "Type de repere des coordonnees" | wc -l`
70            nb=`expr $nb + 0 `
71         #   if [ "$nb" != "2" ]
72         #   then
73                 echo " Difference entre les resultats des deux methodes de dumps : " >> ${RESULT}
74                 echo " Fichiers compares : $Result et $Compare " >> ${RESULT}
75                 diff $Result $Compare  >> ${RESULT}
76                 echo -e "\n">> ${RESULT}
77                 npb=`expr $npb + 1 `
78         #   else
79         #       echo "   Pas de différence sur les coordonnees                  == test OK == " >> ${RESULT}
80         #   fi
81         else
82           echo "   Pas de différence sur les informations generales             == test OK == " >> ${RESULT}
83         fi
84         echo -e "\n" >> ${RESULT}
85 done