Skip to content
Snippets Groups Projects
Commit c9914ae0 authored by Vakhtang Tsulaia's avatar Vakhtang Tsulaia
Browse files

Merge branch 'test.AthenaRootComps-20170913' into 'master'

AthenaRootComps: Change tests to work under ctest.

See merge request !4613
parents fc049090 1270e910
No related branches found
No related tags found
No related merge requests found
Showing
with 420 additions and 26 deletions
......@@ -47,3 +47,49 @@ atlas_install_joboptions( share/tests/*.py )
atlas_install_scripts( test/*.sh test/ref.* )
atlas_add_test( test_athena_ntuple_dumper_multiple
SCRIPT test/test_athena_ntuple_dumper_multiple.sh
EXTRA_PATTERNS ".*"
PROPERTIES TIMEOUT 300 )
atlas_add_test( test_athena_ntuple_dumper_varhandles_nooutput
SCRIPT test/test_athena_ntuple_dumper_varhandles_nooutput.sh
EXTRA_PATTERNS ".*"
PROPERTIES TIMEOUT 300 )
atlas_add_test( test_athena_ntuple_dumper_varhandles
SCRIPT test/test_athena_ntuple_dumper_varhandles.sh
EXTRA_PATTERNS ".*"
PROPERTIES TIMEOUT 300 )
atlas_add_test( test_athena_ntuple_dumper_novarhandles
SCRIPT test/test_athena_ntuple_dumper_novarhandles.sh
EXTRA_PATTERNS ".*"
PROPERTIES TIMEOUT 600 )
atlas_add_test( test_athena_variable_shape1
SCRIPT test/test_athena_variable_shape1.sh
EXTRA_PATTERNS ".*"
PROPERTIES TIMEOUT 300 )
atlas_add_test( test_athena_variable_shape2
SCRIPT test/test_athena_variable_shape2.sh
EXTRA_PATTERNS ".*"
PROPERTIES TIMEOUT 300 )
atlas_add_test( test_athena_variable_shape3
SCRIPT test/test_athena_variable_shape3.sh
EXTRA_PATTERNS ".*"
PROPERTIES TIMEOUT 300 )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/test/test_athena_variable_shape_merged.sh.in
${CMAKE_CURRENT_BINARY_DIR}/test_athena_variable_shape_merged_script.sh
@ONLY )
atlas_add_test( test_athena_variable_shape_merged
SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/test_athena_variable_shape_merged_script.sh
EXTRA_PATTERNS ".*"
PROPERTIES TIMEOUT 300 )
set_tests_properties( AthenaRootComps_test_athena_variable_shape_merged_ctest
PROPERTIES DEPENDS
"AthenaRootComps_test_athena_variable_shape1_ctest;AthenaRootComps_test_athena_variable_shape2_ctest;AthenaRootComps_test_athena_variable_shape3_ctest" )
from glob import glob
if 1:
testdir = os.environ.get ('ATLAS_REFERENCE_DATA',
'root://eosatlas//eos/atlas/user/b/binet/utests/utests/filter-d3pd')
_cbntfiles = [
'root://eosatlas//eos/atlas/user/b/binet/utests/utests/filter-d3pd/ntuple.0.root',
'root://eosatlas//eos/atlas/user/b/binet/utests/utests/filter-d3pd/ntuple.1.root',
testdir + '/ntuple.0.root',
testdir + '/ntuple.1.root',
]
## _cbntfiles = [
## '/tmp/binet/data/ntuple.0.root',
......
from glob import glob
if 1:
testdir = os.environ.get ('ATLAS_REFERENCE_DATA',
'root://eosatlas//eos/atlas/user/b/binet/utests/utests/filter-d3pd')
_cbntfiles = [
'root://eosatlas//eos/atlas/user/b/binet/utests/utests/filter-d3pd/ntuple.0.root',
'root://eosatlas//eos/atlas/user/b/binet/utests/utests/filter-d3pd/ntuple.1.root',
testdir + '/ntuple.0.root',
testdir + '/ntuple.1.root',
]
# _cbntfiles = [
# '/tmp/binet/data/ntuple.0.root',
......
<?xml version="1.0"?>
<atn>
<TEST name="arc_rw" type="script" suite="athenarootcomps">
<package_atn>Control/AthenaRootComps</package_atn>
<options_atn>run_test_athena_ntuple_dumper.sh</options_atn>
<timelimit>30</timelimit>
<author> Sebastien Binet </author>
<mailto> binet@cern.ch </mailto>
<expectations>
<returnValue>0</returnValue>
</expectations>
</TEST>
<TEST name="arc_variable_shape" type="script" suite="athenarootcomps">
<package_atn>Control/AthenaRootComps</package_atn>
<options_atn>run_test_athena_variable_shape_ntuple.sh</options_atn>
<timelimit>30</timelimit>
<author> Sebastien Binet </author>
<mailto> binet@cern.ch </mailto>
<expectations>
<returnValue>0</returnValue>
</expectations>
</TEST>
<TEST name="arc_filters" type="makecheck" suite="AthenaRootComps">
<timelimit>20</timelimit>
<author>Jack Cranshaw</author>
......
#!/bin/bash
set -e
testname=test_athena_ntuple_dumper_multiple
rm -rf $testname
mkdir $testname
cd $testname
ATLAS_REFERENCE_TAG=AthenaRootComps/AthenaRootCompsReference-01-00-00
refbase=ref.d3pd.ascii
chkfile=d3pd.ascii
reffile=$refbase
get_files -data -symlink $reffile > /dev/null
if [ ! -r $reffile ]; then
# Look for the file in DATAPATH.
# We have to look for the directory, not the file itself,
# since get_files is hardcoded not to look more than two
# levels down.
get_files -data -symlink $ATLAS_REFERENCE_TAG > /dev/null
reffile=`basename $ATLAS_REFERENCE_TAG`/$refbase
if [ ! -r $reffile ]; then
testdata=$ATLAS_REFERENCE_DATA
if [ "$testdata" = "" ]; then
testdata=/afs/cern.ch/atlas/maxidisk/d33/referencefiles
fi
reffile=$testdata/$ATLAS_REFERENCE_TAG/$refbase
fi
fi
echo "::::::::::::::::::::::::::::::::::::::::::::::"
echo "::: run athena-ntuple-dumper... (w/ multiple output-streams)"
time_cmd="/usr/bin/time -a -o d3pd.rw.timing.log"
/bin/rm -rf d3pd.rw.timing.log >& /dev/null
($time_cmd athena.py -c'USEVARHANDLE=1; DOWRITE=2' -lERROR AthenaRootComps/test_athena_ntuple_dumper.py >& d3pd.000.0.log.txt) || exit 1
grep "user" d3pd.rw.timing.log
echo "::: comparing ascii dumps..."
/bin/rm -f d3pd.ascii.diff
diff -urN $reffile $chkfile >& d3pd.ascii.diff
sc=$?
echo "::: comparing ascii dumps...[$sc]"
if [ $sc -ne 0 ]; then
exit $sc
fi
echo "::: comparing output n-tuples..."
acmd.py diff-root d3pd.root d3pd_2.root -t egamma 2> /dev/null
sc=$?
echo "::: comparing output n-tuples...[$sc]"
if [ $sc -ne 0 ]; then
exit $sc
fi
#!/bin/bash
set -e
testname=test_athena_ntuple_dumper_novarhandles
rm -rf $testname
mkdir $testname
cd $testname
IIMAX=5
if [[ "$CMTCONFIG" == *-dbg* ]]; then
IIMAX=1
echo "::: setting IIMAX=1 (debug mode is slower)"
else
IIMAX=5
echo "::: setting IIMAX=5 (opt mode is faster)"
fi
ATLAS_REFERENCE_TAG=AthenaRootComps/AthenaRootCompsReference-01-00-00
refbase=ref.d3pd.ascii
chkfile=d3pd.ascii
reffile=$refbase
get_files -data -symlink $reffile > /dev/null
if [ ! -r $reffile ]; then
# Look for the file in DATAPATH.
# We have to look for the directory, not the file itself,
# since get_files is hardcoded not to look more than two
# levels down.
get_files -data -symlink $ATLAS_REFERENCE_TAG > /dev/null
reffile=`basename $ATLAS_REFERENCE_TAG`/$refbase
if [ ! -r $reffile ]; then
testdata=$ATLAS_REFERENCE_DATA
if [ "$testdata" = "" ]; then
testdata=/afs/cern.ch/atlas/maxidisk/d33/referencefiles
fi
reffile=$testdata/$ATLAS_REFERENCE_TAG/$refbase
fi
fi
echo "::::::::::::::::::::::::::::::::::::::::::::::"
echo "::: run athena-ntuple-dumper... (w/o varhandles)"
time_cmd="/usr/bin/time -a -o d3pd.rw.timing.log"
/bin/rm -rf d3pd.rw.timing.log >& /dev/null
for ii in `seq $IIMAX`; do
echo " - iter $ii/$IIMAX..."
($time_cmd athena.py -c'USEVARHANDLE=0' -lERROR AthenaRootComps/test_athena_ntuple_dumper.py >& d3pd.003.$ii.log.txt) || exit 1
done
grep "user" d3pd.rw.timing.log
echo "::: comparing ascii dumps..."
/bin/rm -f d3pd.ascii.diff
diff -urN $reffile $chkfile >& d3pd.ascii.diff
sc=$?
echo "::: comparing ascii dumps...[$sc]"
if [ $sc -ne 0 ]; then
exit $sc
fi
echo ""
echo "::::::::::::::::::::::::::::::::::::::::::::::"
echo "::: reading back n-tuple file..."
/bin/mv d3pd.root rb.d3pd.root || exit 1
/bin/rm -f $chkfile > /dev/null
time_cmd="/usr/bin/time -a -o d3pd.rb.timing.log"
/bin/rm -rf d3pd.rb.timing.log >& /dev/null
for ii in `seq $IIMAX`; do
echo " - iter $ii/$IIMAX..."
($time_cmd athena.py -c'FNAMES=["rb.d3pd.root"]' -lERROR AthenaRootComps/test_athena_ntuple_dumper.py >& d3pd.004.$ii.log.txt) || exit 1
done
grep "user" d3pd.rb.timing.log
echo "::: comparing ascii dumps..."
/bin/rm -f rb.d3pd.ascii.diff
diff -urN $reffile $chkfile >& rb.d3pd.ascii.diff
sc=$?
echo "::: comparing ascii dumps...[$sc]"
exit $sc
#!/bin/bash
set -e
testname=test_athena_ntuple_dumper_varhandles
rm -rf $testname
mkdir $testname
cd $testname
IIMAX=5
if [[ "$CMTCONFIG" == *-dbg* ]]; then
IIMAX=1
echo "::: setting IIMAX=1 (debug mode is slower)"
else
IIMAX=5
echo "::: setting IIMAX=5 (opt mode is faster)"
fi
ATLAS_REFERENCE_TAG=AthenaRootComps/AthenaRootCompsReference-01-00-00
refbase=ref.d3pd.ascii
chkfile=d3pd.ascii
reffile=$refbase
get_files -data -symlink $reffile > /dev/null
if [ ! -r $reffile ]; then
# Look for the file in DATAPATH.
# We have to look for the directory, not the file itself,
# since get_files is hardcoded not to look more than two
# levels down.
get_files -data -symlink $ATLAS_REFERENCE_TAG > /dev/null
reffile=`basename $ATLAS_REFERENCE_TAG`/$refbase
if [ ! -r $reffile ]; then
testdata=$ATLAS_REFERENCE_DATA
if [ "$testdata" = "" ]; then
testdata=/afs/cern.ch/atlas/maxidisk/d33/referencefiles
fi
reffile=$testdata/$ATLAS_REFERENCE_TAG/$refbase
fi
fi
echo "::::::::::::::::::::::::::::::::::::::::::::::"
echo "::: run athena-ntuple-dumper... (w/ varhandles)"
time_cmd="/usr/bin/time -a -o d3pd.rw.timing.log"
/bin/rm -rf d3pd.rw.timing.log >& /dev/null
for ii in `seq $IIMAX`; do
echo " - iter $ii/$IIMAX..."
($time_cmd athena.py -c'USEVARHANDLE=1' -lERROR AthenaRootComps/test_athena_ntuple_dumper.py >& d3pd.002.$ii.log.txt) || exit 1
done
grep "user" d3pd.rw.timing.log
echo "::: comparing ascii dumps..."
/bin/rm -f d3pd.ascii.diff
diff -urN $reffile $chkfile >& d3pd.ascii.diff
sc=$?
echo "::: comparing ascii dumps...[$sc]"
if [ $sc -ne 0 ]; then
exit $sc
fi
#!/bin/bash
set -e
testname=test_athena_ntuple_dumper_varhandles_nooutput
rm -rf $testname
mkdir $testname
cd $testname
IIMAX=5
if [[ "$CMTCONFIG" == *-dbg* ]]; then
IIMAX=1
echo "::: setting IIMAX=1 (debug mode is slower)"
else
IIMAX=5
echo "::: setting IIMAX=5 (opt mode is faster)"
fi
ATLAS_REFERENCE_TAG=AthenaRootComps/AthenaRootCompsReference-01-00-00
refbase=ref.d3pd.ascii
chkfile=d3pd.ascii
reffile=$refbase
get_files -data -symlink $reffile > /dev/null
if [ ! -r $reffile ]; then
# Look for the file in DATAPATH.
# We have to look for the directory, not the file itself,
# since get_files is hardcoded not to look more than two
# levels down.
get_files -data -symlink $ATLAS_REFERENCE_TAG > /dev/null
reffile=`basename $ATLAS_REFERENCE_TAG`/$refbase
if [ ! -r $reffile ]; then
testdata=$ATLAS_REFERENCE_DATA
if [ "$testdata" = "" ]; then
testdata=/afs/cern.ch/atlas/maxidisk/d33/referencefiles
fi
reffile=$testdata/$ATLAS_REFERENCE_TAG/$refbase
fi
fi
echo "::::::::::::::::::::::::::::::::::::::::::::::"
echo "::: run athena-ntuple-dumper... (w/ varhandles, w/o output)"
time_cmd="/usr/bin/time -a -o d3pd.rw.timing.log"
/bin/rm -rf d3pd.rw.timing.log >& /dev/null
for ii in `seq $IIMAX`; do
echo " - iter $ii/$IIMAX..."
($time_cmd athena.py -c'USEVARHANDLE=1; DOWRITE=0' -lERROR AthenaRootComps/test_athena_ntuple_dumper.py >& d3pd.001.$ii.log.txt) || exit 1
done
grep "user" d3pd.rw.timing.log
echo "::: comparing ascii dumps..."
/bin/rm -f d3pd.ascii.diff
diff -urN $reffile $chkfile >& d3pd.ascii.diff
sc=$?
echo "::: comparing ascii dumps...[$sc]"
if [ $sc -ne 0 ]; then
exit $sc
fi
#!/bin/bash
set -e
testname=test_athena_variable_shape/shape1
rm -rf $testname
mkdir -p $testname
cd $testname
echo "::: generate f1.root..."
athena.py \
-c 'EVTMAX=10; BRANCHES=["RunNumber", "EventNumber", "el_n", "el_eta"]; OUTBRANCHES=["el_n","el_eta"]' \
AthenaRootComps/test_athena_variable_shape_ntuple.py \
>| log.001.txt 2>| log.001.stderr.txt \
|| exit 1
/bin/mv d3pd.root f1.root || exit 1
/bin/mv data.var.txt data.1.txt || exit 1
(acmd.py dump-root f1.root 2> f1.stderr.ascii) \
| grep "^egamma" \
| egrep "RunNumber|EventNumber|el_n" \
| tee f1.ascii \
|| return 1
cat f1.ascii| cut -d. -f3 >| f1.ascii.todiff || exit 1
exit 0
#!/bin/bash
set -e
testname=test_athena_variable_shape/shape2
rm -rf $testname
mkdir -p $testname
cd $testname
echo "::: generate f2.root..."
athena.py \
-c 'EVTMAX=10; BRANCHES=["RunNumber", "EventNumber", "el_n", "el_phi"]; OUTBRANCHES=["el_n","el_phi"]' \
AthenaRootComps/test_athena_variable_shape_ntuple.py \
>| log.002.txt 2>| log.002.stderr.txt \
|| exit 1
/bin/mv d3pd.root f2.root || exit 1
/bin/mv data.var.txt data.2.txt || exit 1
(acmd.py dump-root f2.root 2> f2.stderr.txt) \
| grep "^egamma" \
| egrep "RunNumber|EventNumber|el_n" \
| tee f2.ascii \
|| exit 1
cat f2.ascii| cut -d. -f3 >| f2.ascii.todiff || exit 1
exit 0
#!/bin/bash
set -e
testname=test_athena_variable_shape/shape3
rm -rf $testname
mkdir -p $testname
cd $testname
echo "::: generate f3.root..."
athena.py \
-c 'EVTMAX=10; BRANCHES=["RunNumber", "EventNumber", "el_n", "el_eta"]; OUTBRANCHES=["el_n","el_eta"]' \
AthenaRootComps/test_athena_variable_shape_ntuple.py \
>| log.003.txt 2>| log.003.stderr.txt \
|| exit 1
/bin/mv d3pd.root f3.root || exit 1
/bin/mv data.var.txt data.3.txt || exit 1
(acmd.py dump-root f3.root 2> f3.stderr.txt) \
| grep "^egamma" \
| egrep "RunNumber|EventNumber|el_n" \
| tee f3.ascii \
|| exit 1
cat f3.ascii| cut -d. -f3 >| f3.ascii.todiff || exit 1
exit 0
#!/bin/bash
set -e
testname=test_athena_variable_shape
mkdir -p $testname
cd $testname
rm -f *.txt *.xml
cp @CMAKE_CURRENT_SOURCE_DIR@/test/ref.data.merged.ascii .
echo "::: generate merged.root..."
athena.py \
-c 'EVTMAX=30; BRANCHES=["RunNumber", "EventNumber", "el_n", "el_eta","el_phi"]; OUTBRANCHES=["el_n",]; FNAMES=["shape1/f1.root","shape2/f2.root","shape3/f3.root"]' \
AthenaRootComps/test_athena_variable_shape_ntuple.py \
>| log.004.txt 2>| log.004.stderr.txt \
|| exit 1
/bin/mv d3pd.root f4.root || exit 1
/bin/mv data.var.txt data.4.txt || exit 1
(acmd.py dump-root f4.root 2> f4.stderr.txt) \
| grep "^egamma" \
| egrep "RunNumber|EventNumber|el_n" \
| tee f4.ascii \
|| exit 1
cat f4.ascii| cut -d. -f3 >| f4.ascii.todiff || exit 1
echo "::: compare py-alg outputs..."
cat shape[123]/data.*.txt > data.merged.txt || exit 1
diff -urN data.merged.txt data.4.txt || exit 1
echo "::: compare py-alg outputs... [ok]"
echo "::: compare py-alg output to reference..."
diff -urN data.merged.txt ref.data.merged.ascii || exit 1
echo "::: compare py-alg output to reference... [ok]"
echo "::: compare dump-root outputs..."
cat shape[123]/f*.ascii.todiff > merged.ascii.todiff || exit 1
diff -urN merged.ascii.todiff f4.ascii.todiff || exit 1
echo "::: compare dump-root outputs... [ok]"
exit 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment