Skip to content

Commit

Permalink
add finalize printout
Browse files Browse the repository at this point in the history
  • Loading branch information
m-fila authored and jmcarcell committed Oct 30, 2024
1 parent 403d973 commit dd5db6b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions k4FWCore/components/EventCounter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ class EventCounter final : public Gaudi::Functional::Consumer<void(const EventCo
}
}

StatusCode finalize() override {
info() << "Processed " << m_count.value() << " events" << endmsg;
return Consumer::finalize();
}

private:
mutable Gaudi::Accumulators::Counter<> m_count{this, "count"};
Gaudi::Property<unsigned int> m_frequency{this, "Frequency", 1, "How often to print the event number"};
Expand Down
3 changes: 2 additions & 1 deletion test/k4FWCoreTest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ add_test_with_env(Testk4runVerboseOutput options/TestArgs.py --verbose PROPERTIE
add_test_with_env(Testk4runHelpOnly options/TestArgs.py --help PROPERTIES PASS_REGULAR_EXPRESSION "show this help message and exit")

add_test_with_env(TestEventCounter options/TestEventCounter.py)
set_tests_properties(TestEventCounter PROPERTIES FAIL_REGULAR_EXPRESSION "Processing event 1;Processing event 3" PASS_REGULAR_EXPRESSION "Processing event 0.*Processing event 2;Processing event 2.*Processing event 0")
set_tests_properties(TestEventCounter PROPERTIES FAIL_REGULAR_EXPRESSION "Processing event 1;Processing event 3"
PASS_REGULAR_EXPRESSION "(Processing event 0.*Processing event 2|Processing event 2.*Processing event 0).*Processed 4 events.*Processed 4 events")

add_test_with_env(FunctionalMemory options/ExampleFunctionalMemory.py)
add_test_with_env(FunctionalMTMemory options/ExampleFunctionalMTMemory.py)
Expand Down

0 comments on commit dd5db6b

Please sign in to comment.