Commit 90b0b535 authored by Rosen Matev's avatar Rosen Matev
Browse files

Add tests for DDG4 simulation scripts

parent 1257fa14
Pipeline #2723959 passed with stage
in 16 seconds
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE extension PUBLIC '-//QM/2.3/Extension//EN' 'http://www.codesourcery.com/qm/dtds/2.3/-//qm/2.3/extension//en.dtd'>
<!--
(c) Copyright 2021 CERN for the benefit of the LHCb Collaboration
This software is distributed under the terms of the GNU General Public
Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING".
In applying this licence, CERN does not waive the privileges and immunities
granted to it by virtue of its status as an Intergovernmental Organization
or submit itself to any jurisdiction.
-->
<!--
Check that a python-based DDG4 script works.
-->
<extension class="GaudiTest.GaudiExeTest" kind="test">
<argument name="program"><text>python</text></argument>
<argument name="args"><set>
<text>$DETECTOR_PROJECT_ROOT/scripts/ddg4_VP.py</text>
<text>--output=ddg4_vp.root</text>
</set></argument>
<argument name="use_temp_dir"><enumeral>true</enumeral></argument>
<argument name="validator"><text>
import subprocess
try:
output = subprocess.check_output(["rootls", "-t", "ddg4_vp.root:*"])
except subprcess.CalledProcessError:
causes.append("failed to list output file")
result["output.summary"] = result.Quote(output)
if not (len(output.splitlines()) >= 6):
causes.append('output.summary is too short')
</text></argument>
</extension>
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE extension PUBLIC '-//QM/2.3/Extension//EN' 'http://www.codesourcery.com/qm/dtds/2.3/-//qm/2.3/extension//en.dtd'>
<!--
(c) Copyright 2021 CERN for the benefit of the LHCb Collaboration
This software is distributed under the terms of the GNU General Public
Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING".
In applying this licence, CERN does not waive the privileges and immunities
granted to it by virtue of its status as an Intergovernmental Organization
or submit itself to any jurisdiction.
-->
<!--
Analyse the ROOT output of a DDG4 script.
-->
<extension class="GaudiTest.GaudiExeTest" kind="test">
<argument name="prerequisites"><set>
<tuple><text>ddg4_vp</text><enumeral>PASS</enumeral></tuple>
</set></argument>
<argument name="program"><text>root</text></argument>
<argument name="args"><set>
<text>-b</text>
<text>-q</text>
<text>$DETECTOR_PROJECT_ROOT/scripts/VP_ana_ddg4.C("ddg4_vp.root", "ddg4_vp_histos.root")</text>
</set></argument>
<argument name="use_temp_dir"><enumeral>true</enumeral></argument>
<argument name="validator"><text>
import subprocess
try:
output = subprocess.check_output(["rootls", "-t", "ddg4_vp_histos.root:*"])
except subprcess.CalledProcessError:
causes.append("failed to list histogram output file")
result["output.summary"] = result.Quote(output)
if not (len(output.splitlines()) >= 50):
causes.append('output.summary is too short')
</text></argument>
</extension>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment