Skip to content

Commit 6110b82

Browse files
committed
add a unit test for hltInfo
1 parent 86e0847 commit 6110b82

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

HLTrigger/Tools/test/BuildFile.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
<!-- tests convertToRaw utility script -->
22
<test name="testConvertToRaw" command="testConvertToRaw.sh"/>
3+
<!-- tests hltInfoutility script -->
4+
<test name="testHltInfo" command="check_hlt_info.sh"/>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
3+
FILE="/store/data/Run2024I/EphemeralHLTPhysics0/RAW/v1/000/386/593/00000/91a08676-199e-404c-9957-f72772ef1354.root"
4+
5+
EXPECTED_OUTPUT=$(cat <<EOF
6+
process LHC (release CMSSW_14_0_15_patch1)
7+
8+
process HLT (release CMSSW_14_0_15_patch1)
9+
HLT menu: '/cdaq/physics/Run2024/2e34/v1.4.9/HLT/V1'
10+
global tag: '140X_dataRun3_HLT_v3'
11+
EOF
12+
)
13+
14+
# Run hltInfo and capture its output
15+
ACTUAL_OUTPUT=$(hltInfo "$FILE")
16+
17+
# Compare using diff
18+
if diff <(echo "$ACTUAL_OUTPUT") <(echo "$EXPECTED_OUTPUT") > /dev/null; then
19+
echo "Output matches expected format."
20+
exit 0
21+
else
22+
echo "Output does NOT match expected format."
23+
echo
24+
echo "---- Expected Output ----"
25+
echo "$EXPECTED_OUTPUT"
26+
echo "-----------------------"
27+
echo
28+
echo "---- Actual Output ----"
29+
echo "$ACTUAL_OUTPUT"
30+
echo "-----------------------"
31+
exit 1
32+
fi

0 commit comments

Comments
 (0)