Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-07-30 05:19:51

0001 #!/bin/bash
0002 
0003 function die { echo Failure $1: status $2 ; exit $2 ; }
0004 
0005 XMLPATH=${SCRAM_TEST_PATH}/stubs
0006 LIBFILE=libFWCoreReflectionTestObjects.so
0007 
0008 edmDumpClassVersion -l ${LIBFILE} -x ${XMLPATH}/classes_def.xml -o dump.json || die "edmDumpClassVersion failed" $?
0009 diff -u ${SCRAM_TEST_PATH}/dumpClassVersion_reference.json dump.json || die "Unexpected class version dump" $?
0010 
0011 function runFailure() {
0012     edmDumpClassVersion -l ${LIBFILE} -x ${XMLPATH}/$1 > log.txt && die "edmDumpClassVersion for $1 did not fail" 1
0013     grep -q "$2" log.txt
0014     RET=$?
0015     if [ "$RET" != "0" ]; then
0016         echo "edmDumpClassVersion for $1 did not contain '$2', log is below"
0017         cat log.txt
0018         exit 1
0019     fi
0020 }
0021 
0022 runFailure test_def_nameMissing.xml "There is an element 'class' without 'name' attribute"
0023 runFailure test_def_ClassVersionMissingInClass.xml "Class element for type 'edmtest::reflection::IntObject' contains a 'version' element, but 'ClassVersion' attribute is missing from the 'class' element"
0024 runFailure test_def_ClassVersionMissingInVersion.xml "Version element for type 'edmtest::reflection::IntObject' is missing 'ClassVersion' attribute"
0025 runFailure test_def_checksumMissingInVersion.xml "Version element for type 'edmtest::reflection::IntObject' is missing 'checksum' attribute"