File tree Expand file tree Collapse file tree 2 files changed +40
-0
lines changed
Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ cmake_minimum_required (VERSION 3.20 FATAL_ERROR)
2+
3+ project (PostInstall)
4+
5+ find_package (ROOT REQUIRED)
6+
7+ add_executable (readHSimple readHSimple.cxx)
8+ target_link_libraries (readHSimple PUBLIC ROOT::Hist ROOT::RIO)
9+
10+ include (CTest)
11+
12+ if (BUILD_TESTING)
13+ add_test (NAME run-hsimple
14+ COMMAND ${ROOT_BINDIR} /root.exe -b -q -l -e ".x ${CMAKE_SOURCE_DIR} /../../tutorials/hsimple.C" -e "return"
15+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR} )
16+ add_test (NAME read-hsimple
17+ COMMAND $<TARGET_FILE:readHSimple>
18+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR} )
19+ set_tests_properties (run-hsimple PROPERTIES FIXTURES_SETUP HSIMPLE)
20+ set_tests_properties (read-hsimple PROPERTIES FIXTURES_REQUIRED HSIMPLE)
21+ endif ()
Original file line number Diff line number Diff line change 1+ #include < TH1.h>
2+ #include < TFile.h>
3+
4+ int main ()
5+ {
6+ TFile file (" hsimple.root" , " READ" );
7+ if (!file.IsOpen ())
8+ return 1 ;
9+
10+ TH1 *histo = file.Get <TH1>(" hpx" );
11+ if (!histo)
12+ return 2 ;
13+
14+ if (histo->GetEntries () != 25000 )
15+ return 3 ;
16+ histo->Print ();
17+
18+ return 0 ;
19+ }
You can’t perform that action at this time.
0 commit comments