/DetectorDescription/RegressionTest/test/run_DOMCount.sh

https://github.com/aivanov-cern/cmssw · Shell · 39 lines · 24 code · 8 blank · 7 comment · 3 complexity · c2ee79a56bb23bb3a6ac02ecd3e5c7b6 MD5 · raw file

  1. #!/bin/bash
  2. function die { echo Failure $1: status $2 ; exit $2 ; }
  3. pushd ${LOCAL_TMP_DIR}
  4. rm -f run_DOMCount.log
  5. echo "Normal output of DOMCount is written to file tmp/${SCRAM_ARCH}/run_DOMCount.log"
  6. # Each of these cfi files contains a list of xml files
  7. # We will run DOMCount on each of the xml files
  8. cfiFiles=Geometry/CMSCommonData/cmsIdealGeometryXML_cfi
  9. cfiFiles="${cfiFiles} Geometry/CMSCommonData/cmsExtendedGeometryXML_cfi"
  10. cfiFiles="${cfiFiles} Geometry/CMSCommonData/cmsExtendedGeometryLiMaxXML_cfi"
  11. for cfiFile in ${cfiFiles}
  12. do
  13. echo "run_DOMCount.py $cfiFile" | tee -a run_DOMCount.log
  14. ${LOCAL_TEST_DIR}/run_DOMCount.py $cfiFile >> run_DOMCount.log 2>&1 || die "run_DOMCount.py $cfiFile" $?
  15. done
  16. # Errors in the xml files and also missing xml or schema files will
  17. # show up in the log file. (if the python script above actually
  18. # exits with a nonzero status it probably means the python test
  19. # script has a bug in it)
  20. errorCount=`(grep --count "Error" run_DOMCount.log)`
  21. if [ $errorCount -eq 0 ]
  22. then
  23. echo "No XML Schema violations in xml files."
  24. else
  25. echo "Test failed. Here are the errors from tmp/${SCRAM_ARCH}/run_DOMCount.log:"
  26. cat run_DOMCount.log | grep -v '\.xml:.*elems\.$'
  27. popd
  28. exit 1
  29. fi
  30. popd
  31. exit 0