Skip to content

Commit 650ff32

Browse files
committed
Check that the histograms are actually being produced
1 parent 98e9331 commit 650ff32

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

test/k4FWCoreTest/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ add_test_with_env(FunctionalTransformerRuntimeCollectionsMultiple options/Exampl
132132
add_test_with_env(FunctionalProducerHist options/ExampleFunctionalProducerHist.py)
133133

134134
add_test(NAME FunctionalCheckFiles COMMAND python3 ${CMAKE_CURRENT_LIST_DIR}/options/CheckOutputFiles.py)
135-
set_tests_properties(FunctionalCheckFiles PROPERTIES DEPENDS "FunctionalFile;FunctionalMTFile;FunctionalMultipleFile;FunctionalOutputCommands;FunctionalProducerAbsolutePath;FunctionalTransformerRuntimeEmpty;FunctionalMix;FunctionalMixIOSvc")
135+
set_tests_properties(FunctionalCheckFiles PROPERTIES DEPENDS "FunctionalFile;FunctionalMTFile;FunctionalMultipleFile;FunctionalOutputCommands;FunctionalProducerAbsolutePath;FunctionalTransformerRuntimeEmpty;FunctionalMix;FunctionalMixIOSvc;FunctionalProducerHist")
136136
# Do this after checking the files not to overwrite them
137137
add_test_with_env(FunctionalFile_toolong options/ExampleFunctionalFile.py -n 999 PROPERTIES DEPENDS FunctionalCheckFiles PASS_REGULAR_EXPRESSION
138138
"Application Manager Terminated successfully with a user requested ScheduledStop")

test/k4FWCoreTest/options/CheckOutputFiles.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
print(f'PYTHONPATH={os.environ["PYTHONPATH"]}')
2525
raise
26+
import ROOT
2627

2728

2829
def check_collections(filename, names):
@@ -118,3 +119,13 @@ def check_collections(filename, names):
118119
"output_k4test_exampledata_functional_mix_iosvc.root",
119120
mix_collections,
120121
)
122+
123+
f = ROOT.TFile.Open("functional_producer_hist.root")
124+
for i in range(2):
125+
if (
126+
str(f.GetListOfKeys()[i])
127+
!= f"Name: ExampleFunctionalProducer{i+1} Title: ExampleFunctionalProducer{i+1}"
128+
):
129+
raise RuntimeError(
130+
"Directory structure does not match expected for functional_producer_hist.root"
131+
)

0 commit comments

Comments
 (0)