PageRenderTime 28ms CodeModel.GetById 20ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

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