Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:03:06

0001 #!/bin/bash -ex
0002 cd $CMSSW_BASE
0003 rm -rf test-data-file-deletion
0004 mkdir -p test-data-file-deletion/src/Geometry/CMSCommonData/data/dir-for-data-file
0005 #Create symlink for datafile to point to the directory. cmsRun should fail to open this datafile via FileInPath mechanism
0006 ln -s dir-for-data-file test-data-file-deletion/src/Geometry/CMSCommonData/data/materials.xml
0007 ERR=0
0008 pushd test-data-file-deletion
0009   CMSSW_SEARCH_PATH=$(pwd)/src:${CMSSW_SEARCH_PATH} cmsRun $CMSSW_BASE/src/CondTools/Geometry/test/writehelpers/geometryxmlwriter.py || ERR=$?
0010 popd
0011 edm_exception_header="${CMSSW_BASE}/src/FWCore/Utilities/interface/EDMException.h"
0012 if [ ! -f ${edm_exception_header} ] ; then
0013   edm_exception_header=$CMSSW_RELEASE_BASE/src/FWCore/Utilities/interface/EDMException.h
0014 fi
0015 let FILE_IN_PATH_ERROR=$(grep ' FileInPathError *= *' ${edm_exception_header} | sed 's|.*= *||;s|,.*$||')%256
0016 rm -rf test-data-file-deletion
0017 if [ "$ERR" = "$FILE_IN_PATH_ERROR" ] ; then
0018   exit 0
0019 fi
0020 
0021 echo "ERROR: This tests should have failed with FileInPath error."
0022 exit 1