File tree 2 files changed +36
-0
lines changed
2 files changed +36
-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
+ TFile file (" hsimple.root" , " READ" );
6
+ if (!file.IsOpen ()) return 1 ;
7
+
8
+ TH1 * histo = file.Get <TH1>(" hpx" );
9
+ if (!histo) return 2 ;
10
+
11
+ if (histo->GetEntries () != 25000 ) return 3 ;
12
+ histo->Print ();
13
+
14
+ return 0 ;
15
+ }
You can’t perform that action at this time.
0 commit comments