Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-05-17 03:00:31

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/RecoMTD/DetLayers/test
0015 
0016 F1=${TEST_DIR}/mtd_cfg.py
0017 
0018 REF_FILE="Geometry/TestReference/data/mtdDetLayerGeometryRef.log.gz"
0019 REF=""
0020 for d in $(echo $CMSSW_SEARCH_PATH | tr ':' '\n') ; do
0021   if [ -e "${d}/${REF_FILE}" ] ; then
0022     REF="${d}/${REF_FILE}"
0023       break
0024   fi
0025 done
0026 [ -z $REF ] && exit 1
0027 
0028 FILE1=mtdDetLayerGeometry.log
0029 LOG=mtddlglog
0030 DIF=mtddlgdif
0031 
0032 echo " testing RecoMTD/DetLayers"
0033 
0034 echo "===== Test \"cmsRun mtd_cfg.py\" ===="
0035 rm -f $LOG $DIF $FILE1
0036 
0037 cmsRun $F1 >& $LOG || die "Failure using cmsRun $F1" $?
0038 gzip -f $FILE1 || die "$FILE1 compression fail" $?
0039 (zdiff $FILE1.gz $REF >& $DIF || [ -s $DIF ] && checkDiff $DIF || echo "OK") || die "Failure in comparison for $FILE1" $?