Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-02-05 23:51:34

0001 #!/bin/bash -e
0002 
0003 function die { echo $1: status $2 ;  exit $2; }
0004 
0005 SCRAM_TEST_NAME=TestIOPoolInputNoParentDictionary
0006 rm -rf $SCRAM_TEST_NAME
0007 mkdir $SCRAM_TEST_NAME
0008 cd $SCRAM_TEST_NAME
0009 
0010 # Create a new CMSSW dev area and build modified DataFormats/TestObjects in it
0011 NEW_CMSSW_BASE=$(/bin/pwd -P)/$CMSSW_VERSION
0012 scram -a $SCRAM_ARCH project $CMSSW_VERSION
0013 pushd $CMSSW_VERSION/src
0014 mkdir DataFormats
0015 
0016 # Copy DataFormats/Common if it was modified locally
0017 if [ -d ${CMSSW_BASE}/src/DataFormats/Common ]; then
0018     cp -Lr ${CMSSW_BASE}/src/DataFormats/Common DataFormats/
0019 fi
0020 if [ -d ${CMSSW_BASE}/src/DataFormats/Provenance ]; then
0021     cp -Lr ${CMSSW_BASE}/src/DataFormats/Provenance DataFormats/
0022 fi
0023 #DataFormats/Common and DataFormat/Provenance depend on Utilities
0024 if [ -d ${CMSSW_BASE}/src/FWCore/Utilities ]; then
0025     mkdir -p FWCore
0026     cp -Lr ${CMSSW_BASE}/src/FWCore/Utilities FWCore/
0027 fi
0028 #DataFormats/Common depends on MessageLogger
0029 if [ -d ${CMSSW_BASE}/src/FWCore/MessageLogger ]; then
0030     mkdir -p FWCore
0031     cp -Lr ${CMSSW_BASE}/src/FWCore/MessageLogger FWCore/
0032 fi
0033 #DataFormats/Provenance depends on Reflection
0034 if [ -d ${CMSSW_BASE}/src/FWCore/Reflection ]; then
0035     mkdir -p FWCore
0036     cp -Lr ${CMSSW_BASE}/src/FWCore/Reflection FWCore/
0037 fi
0038 
0039 #DataFormats/TestObjects depends on FWCore/SOA
0040 if [ -d ${CMSSW_BASE}/src/FWCore/SOA ]; then
0041     mkdir -p FWCore
0042     cp -Lr ${CMSSW_BASE}/src/FWCore/SOA FWCore/
0043 fi
0044 
0045 # Copy DataFormats/TestObjects code to be able to edit it to make ROOT header parsing to fail
0046 for DIR in ${CMSSW_BASE} ${CMSSW_RELEASE_BASE} ${CMSSW_FULL_RELEASE_BASE} ; do
0047     if [ -d ${DIR}/src/DataFormats/TestObjects ]; then
0048         cp -Lr ${DIR}/src/DataFormats/TestObjects DataFormats/
0049         break
0050     fi
0051 done
0052 if [ ! -e DataFormats/TestObjects ]; then
0053     echo "Failed to copy DataFormats/TestObjects from local or release area"
0054     exit 1;
0055 fi
0056 
0057 # Enable TransientIntParentT dictionaries
0058 cat DataFormats/TestObjects/test/BuildFile_extra.xml >> DataFormats/TestObjects/test/BuildFile.xml
0059 #Set env and build in sub-shel
0060 (eval $(scram run -sh) ; scram build -j $(nproc))
0061 
0062 popd
0063 
0064 # Prepend NEW_CMSSW_BASE's lib/src paths in to LD_LIBRARY_PATH and ROOT_INCLUDE_PATH
0065 export LD_LIBRARY_PATH=${NEW_CMSSW_BASE}/lib/${SCRAM_ARCH}:${LD_LIBRARY_PATH}
0066 export ROOT_INCLUDE_PATH=${NEW_CMSSW_BASE}/src:${ROOT_INCLUDE_PATH}
0067 
0068 echo "Produce a file with TransientIntParentT<1> product"
0069 cmsRun ${LOCALTOP}/src/IOPool/Input/test/PoolNoParentDictionaryTestStep1_cfg.py || die 'Failed cmsRun PoolNoParentDictionaryTestStep1_cfg.py' $?
0070 
0071 
0072 # Then make attempt to load TransientIntParentT<1> to fail
0073 echo "PREVENT_HEADER_PARSING" >> ${NEW_CMSSW_BASE}/src/DataFormats/TestObjects/interface/ToyProducts.h
0074 rm ${NEW_CMSSW_BASE}/lib/${SCRAM_ARCH}/DataFormatsTestObjectsParent1_xr_rdict.pcm ${NEW_CMSSW_BASE}/lib/${SCRAM_ARCH}/libDataFormatsTestObjectsParent1.so
0075 sed -i -e 's/libDataFormatsTestObjectsParent1.so/libDataFormatsTestObjectsParent2.so/' ${NEW_CMSSW_BASE}/lib/${SCRAM_ARCH}/DataFormatsTestObjectsParent1_xr.rootmap
0076 
0077 echo "Read the file without TransientIntParentT<1> dictionary"
0078 cmsRun ${LOCALTOP}/src/IOPool/Input/test/PoolNoParentDictionaryTestStep2_cfg.py || die 'Failed cmsRun PoolNoParentDictionaryTestStep2_cfg.py' $?