diff --git a/roottest/cling/exception/CMakeLists.txt b/roottest/cling/exception/CMakeLists.txt index 3e7f7b612f4dc..577c38bb15278 100644 --- a/roottest/cling/exception/CMakeLists.txt +++ b/roottest/cling/exception/CMakeLists.txt @@ -1,9 +1,9 @@ if(NOT MSVC OR win_broken_tests) if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64.*|x86.*|amd64.*|AMD64.*|i686.*|i386.*") # All platforms except of ARM/AARCH64 - set(RootExeOptions "--ptrcheck") ROOTTEST_ADD_TEST(nullderef-macro MACRO nullderef.C + ROOTEXE_OPTS --ptrcheck PASSRC 1 LABELS roottest regression cling) endif() diff --git a/roottest/cling/staticinit/CMakeLists.txt b/roottest/cling/staticinit/CMakeLists.txt index 3444023762ec5..a834c85127b50 100644 --- a/roottest/cling/staticinit/CMakeLists.txt +++ b/roottest/cling/staticinit/CMakeLists.txt @@ -1,7 +1,6 @@ -set(RootExternalIncludes -e "gInterpreter->AddIncludePath(\"-I${CMAKE_CURRENT_SOURCE_DIR}\");") - ROOTTEST_ADD_TEST(ROOT-7775 MACRO execROOT-7775.C + ROOTEXE_OPTS -e "gInterpreter->AddIncludePath(\"-I${CMAKE_CURRENT_SOURCE_DIR}\")" OUTREF execROOT-7775.ref) ROOTTEST_ADD_TESTDIRS() diff --git a/roottest/cmake/modules/RoottestMacros.cmake b/roottest/cmake/modules/RoottestMacros.cmake index a848d0b9ed6d4..ebb9d1e38202d 100644 --- a/roottest/cmake/modules/RoottestMacros.cmake +++ b/roottest/cmake/modules/RoottestMacros.cmake @@ -687,7 +687,7 @@ macro(ROOTTEST_SETUP_MACROTEST) -e "gROOT->SetMacroPath(\"${CMAKE_CURRENT_SOURCE_DIR}\")" -e "gInterpreter->AddIncludePath(\"-I${CMAKE_CURRENT_BINARY_DIR}\")" -e "gSystem->AddIncludePath(\"-I${CMAKE_CURRENT_BINARY_DIR}\")" - ${RootExternalIncludes} ${RootExeOptions} ${ARG_ROOTEXE_OPTS} + ${ARG_ROOTEXE_OPTS} -q -l -b) set(root_buildcmd ${ROOT_root_CMD} ${RootExeDefines} -q -l -b) diff --git a/roottest/root/io/datamodelevolution/cms-00/CMakeLists.txt b/roottest/root/io/datamodelevolution/cms-00/CMakeLists.txt index 6a7a28f911af0..d5ea41983ab9e 100644 --- a/roottest/root/io/datamodelevolution/cms-00/CMakeLists.txt +++ b/roottest/root/io/datamodelevolution/cms-00/CMakeLists.txt @@ -77,7 +77,7 @@ ROOTTEST_ADD_TEST(read_reflex_test1 MACROARG "\"r\"" OUTREF read_reflex_test1.ref LABELS longtest - FIXTURES_REQUIRED root-io-datamodelevolution-cms-00-reflex-test1-fixtrue + FIXTURES_REQUIRED root-io-datamodelevolution-cms-00-reflex-test1-fixture root-io-datamodelevolution-cms-00-read_test1-compile-fixture) if(NOT ClingWorkAroundNoPrivateClassIO) diff --git a/roottest/root/io/issue-7754/CMakeLists.txt b/roottest/root/io/issue-7754/CMakeLists.txt index 25f9d17cbee8b..082d910463c0b 100644 --- a/roottest/root/io/issue-7754/CMakeLists.txt +++ b/roottest/root/io/issue-7754/CMakeLists.txt @@ -1,24 +1,26 @@ ROOTTEST_ADD_TEST(write_cmssw_class_v2 MACRO write_cmssw_class_v2.cxx+ - OUTREF write_cmssw_class_v2.ref) + OUTREF write_cmssw_class_v2.ref + FIXTURES_SETUP root-io-issue7754-cmssw-fixture) ROOTTEST_ADD_TEST(read_cmssw_class_v3 MACRO read_cmssw_class_v3.cxx+ OUTREF read_cmssw_class_v3.ref - DEPENDS write_cmssw_class_v2 ) - -set(RootExternalIncludes -e "gSystem->AddIncludePath(\"-I${CMAKE_CURRENT_SOURCE_DIR}/mwe/include\");") + FIXTURES_REQUIRED root-io-issue7754-cmssw-fixture) ROOTTEST_ADD_TEST(read_mwe_0 MACRO mwe/combined.cxx+ MACROARG 0 + ROOTEXE_OPTS -e "gSystem->AddIncludePath(\"-I${CMAKE_CURRENT_SOURCE_DIR}/mwe/include\")" OUTREF mwe/read_mwe_0.ref - COPY_TO_BUILDDIR mwe/pluto_oldpers.root) + COPY_TO_BUILDDIR mwe/pluto_oldpers.root + FIXTURES_SETUP root-io-issue7754-mwe-fixture) ROOTTEST_ADD_TEST(read_mwe_1 MACRO mwe/combined.cxx+ MACROARG 1 + ROOTEXE_OPTS -e "gSystem->AddIncludePath(\"-I${CMAKE_CURRENT_SOURCE_DIR}/mwe/include\")" OUTREF mwe/read_mwe_1.ref COPY_TO_BUILDDIR mwe/pluto_newpers.root - DEPENDS read_mwe_0) # To avoid both test building the script at the same time. + FIXTURES_REQUIRED root-io-issue7754-mwe-fixture) diff --git a/roottest/root/io/stdpair/CMakeLists.txt b/roottest/root/io/stdpair/CMakeLists.txt index ca62ce390b68a..05f249ed412ca 100644 --- a/roottest/root/io/stdpair/CMakeLists.txt +++ b/roottest/root/io/stdpair/CMakeLists.txt @@ -1,28 +1,22 @@ -ROOTTEST_ADD_TESTDIRS() +ROOTTEST_GENERATE_DICTIONARY(libCmsPairCollection + cmspair.h + LINKDEF FullLinkDef.h + NO_ROOTMAP NO_CXXMODULE + FIXTURES_SETUP root-io-stdpair-cmspaircoll-fixture) -set(CMAKE_ROOTTEST_NOROOTMAP ON) -set(RootExternalIncludes -e "gInterpreter->AddIncludePath(\"-I${CMAKE_CURRENT_SOURCE_DIR}\");") +ROOTTEST_GENERATE_DICTIONARY(libCmsPair + cmspair.h LINKDEF PairLinkDef.h + NO_ROOTMAP NO_CXXMODULE + FIXTURES_SETUP root-io-stdpair-cmspair-fixture) -ROOT_GENERATE_DICTIONARY(G__CmsPairCollection ${CMAKE_CURRENT_SOURCE_DIR}/cmspair.h LINKDEF FullLinkDef.h) -ROOTTEST_LINKER_LIBRARY(CmsPairCollection TEST G__CmsPairCollection.cxx LIBRARIES ${ROOT_LIBRARIES}) +ROOTTEST_COMPILE_MACRO(cmspair.h + FIXTURES_SETUP root-io-stdpair-compile-fixture) -ROOT_GENERATE_DICTIONARY(G__CmsPair ${CMAKE_CURRENT_SOURCE_DIR}/cmspair.h LINKDEF PairLinkDef.h) -ROOTTEST_LINKER_LIBRARY(CmsPair TEST G__CmsPair.cxx LIBRARIES ${ROOT_LIBRARIES}) - -ROOT_ADD_TEST(roottest-root-io-stdpair-collection-build - COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} ${build_config} --target G__CmsPairCollection${fast} CmsPairCollection${fast} -- ${always-make} - FIXTURES_SETUP InputFiles) - -ROOT_ADD_TEST(roottest-root-io-stdpair-pair-build - COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} ${build_config} --target G__CmsPair${fast} CmsPair${fast} -- ${always-make} - FIXTURES_SETUP InputFiles) - -ROOTTEST_ADD_TEST(CopyRootFiles +ROOTTEST_ADD_TEST(copyfiles COMMAND ${CMAKE_COMMAND} -E echo "Copying root files" COPY_TO_BUILDDIR aa02.root ab02.root - FIXTURES_SETUP InputFiles) - -ROOTTEST_COMPILE_MACRO(cmspair.h) + FIXTURES_REQUIRED root-io-stdpair-cmspaircoll-fixture root-io-stdpair-cmspair-fixture root-io-stdpair-compile-fixture + FIXTURES_SETUP root-io-stdpair-inputfiles-fixture) foreach(A RANGE 0 4) foreach(B RANGE 0 1) @@ -31,10 +25,10 @@ foreach(D RANGE 0 1) ROOTTEST_ADD_TEST(pairEnumEvo_${A}_${B}_${C}_${D} MACRO pairEnumEvo.C + ROOTEXE_OPTS -e "gInterpreter->AddIncludePath(\"-I${CMAKE_CURRENT_SOURCE_DIR}\")" MACROARG ${A},${B},${C},${D} OUTREF pairEnumEvo_${A}_${B}_${C}_${D}.ref - DEPENDS cmspaircollection-build cmspair-build ${COMPILE_MACRO_TEST} - FIXTURES_REQUIRED InputFiles) + FIXTURES_REQUIRED root-io-stdpair-inputfiles-fixture) endforeach() endforeach() diff --git a/roottest/root/io/transient/base/.rootrc b/roottest/root/io/transient/base/.rootrc deleted file mode 100644 index 6ebe75fd4ec5a..0000000000000 --- a/roottest/root/io/transient/base/.rootrc +++ /dev/null @@ -1 +0,0 @@ -Rint.History: .root_hist diff --git a/roottest/root/io/transient/base/CMakeLists.txt b/roottest/root/io/transient/base/CMakeLists.txt index ee466c3ec2b3c..4b91da235360e 100644 --- a/roottest/root/io/transient/base/CMakeLists.txt +++ b/roottest/root/io/transient/base/CMakeLists.txt @@ -4,14 +4,14 @@ set(CMAKE_ROOTTEST_NOROOTMAP OFF) ROOT_GENERATE_DICTIONARY(base_cling ${CMAKE_CURRENT_SOURCE_DIR}/base.h MODULE base LINKDEF baseLinkDef.h) ROOTTEST_LINKER_LIBRARY(base base_cling.cxx testobject.cpp testobjectderived.cpp TEST LIBRARIES ROOT::Core ROOT::RIO) -set(RootExeOptions -e "gSystem->Load(\"libbase\")") # Adding a ; to avoid the output is complicated - ROOTTEST_ADD_TEST(WriteFile COPY_TO_BUILDDIR testobject.h testobjectderived.h PRECMD ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} ${build_config} --target base${fast} MACRO execWriteFile.cxx+ + ROOTEXE_OPTS -e "(void)gSystem->Load(\"libbase\")" OUTREF execWriteFile${ref_suffix} - TIMEOUT 600) + TIMEOUT 600 + FIXTURES_SETUP root-io-transient-base-WriteFile-fixture) if(${compression_default} STREQUAL "lz4") set(outref_suffix "LZ4") @@ -21,5 +21,5 @@ endif() ROOTTEST_ADD_TEST(hadd_autoload COMMAND hadd -f data_merge.root data1.root data2.root OUTREF hadd_autoload${outref_suffix}.ref - DEPENDS WriteFile + FIXTURES_REQUIRED root-io-transient-base-WriteFile-fixture ENVIRONMENT ROOT_INCLUDE_PATH=${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/roottest/root/io/transient/base/Makefile b/roottest/root/io/transient/base/Makefile deleted file mode 100644 index 9ebf8c094f6fe..0000000000000 --- a/roottest/root/io/transient/base/Makefile +++ /dev/null @@ -1,87 +0,0 @@ -# This is a template for all makefiles. - -#Set the list of files to be deleted by clean (Targets can also be specified).: -CLEAN_TARGETS += $(ALL_LIBRARIES) *.log *.clog data1.root data2.root data_merge.root base_cling.* - -# Set the list of target to make while testing. By default, mytest is the -# only target added. If the name of the target is changed in the rules then -# the name should be changed accordingly in this list. - -TEST_TARGETS += hadd_autoload - -# Search for Rules.mk in roottest/scripts -# Algorithm: Find the current working directory and remove everything after -# '*roottest/'. Append the path for Rules.mk from within roottest, which -# should be 'scripts/Rules.mk'. The roottest path is saved in the -# ROOTTEST_HOME variable for use by the SUBDIRECTORIES variable and is -# exported to eliminate the overhead of findding the path again during -# recursive calls of gmake. -# Since all makefiles should be under roottest or one of its -# subdirectories and all recursions of gmake are called by -# 'cd [DIR]; gmake ...' -# this algorithm should not fail in finding /roottest/ in the -# current working directory. -# Issues: This algorithm will fail if a makefile is called from outside the -# roottest folder, as in executing 'gmake -f ~/roottest/Makefile' from -# the home directory. - -ifeq ($(strip $(ROOTTEST_HOME)),) - export ROOTTEST_HOME := $(shell git rev-parse --show-toplevel)/roottest/ - ifeq ($(strip $(ROOTTEST_HOME)),) - export ROOTTEST_HOME := $(shell expr $(CURDIR) : '\(.*/roottest/\)') - endif - ifeq ($(strip $(ROOTTEST_HOME)),) - $(error The head of roottest was not found. Set ROOTTEST_HOME) - endif -endif - -include $(ROOTTEST_HOME)/scripts/Rules.mk -include $(ROOTTEST_HOME)/scripts/Reflex.mk - - -# The name of this target should be changed according to the test being run. Any name changes -# should also be reflected in the TEST_TARGETS variable above. - -mytest: - $(CMDECHO) echo mytest > /dev/null - - -# Outputs a message if the FAIL variable is null - -testWithFailure: -ifeq ($(FAIL),) - $(WarnFailTest) -endif - - -# Remember that sometest.log can be made automatically from -# from runsometest.C -# This target attempts to create a log file (which should be the output of running the test), and -# compares its output with a prebuilt reference file. The reference file should be copied from -# the log files produced during what is considered a successful run of the test. The testWithDiff -# files should be renamed according to the test being run. -# By default the TestDiff variable is set to compare the .log and .ref files -# To run a diff and ignore whitespacing use $(TestDiffW) - -testWithDiff: testWithDiff.log testWithDiff.ref - $(TestDiff) - -base_cling.cpp: base.h baseLinkDef.h $(ROOTCINT) $(ROOTV) - $(CMDECHO) rootcint -f $@ -rmf libbase.rootmap -rml libbase base.h baseLinkDef.h > $@.log 2>&1 || (cat $@.log && exit 1) - -libbase.$(DllSuf): base_cling.$(ObjSuf) testobjectderived.$(ObjSuf) testobject.$(ObjSuf) $(ROOTCORELIBS) $(ROOTCINT) $(ROOTV) - $(BuildFromObjs) - -execWriteFile_cxx.$(DllSuf): libbase.$(DllSuf) - -execWriteFile_cxx.$(DllSuf): CALLROOTEXEBUILD += -e 'gSystem->Load("libbase");' - -execWriteFile.clog: CALLROOTEXE += -e 'gSystem->Load("libbase")' - -hadd_autoload.log: execWriteFile.success - $(CMDECHO) hadd -f data_merge.root data1.root data2.root > $@ 2>&1 || (cat $@ && exit 1) - -hadd_autoload.success: hadd_autoload.log - $(SuccessTestDiff) && touch $@ - -hadd_autoload: hadd_autoload.success diff --git a/roottest/root/io/transient/base/baseLinkDef.h b/roottest/root/io/transient/base/baseLinkDef.h index 20da7f85aef2e..00720a41597e3 100644 --- a/roottest/root/io/transient/base/baseLinkDef.h +++ b/roottest/root/io/transient/base/baseLinkDef.h @@ -1,4 +1,4 @@ -#ifdef __CINT__ +#ifdef __ROOTCLING__ #pragma link off all globals; #pragma link off all classes; #pragma link off all functions; diff --git a/roottest/root/io/transient/base/execWriteFile.ref b/roottest/root/io/transient/base/execWriteFile.ref index 15e0cb16574f8..479872d98c70f 100644 --- a/roottest/root/io/transient/base/execWriteFile.ref +++ b/roottest/root/io/transient/base/execWriteFile.ref @@ -1,5 +1,4 @@ -(int) 0 Processing execWriteFile.cxx+... Stored 42.00! Retrieved 42.00! diff --git a/roottest/root/io/transient/base/execWriteFile_win32.ref b/roottest/root/io/transient/base/execWriteFile_win32.ref index f4c8dfc4c2c33..8a1d05ed87160 100644 --- a/roottest/root/io/transient/base/execWriteFile_win32.ref +++ b/roottest/root/io/transient/base/execWriteFile_win32.ref @@ -1,5 +1,4 @@ -(int) 0 Processing execWriteFile.cxx+... Stored 42.00! diff --git a/roottest/root/io/transient/base/execWriteFile_win64.ref b/roottest/root/io/transient/base/execWriteFile_win64.ref index f4c8dfc4c2c33..8a1d05ed87160 100644 --- a/roottest/root/io/transient/base/execWriteFile_win64.ref +++ b/roottest/root/io/transient/base/execWriteFile_win64.ref @@ -1,5 +1,4 @@ -(int) 0 Processing execWriteFile.cxx+... Stored 42.00! diff --git a/roottest/root/tree/cache/.rootrc b/roottest/root/tree/cache/.rootrc deleted file mode 100644 index 6ebe75fd4ec5a..0000000000000 --- a/roottest/root/tree/cache/.rootrc +++ /dev/null @@ -1 +0,0 @@ -Rint.History: .root_hist diff --git a/roottest/root/tree/cache/CMakeLists.txt b/roottest/root/tree/cache/CMakeLists.txt index db1003ce469b9..8fc13f09c7436 100644 --- a/roottest/root/tree/cache/CMakeLists.txt +++ b/roottest/root/tree/cache/CMakeLists.txt @@ -54,22 +54,21 @@ ROOTTEST_ADD_TEST(LastCluster MACRO execLastCluster.C OUTREF execLastCluster.ref) -ROOT_GENERATE_DICTIONARY(G__TheEvent ${CMAKE_CURRENT_SOURCE_DIR}/Event.h LINKDEF EventLinkDef.h) -ROOTTEST_LINKER_LIBRARY(TheEvent TEST Event.cxx G__TheEvent.cxx LIBRARIES ${ROOT_LIBRARIES}) -ROOTTEST_ADD_TEST(perfstattest-libevent-build - COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} ${build_config} --target G__TheEvent${fast} TheEvent${fast} -- ${always-make}) +ROOTTEST_GENERATE_DICTIONARY(libRoottestTreeCacheEvent + Event.h + LINKDEF EventLinkDef.h + SOURCES Event.cxx + NO_ROOTMAP NO_CXXMODULE + FIXTURES_SETUP root-tree-cache-dict-fixture) -set(RootExeOptions -e "gSystem->Load(\"libTheEvent\")") if(compression_default STREQUAL "lz4") - ROOTTEST_ADD_TEST(perfstattest - MACRO execperfstattest.C - OUTREF execperfstattestLZ4.oref - ERRREF execperfstattest.eref - DEPENDS perfstattest-libevent-build) + set(_ref execperfstattestLZ4.oref) else() - ROOTTEST_ADD_TEST(perfstattest + set(_ref execperfstattestZLIB.oref) +endif() +ROOTTEST_ADD_TEST(perfstattest MACRO execperfstattest.C - OUTREF execperfstattestZLIB.oref + ROOTEXE_OPTS -e "(void)gSystem->Load(\"libRoottestTreeCacheEvent\")" + OUTREF ${_ref} ERRREF execperfstattest.eref - DEPENDS perfstattest-libevent-build) -endif() + FIXTURES_REQUIRED root-tree-cache-dict-fixture) diff --git a/roottest/root/tree/cache/execperfstattestLZ4.oref b/roottest/root/tree/cache/execperfstattestLZ4.oref index 17293b4a962b9..9e2051df6ce33 100644 --- a/roottest/root/tree/cache/execperfstattestLZ4.oref +++ b/roottest/root/tree/cache/execperfstattestLZ4.oref @@ -1,6 +1,5 @@ -(int) 0 -Processing /Users/mato/Development/ROOT/roottest.git/root/tree/cache/execperfstattest.C... +Processing execperfstattest.C... 9 9 (int) 0 diff --git a/roottest/root/tree/cache/execperfstattestLZ4.ref b/roottest/root/tree/cache/execperfstattestLZ4.ref deleted file mode 100644 index 435b6bf0453e3..0000000000000 --- a/roottest/root/tree/cache/execperfstattestLZ4.ref +++ /dev/null @@ -1,6 +0,0 @@ - -(int) 0 -Processing /Users/mato/Development/ROOT/roottest.git/root/tree/cache/execperfstattest.C... -11 -11 -(int) 0 \ No newline at end of file diff --git a/roottest/root/tree/cache/execperfstattestZLIB.oref b/roottest/root/tree/cache/execperfstattestZLIB.oref index e8b548562385e..fede18ca2b150 100644 --- a/roottest/root/tree/cache/execperfstattestZLIB.oref +++ b/roottest/root/tree/cache/execperfstattestZLIB.oref @@ -1,6 +1,5 @@ -(int) 0 -Processing /Users/mato/Development/ROOT/roottest.git/root/tree/cache/execperfstattest.C... +Processing execperfstattest.C... 7 8 (int) 0 diff --git a/roottest/root/tree/cache/execperfstattestZLIB.ref b/roottest/root/tree/cache/execperfstattestZLIB.ref deleted file mode 100644 index 719758a44bff4..0000000000000 --- a/roottest/root/tree/cache/execperfstattestZLIB.ref +++ /dev/null @@ -1,6 +0,0 @@ - -(int) 0 -Processing /Users/mato/Development/ROOT/roottest.git/root/tree/cache/execperfstattest.C... -7 -8 -(int) 0 \ No newline at end of file diff --git a/roottest/root/tree/cloning/CMakeLists.txt b/roottest/root/tree/cloning/CMakeLists.txt index c6837de6c7d21..df13d5af97b12 100644 --- a/roottest/root/tree/cloning/CMakeLists.txt +++ b/roottest/root/tree/cloning/CMakeLists.txt @@ -12,97 +12,81 @@ else() set(test_bin_dir "${CMAKE_BINARY_DIR}/test") endif() -set(RootExeOptions -e "gSystem->Load(\"${test_bin_dir}/libEvent\")") +ROOTTEST_ADD_TEST(hsimple-create + MACRO ${CMAKE_SOURCE_DIR}/tutorials/hsimple.C + PASSRC 255 + FIXTURES_SETUP root-tree-cloning-hsimple-fixture) + +ROOTTEST_ADD_TEST(hsimple-copy1 + FIXTURES_REQUIRED root-tree-cloning-hsimple-fixture + FIXTURES_SETUP root-tree-cloning-hsimple1-fixture + COMMAND ${CMAKE_COMMAND} -E copy hsimple.root hsimple1.root) + +ROOTTEST_ADD_TEST(hsimple-copy2 + FIXTURES_REQUIRED root-tree-cloning-hsimple-fixture + FIXTURES_SETUP root-tree-cloning-hsimple2-fixture + COMMAND ${CMAKE_COMMAND} -E copy hsimple.root hsimple2.root) + +ROOTTEST_ADD_TEST(hsimple-clone + MACRO run.C + FIXTURES_REQUIRED root-tree-cloning-hsimple1-fixture root-tree-cloning-hsimple2-fixture) + +ROOTTEST_ADD_TEST(treeCloneTest-generate + COMMAND ${test_bin_dir}/eventexe${CMAKE_EXECUTABLE_SUFFIX} 6 0 0 1 30 0 1 event1.root event2.root + DEPENDS Event eventexe + FIXTURES_SETUP root-tree-cloning-generate-fixture) ROOTTEST_ADD_TEST(treeCloneTest - PRECMD ${test_bin_dir}/eventexe${CMAKE_EXECUTABLE_SUFFIX} 6 0 0 1 30 0 1 event1.root event2.root - COMMAND ${ROOT_root_CMD} -b -q -l ${CMAKE_CURRENT_SOURCE_DIR}/run.C ${RootExeOptions} - POSTCMD ${ROOT_root_CMD} -b -q -l ${CMAKE_CURRENT_SOURCE_DIR}/runEvent.C ${RootExeOptions} - OUTREF references/treeCloneTest.ref) - -if(NOT TARGET hsimple) - add_custom_target(hsimple-file ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/hsimple.root) - add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/hsimple.root - COMMAND ${ROOT_root_CMD} -q -l -b ${ROOT_TUTORIALS_DIR}/hsimple.C -e "{ TFile f(\"hsimple.root\"); TTree *ntuple; f.GetObject(\"ntuple\",ntuple); return ntuple ? 0 : 1; }" > hsimple.log - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - DEPENDS ${HSimpleDependencies} - VERBATIM) - add_custom_command( - TARGET hsimple-file - COMMAND ${CMAKE_COMMAND} -E copy - ${CMAKE_CURRENT_BINARY_DIR}/hsimple.root - hsimple1.root - COMMAND ${CMAKE_COMMAND} -E copy - ${CMAKE_CURRENT_BINARY_DIR}/hsimple.root - hsimple2.root) -else() - add_custom_target(hsimple-file ALL DEPENDS - ${CMAKE_CURRENT_BINARY_DIR}/hsimple1.root - ${CMAKE_CURRENT_BINARY_DIR}/hsimple2.root - ) - set(HSimpleDependencies "hsimple") - add_dependencies(hsimple-file ${HSimpleDependencies}) - add_custom_command(OUTPUT - ${CMAKE_CURRENT_BINARY_DIR}/hsimple1.root - ${CMAKE_CURRENT_BINARY_DIR}/hsimple2.root - COMMAND ${CMAKE_COMMAND} -E copy - ${CMAKE_BINARY_DIR}/tutorials/hsimple.root - hsimple1.root - COMMAND ${CMAKE_COMMAND} -E copy - ${CMAKE_BINARY_DIR}/tutorials/hsimple.root - hsimple2.root) -endif() + MACRO runEvent.C + ROOTEXE_OPTS -e "(void)gSystem->Load(\"${test_bin_dir}/libEvent\")" + OUTREF references/treeCloneTest.ref + FIXTURES_REQUIRED root-tree-cloning-generate-fixture) ROOTTEST_ADD_TEST(runtreeCloneTest2 MACRO runtreeCloneTest2.C - PRECMD cp -r ${CMAKE_CURRENT_SOURCE_DIR}/files/root ${CMAKE_CURRENT_BINARY_DIR} + COPY_TO_BUILDDIR files/root/BAC85D5487F19A3B6755584FBC29B3AF_100.root files/root/BAC85D5487F19A3B6755584FBC29B3AF_107.root OUTCNVCMD grep -v Adding OUTREF references/treeCloneTest2.ref) + if(${compression_default} STREQUAL "lz4") + if(${CMAKE_SIZEOF_VOID_P} EQUAL "8") + set(_ref references/exectrimLZ4.ref) + else() + set(_ref references/exectrimLZ4_i686.ref) + endif() +elseif(${compression_default} STREQUAL "zlib") + if(ZLIB_CF) if(${CMAKE_SIZEOF_VOID_P} EQUAL "8") - ROOTTEST_ADD_TEST(exectrim - MACRO exectrim.C - COPY_TO_BUILDDIR files/output_Coulomb_LER_study_10.root - OUTREF references/exectrimLZ4.ref) + set(_ref references/exectrimZLIB_builtinzlib.ref) else() - ROOTTEST_ADD_TEST(exectrim - MACRO exectrim.C - COPY_TO_BUILDDIR files/output_Coulomb_LER_study_10.root - OUTREF references/exectrimLZ4_i686.ref) + set(_ref references/exectrimZLIB_builtinzlib_i686.ref) endif() -elseif(${compression_default} STREQUAL "zlib") - if(ZLIB_CF) - if(${CMAKE_SIZEOF_VOID_P} EQUAL "8") - ROOTTEST_ADD_TEST(exectrim - MACRO exectrim.C - COPY_TO_BUILDDIR files/output_Coulomb_LER_study_10.root - OUTREF references/exectrimZLIB_builtinzlib.ref) - else() - ROOTTEST_ADD_TEST(exectrim - MACRO exectrim.C - COPY_TO_BUILDDIR files/output_Coulomb_LER_study_10.root - OUTREF references/exectrimZLIB_builtinzlib_i686.ref) - endif() else() - if(${CMAKE_SIZEOF_VOID_P} EQUAL "8") - ROOTTEST_ADD_TEST(exectrim - MACRO exectrim.C - COPY_TO_BUILDDIR files/output_Coulomb_LER_study_10.root - OUTREF references/exectrimZLIB.ref) - else() - ROOTTEST_ADD_TEST(exectrim - MACRO exectrim.C - COPY_TO_BUILDDIR files/output_Coulomb_LER_study_10.root - OUTREF references/exectrimZLIB_i686${ref_suffix}) - endif() - endif() + if(${CMAKE_SIZEOF_VOID_P} EQUAL "8") + set(_ref references/exectrimZLIB.ref) + else() + set(_ref references/exectrimZLIB_i686${ref_suffix}) + endif() + endif() +endif() + +if(_ref) + ROOTTEST_ADD_TEST(exectrim + MACRO exectrim.C + COPY_TO_BUILDDIR files/output_Coulomb_LER_study_10.root + OUTREF ${_ref}) endif() + +ROOTTEST_ADD_TEST(deepClass-CopyTree + MACRO make_CopyTree.C + COPY_TO_BUILDDIR files/ver_40200.root + FIXTURES_SETUP root-tree-cloning-deepClass-CopyTree-fixture) + ROOTTEST_ADD_TEST(deepClass MACRO rundeepClass.C - PRECMD ${ROOT_root_CMD} -b -q -l ${CMAKE_CURRENT_SOURCE_DIR}/make_CopyTree.C - COPY_TO_BUILDDIR files/ver_40200.root - OUTREF references/deepClass.ref) + OUTREF references/deepClass.ref + FIXTURES_REQUIRED root-tree-cloning-deepClass-CopyTree-fixture) ROOTTEST_ADD_TEST(mergeWithDir MACRO runmergeWithDir.C diff --git a/roottest/root/tree/cloning/references/deepClass.ref b/roottest/root/tree/cloning/references/deepClass.ref index 387794fec5d95..e0825a8c5641d 100644 --- a/roottest/root/tree/cloning/references/deepClass.ref +++ b/roottest/root/tree/cloning/references/deepClass.ref @@ -1,5 +1,4 @@ -(int) 0 Processing rundeepClass.C... Warning in : no dictionary for class VldContext is available Warning in : no dictionary for class VldTimeStamp is available diff --git a/roottest/root/tree/cloning/references/exectrimLZ4.ref b/roottest/root/tree/cloning/references/exectrimLZ4.ref index 1a51178cb55c5..6e33128fa0a36 100644 --- a/roottest/root/tree/cloning/references/exectrimLZ4.ref +++ b/roottest/root/tree/cloning/references/exectrimLZ4.ref @@ -1,6 +1,5 @@ -(int) 0 -Processing /home/oksana/CERN_sources/root/roottest/root/tree/cloning/exectrim.C... +Processing exectrim.C... Warning in : no dictionary for class Belle2::ARICHAeroHit is available Warning in : no dictionary for class Belle2::RelationsInterface is available Warning in : no dictionary for class Belle2::ARICHSimHit is available diff --git a/roottest/root/tree/cloning/references/exectrimLZ4_i686.ref b/roottest/root/tree/cloning/references/exectrimLZ4_i686.ref index 04a18b048e898..04016b4723d78 100644 --- a/roottest/root/tree/cloning/references/exectrimLZ4_i686.ref +++ b/roottest/root/tree/cloning/references/exectrimLZ4_i686.ref @@ -1,6 +1,5 @@ -(int) 0 -Processing /home/oksana/CERN_sources/root/roottest/root/tree/cloning/exectrim.C... +Processing exectrim.C... Warning in : no dictionary for class Belle2::ARICHAeroHit is available Warning in : no dictionary for class Belle2::RelationsInterface is available Warning in : no dictionary for class Belle2::ARICHSimHit is available diff --git a/roottest/root/tree/cloning/references/exectrimZLIB.ref b/roottest/root/tree/cloning/references/exectrimZLIB.ref index 3c05a8d09a6d5..a7ed5c98803e7 100644 --- a/roottest/root/tree/cloning/references/exectrimZLIB.ref +++ b/roottest/root/tree/cloning/references/exectrimZLIB.ref @@ -1,5 +1,4 @@ -(int) 0 Processing exectrim.C... Warning in : no dictionary for class Belle2::ARICHAeroHit is available Warning in : no dictionary for class Belle2::RelationsInterface is available diff --git a/roottest/root/tree/cloning/references/exectrimZLIB_builtinzlib.ref b/roottest/root/tree/cloning/references/exectrimZLIB_builtinzlib.ref index e7916c07dbefb..9ec5a3f2ba6b8 100644 --- a/roottest/root/tree/cloning/references/exectrimZLIB_builtinzlib.ref +++ b/roottest/root/tree/cloning/references/exectrimZLIB_builtinzlib.ref @@ -1,6 +1,5 @@ -(int) 0 -Processing /home/oksana/CERN_sources/root/roottest/root/tree/cloning/exectrim.C... +Processing exectrim.C... Warning in : no dictionary for class Belle2::ARICHAeroHit is available Warning in : no dictionary for class Belle2::RelationsInterface is available Warning in : no dictionary for class Belle2::ARICHSimHit is available diff --git a/roottest/root/tree/cloning/references/exectrimZLIB_i686.ref b/roottest/root/tree/cloning/references/exectrimZLIB_i686.ref index d54ba4b7dac22..64fb7c94d4708 100644 --- a/roottest/root/tree/cloning/references/exectrimZLIB_i686.ref +++ b/roottest/root/tree/cloning/references/exectrimZLIB_i686.ref @@ -1,5 +1,4 @@ -(int) 0 Processing exectrim.C... Warning in : no dictionary for class Belle2::ARICHAeroHit is available Warning in : no dictionary for class Belle2::RelationsInterface is available diff --git a/roottest/root/tree/cloning/references/exectrimZLIB_i686_win32.ref b/roottest/root/tree/cloning/references/exectrimZLIB_i686_win32.ref index 94123efc5f0ec..6ae3974fb79b8 100644 --- a/roottest/root/tree/cloning/references/exectrimZLIB_i686_win32.ref +++ b/roottest/root/tree/cloning/references/exectrimZLIB_i686_win32.ref @@ -1,5 +1,4 @@ -(int) 0 Processing exectrim.C... Warning in : no dictionary for class Belle2::ARICHAeroHit is available Warning in : no dictionary for class Belle2::RelationsInterface is available diff --git a/roottest/root/tree/cloning/references/index.ref b/roottest/root/tree/cloning/references/index.ref index c8cf1e5b11703..0291bd9b4fe84 100644 --- a/roottest/root/tree/cloning/references/index.ref +++ b/roottest/root/tree/cloning/references/index.ref @@ -1,5 +1,4 @@ -(int) 0 Processing runindex.C... ************************************************ * Row * event.run * event.eve * event.val * diff --git a/roottest/root/tree/cloning/references/mergeWithDir.ref b/roottest/root/tree/cloning/references/mergeWithDir.ref index 5ee28823f9362..7f5a87c60d764 100644 --- a/roottest/root/tree/cloning/references/mergeWithDir.ref +++ b/roottest/root/tree/cloning/references/mergeWithDir.ref @@ -1,5 +1,4 @@ -(int) 0 Processing runmergeWithDir.C... TFile** merged.root chain files TFile* merged.root chain files diff --git a/roottest/root/tree/cloning/references/treeCloneTest.ref b/roottest/root/tree/cloning/references/treeCloneTest.ref index dcda6c1b85a40..08febffff00b6 100644 --- a/roottest/root/tree/cloning/references/treeCloneTest.ref +++ b/roottest/root/tree/cloning/references/treeCloneTest.ref @@ -1,3 +1,2 @@ -(int) 0 Processing runEvent.C... diff --git a/roottest/root/tree/cloning/references/treeCloneTest2.ref b/roottest/root/tree/cloning/references/treeCloneTest2.ref index cc6f76662107b..87ae0761bf627 100644 --- a/roottest/root/tree/cloning/references/treeCloneTest2.ref +++ b/roottest/root/tree/cloning/references/treeCloneTest2.ref @@ -1,5 +1,4 @@ -(int) 0 Processing runtreeCloneTest2.C... Warning in : no dictionary for class TChargedPionEvent is available Warning in : no dictionary for class TChargedPion is available diff --git a/roottest/root/tree/cloning/runtreeCloneTest2.C b/roottest/root/tree/cloning/runtreeCloneTest2.C index a7d7858fda5bc..cb8947b11409e 100644 --- a/roottest/root/tree/cloning/runtreeCloneTest2.C +++ b/roottest/root/tree/cloning/runtreeCloneTest2.C @@ -42,14 +42,13 @@ void MergeRootfile( TDirectory *target, TList *sourcelist ); void runtreeCloneTest2(const char* outFile = "pion_merged.root", //here's where the output histograms will go - const char* theInputDir = "./root/", //scan this directory for "mergable" files - const char* inputFileSubstring = ".root") //only files ending with this in the name will be opened for merging + const char* theInputDir = "./", //scan this directory for "mergable" files + const char* inputFileBeginsWith = "BAC85D5487F19A3B6755584FBC29B3AF_") //only files starts with this in the name will be opened for merging { FileList = new TList(); Target = TFile::Open(outFile, "RECREATE" ); - TString fileString(inputFileSubstring); TString inputDir(theInputDir); //---- Loop over directory entries, select files ----// @@ -60,7 +59,7 @@ void runtreeCloneTest2(const char* outFile = "pion_merged.root", //here's where while( (cFileName = (char*) gSystem->GetDirEntry(pDir)) ) { TString fileName(cFileName); - if(fileName.EndsWith( fileString.Data() )) { + if(fileName.EndsWith(".root") && fileName.BeginsWith(inputFileBeginsWith)) { auto fullName = gSystem->ConcatFileName(inputDir,fileName); FileList->Add( TFile::Open(fullName)); cout << " Adding " << fullName << endl;