Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:48:53

0001 #!/bin/sh -e
0002 
0003 function die { echo $1: status $2 ; exit $2; }
0004 function checkDiff {
0005     FSIZE=$(stat -c%s "$1")
0006     echo "The output diff is $FSIZE:"
0007     cat $1;
0008     if [ $FSIZE -gt 0 ]
0009     then
0010       exit -1;
0011     fi
0012 }
0013 
0014 TEST_DIR=src/Geometry/MTDCommonData/test
0015 
0016 F1=${TEST_DIR}/testMTDinDDD.py
0017 F2=${TEST_DIR}/testMTDinDD4hep.py
0018 
0019 REF_FILE="Geometry/TestReference/data/mtdCommonDataRef.log.gz"
0020 REF=""
0021 for d in $(echo $CMSSW_SEARCH_PATH | tr ':' '\n') ; do
0022   if [ -e "${d}/${REF_FILE}" ] ; then
0023     REF="${d}/${REF_FILE}"
0024       break
0025   fi
0026 done
0027 [ -z $REF ] && exit 1
0028 
0029 FILE1=mtdCommonDataDDD.log
0030 FILE2=mtdCommonDataDD4hep.log
0031 LOG=mtdcdlog
0032 DIF=mtdcddif
0033 
0034 echo " testing Geometry/MTDCommonData"
0035 
0036 echo "===== Test \"cmsRun testMTDinDDD.py\" ===="
0037 rm -f $LOG $DIF $FILE1
0038 
0039 cmsRun $F1 >& $LOG || die "Failure using cmsRun $F1" $?
0040 gzip -f $FILE1 || die "$FILE1 compression fail" $?
0041 (zdiff $FILE1.gz $REF >& $DIF || [ -s $DIF ] && checkDiff $DIF || echo "OK") || die "Failure in comparison for $FILE1" $?
0042 
0043 rm -f $LOG $DIF $FILE2
0044 echo "===== Test \"cmsRun testMTDinDD4hep.py\" ===="
0045 
0046 cmsRun $F2 >& $LOG || die "Failure using cmsRun $F2" $?
0047 gzip -f $FILE2 || die "$FILE2 compression fail" $?
0048 (zdiff $FILE2.gz $REF >& $DIF || [ -s $DIF ] && checkDiff $DIF || echo "OK") || die "Failure in comparison for $FILE2" $?
0049