From 2659264748c00459ac5324245bf23eb39f19ff3c Mon Sep 17 00:00:00 2001 From: scott snyder <snyder@bnl.gov> Date: Tue, 12 Sep 2017 14:53:44 +0200 Subject: [PATCH] AthenaRootComps: Change tests to work under ctest. Change tests to work under ctest, rather than only with ATN. Break up some of the tests so that they can run in parallel. Should fix ATN test failure in the process. Former-commit-id: 1270e9103452558dc43be70442e8688b8431d4bd --- .../AthenaRoot/AthenaRootComps/CMakeLists.txt | 46 +++++++++++ .../test_athena_ntuple_dumper_multiple.ref | 0 ...test_athena_ntuple_dumper_novarhandles.ref | 0 .../test_athena_ntuple_dumper_varhandles.ref | 0 ...hena_ntuple_dumper_varhandles_nooutput.ref | 0 .../share/test_athena_variable_shape1.ref | 0 .../share/test_athena_variable_shape2.ref | 0 .../share/test_athena_variable_shape3.ref | 0 .../test_athena_variable_shape_merged.ref | 0 .../share/tests/test_athena_ntuple_dumper.py | 6 +- .../test_athena_variable_shape_ntuple.py | 6 +- .../AthenaRootComps/test/AthenaRootComps.xml | 22 ----- .../test_athena_ntuple_dumper_multiple.sh | 52 ++++++++++++ .../test_athena_ntuple_dumper_novarhandles.sh | 80 +++++++++++++++++++ .../test_athena_ntuple_dumper_varhandles.sh | 59 ++++++++++++++ ...thena_ntuple_dumper_varhandles_nooutput.sh | 59 ++++++++++++++ .../test/test_athena_variable_shape1.sh | 25 ++++++ .../test/test_athena_variable_shape2.sh | 25 ++++++ .../test/test_athena_variable_shape3.sh | 25 ++++++ .../test_athena_variable_shape_merged.sh.in | 41 ++++++++++ 20 files changed, 420 insertions(+), 26 deletions(-) create mode 100644 Database/AthenaRoot/AthenaRootComps/share/test_athena_ntuple_dumper_multiple.ref create mode 100644 Database/AthenaRoot/AthenaRootComps/share/test_athena_ntuple_dumper_novarhandles.ref create mode 100644 Database/AthenaRoot/AthenaRootComps/share/test_athena_ntuple_dumper_varhandles.ref create mode 100644 Database/AthenaRoot/AthenaRootComps/share/test_athena_ntuple_dumper_varhandles_nooutput.ref create mode 100644 Database/AthenaRoot/AthenaRootComps/share/test_athena_variable_shape1.ref create mode 100644 Database/AthenaRoot/AthenaRootComps/share/test_athena_variable_shape2.ref create mode 100644 Database/AthenaRoot/AthenaRootComps/share/test_athena_variable_shape3.ref create mode 100644 Database/AthenaRoot/AthenaRootComps/share/test_athena_variable_shape_merged.ref create mode 100755 Database/AthenaRoot/AthenaRootComps/test/test_athena_ntuple_dumper_multiple.sh create mode 100755 Database/AthenaRoot/AthenaRootComps/test/test_athena_ntuple_dumper_novarhandles.sh create mode 100755 Database/AthenaRoot/AthenaRootComps/test/test_athena_ntuple_dumper_varhandles.sh create mode 100755 Database/AthenaRoot/AthenaRootComps/test/test_athena_ntuple_dumper_varhandles_nooutput.sh create mode 100755 Database/AthenaRoot/AthenaRootComps/test/test_athena_variable_shape1.sh create mode 100755 Database/AthenaRoot/AthenaRootComps/test/test_athena_variable_shape2.sh create mode 100755 Database/AthenaRoot/AthenaRootComps/test/test_athena_variable_shape3.sh create mode 100755 Database/AthenaRoot/AthenaRootComps/test/test_athena_variable_shape_merged.sh.in diff --git a/Database/AthenaRoot/AthenaRootComps/CMakeLists.txt b/Database/AthenaRoot/AthenaRootComps/CMakeLists.txt index 3e38730e289..e88b1718ce0 100644 --- a/Database/AthenaRoot/AthenaRootComps/CMakeLists.txt +++ b/Database/AthenaRoot/AthenaRootComps/CMakeLists.txt @@ -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" ) diff --git a/Database/AthenaRoot/AthenaRootComps/share/test_athena_ntuple_dumper_multiple.ref b/Database/AthenaRoot/AthenaRootComps/share/test_athena_ntuple_dumper_multiple.ref new file mode 100644 index 00000000000..e69de29bb2d diff --git a/Database/AthenaRoot/AthenaRootComps/share/test_athena_ntuple_dumper_novarhandles.ref b/Database/AthenaRoot/AthenaRootComps/share/test_athena_ntuple_dumper_novarhandles.ref new file mode 100644 index 00000000000..e69de29bb2d diff --git a/Database/AthenaRoot/AthenaRootComps/share/test_athena_ntuple_dumper_varhandles.ref b/Database/AthenaRoot/AthenaRootComps/share/test_athena_ntuple_dumper_varhandles.ref new file mode 100644 index 00000000000..e69de29bb2d diff --git a/Database/AthenaRoot/AthenaRootComps/share/test_athena_ntuple_dumper_varhandles_nooutput.ref b/Database/AthenaRoot/AthenaRootComps/share/test_athena_ntuple_dumper_varhandles_nooutput.ref new file mode 100644 index 00000000000..e69de29bb2d diff --git a/Database/AthenaRoot/AthenaRootComps/share/test_athena_variable_shape1.ref b/Database/AthenaRoot/AthenaRootComps/share/test_athena_variable_shape1.ref new file mode 100644 index 00000000000..e69de29bb2d diff --git a/Database/AthenaRoot/AthenaRootComps/share/test_athena_variable_shape2.ref b/Database/AthenaRoot/AthenaRootComps/share/test_athena_variable_shape2.ref new file mode 100644 index 00000000000..e69de29bb2d diff --git a/Database/AthenaRoot/AthenaRootComps/share/test_athena_variable_shape3.ref b/Database/AthenaRoot/AthenaRootComps/share/test_athena_variable_shape3.ref new file mode 100644 index 00000000000..e69de29bb2d diff --git a/Database/AthenaRoot/AthenaRootComps/share/test_athena_variable_shape_merged.ref b/Database/AthenaRoot/AthenaRootComps/share/test_athena_variable_shape_merged.ref new file mode 100644 index 00000000000..e69de29bb2d diff --git a/Database/AthenaRoot/AthenaRootComps/share/tests/test_athena_ntuple_dumper.py b/Database/AthenaRoot/AthenaRootComps/share/tests/test_athena_ntuple_dumper.py index 86de9bc8371..985b2ae667e 100644 --- a/Database/AthenaRoot/AthenaRootComps/share/tests/test_athena_ntuple_dumper.py +++ b/Database/AthenaRoot/AthenaRootComps/share/tests/test_athena_ntuple_dumper.py @@ -1,8 +1,10 @@ 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', diff --git a/Database/AthenaRoot/AthenaRootComps/share/tests/test_athena_variable_shape_ntuple.py b/Database/AthenaRoot/AthenaRootComps/share/tests/test_athena_variable_shape_ntuple.py index a9d6a3254c8..5db07f55209 100644 --- a/Database/AthenaRoot/AthenaRootComps/share/tests/test_athena_variable_shape_ntuple.py +++ b/Database/AthenaRoot/AthenaRootComps/share/tests/test_athena_variable_shape_ntuple.py @@ -1,8 +1,10 @@ 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', diff --git a/Database/AthenaRoot/AthenaRootComps/test/AthenaRootComps.xml b/Database/AthenaRoot/AthenaRootComps/test/AthenaRootComps.xml index 856349523c6..a2aa4019fce 100644 --- a/Database/AthenaRoot/AthenaRootComps/test/AthenaRootComps.xml +++ b/Database/AthenaRoot/AthenaRootComps/test/AthenaRootComps.xml @@ -1,27 +1,5 @@ <?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> diff --git a/Database/AthenaRoot/AthenaRootComps/test/test_athena_ntuple_dumper_multiple.sh b/Database/AthenaRoot/AthenaRootComps/test/test_athena_ntuple_dumper_multiple.sh new file mode 100755 index 00000000000..ffda90b66f8 --- /dev/null +++ b/Database/AthenaRoot/AthenaRootComps/test/test_athena_ntuple_dumper_multiple.sh @@ -0,0 +1,52 @@ +#!/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 diff --git a/Database/AthenaRoot/AthenaRootComps/test/test_athena_ntuple_dumper_novarhandles.sh b/Database/AthenaRoot/AthenaRootComps/test/test_athena_ntuple_dumper_novarhandles.sh new file mode 100755 index 00000000000..46353583161 --- /dev/null +++ b/Database/AthenaRoot/AthenaRootComps/test/test_athena_ntuple_dumper_novarhandles.sh @@ -0,0 +1,80 @@ +#!/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 diff --git a/Database/AthenaRoot/AthenaRootComps/test/test_athena_ntuple_dumper_varhandles.sh b/Database/AthenaRoot/AthenaRootComps/test/test_athena_ntuple_dumper_varhandles.sh new file mode 100755 index 00000000000..183a9bc753c --- /dev/null +++ b/Database/AthenaRoot/AthenaRootComps/test/test_athena_ntuple_dumper_varhandles.sh @@ -0,0 +1,59 @@ +#!/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 diff --git a/Database/AthenaRoot/AthenaRootComps/test/test_athena_ntuple_dumper_varhandles_nooutput.sh b/Database/AthenaRoot/AthenaRootComps/test/test_athena_ntuple_dumper_varhandles_nooutput.sh new file mode 100755 index 00000000000..c50fc764ddb --- /dev/null +++ b/Database/AthenaRoot/AthenaRootComps/test/test_athena_ntuple_dumper_varhandles_nooutput.sh @@ -0,0 +1,59 @@ +#!/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 diff --git a/Database/AthenaRoot/AthenaRootComps/test/test_athena_variable_shape1.sh b/Database/AthenaRoot/AthenaRootComps/test/test_athena_variable_shape1.sh new file mode 100755 index 00000000000..a2edc53325d --- /dev/null +++ b/Database/AthenaRoot/AthenaRootComps/test/test_athena_variable_shape1.sh @@ -0,0 +1,25 @@ +#!/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 diff --git a/Database/AthenaRoot/AthenaRootComps/test/test_athena_variable_shape2.sh b/Database/AthenaRoot/AthenaRootComps/test/test_athena_variable_shape2.sh new file mode 100755 index 00000000000..b7692ee7a98 --- /dev/null +++ b/Database/AthenaRoot/AthenaRootComps/test/test_athena_variable_shape2.sh @@ -0,0 +1,25 @@ +#!/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 diff --git a/Database/AthenaRoot/AthenaRootComps/test/test_athena_variable_shape3.sh b/Database/AthenaRoot/AthenaRootComps/test/test_athena_variable_shape3.sh new file mode 100755 index 00000000000..e426844d86d --- /dev/null +++ b/Database/AthenaRoot/AthenaRootComps/test/test_athena_variable_shape3.sh @@ -0,0 +1,25 @@ +#!/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 diff --git a/Database/AthenaRoot/AthenaRootComps/test/test_athena_variable_shape_merged.sh.in b/Database/AthenaRoot/AthenaRootComps/test/test_athena_variable_shape_merged.sh.in new file mode 100755 index 00000000000..8d8aca285cc --- /dev/null +++ b/Database/AthenaRoot/AthenaRootComps/test/test_athena_variable_shape_merged.sh.in @@ -0,0 +1,41 @@ +#!/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 -- GitLab