diff --git a/roottest/root/meta/ROOT-7181/.rootrc b/roottest/root/meta/ROOT-7181/.rootrc deleted file mode 100644 index 84c31bb3db13d..0000000000000 --- a/roottest/root/meta/ROOT-7181/.rootrc +++ /dev/null @@ -1,2 +0,0 @@ -Rint.History: .root_hist -ACLiC.LinkLibs: 1 diff --git a/roottest/root/meta/ROOT-7181/CMakeLists.txt b/roottest/root/meta/ROOT-7181/CMakeLists.txt index 182629f9610bb..5bf13bcb76b20 100644 --- a/roottest/root/meta/ROOT-7181/CMakeLists.txt +++ b/roottest/root/meta/ROOT-7181/CMakeLists.txt @@ -1,8 +1,43 @@ -#------------------------------------------------------------------------------- -# -# Placeholder file to translate the tests to the new CTest system. Meanwhile we -# define a CTest test that calls 'make' in ${CMAKE_CURRENT_SOURCE_DIR} -# -#------------------------------------------------------------------------------- - -ROOTTEST_ADD_OLDTEST() +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/inc) + +ROOTTEST_GENERATE_REFLEX_DICTIONARY(btag + inc/BTagVertex_v1.h + SELECTION inc/btag_selection.xml + FIXTURES_SETUP root-meta-7181-btag-fixture) + +ROOTTEST_GENERATE_REFLEX_DICTIONARY(jet + inc/Jet_v1.h + SELECTION inc/jet_selection.xml + FIXTURES_SETUP root-meta-7181-jet-fixture) + +ROOTTEST_GENERATE_REFLEX_DICTIONARY(sjet + inc/SJet_v1.h + SELECTION inc/sjet_selection.xml + FIXTURES_SETUP root-meta-7181-sjet-fixture) + +macro(ROOT_7181_TEST name use_rmap) + if(${use_rmap} STREQUAL "true") + set(testname rmap-${name}) + else() + set(testname ${name}) + endif() + + ROOTTEST_ADD_TEST(${testname} + MACRO runscript.C + MACROARG "\"${CMAKE_CURRENT_SOURCE_DIR}/scripts/${name}.script\",${use_rmap}" + ROOTEXE_OPTS -e "gInterpreter->AddIncludePath(\"-I${CMAKE_CURRENT_SOURCE_DIR}/inc\")" + OUTREF ${testname}.ref + FIXTURES_REQUIRED root-meta-7181-btag-fixture + root-meta-7181-jet-fixture + root-meta-7181-sjet-fixture) +endmacro(ROOT_7181_TEST) + +ROOT_7181_TEST(case1 false) +ROOT_7181_TEST(case2 false) +ROOT_7181_TEST(case3 false) +ROOT_7181_TEST(case4 false) + +ROOT_7181_TEST(case1 true) +ROOT_7181_TEST(case2 true) +ROOT_7181_TEST(case3 true) +ROOT_7181_TEST(case4 true) diff --git a/roottest/root/meta/ROOT-7181/Makefile b/roottest/root/meta/ROOT-7181/Makefile deleted file mode 100644 index ba736d68ad8df..0000000000000 --- a/roottest/root/meta/ROOT-7181/Makefile +++ /dev/null @@ -1,57 +0,0 @@ -ALL_CASES = case1 case2 case3 case4 -ALL_ROOTMAP_CASES = $(addprefix rmap-,$(ALL_CASES)) - -CLEAN_TARGETS += *.log dummy* *pcm *o *rflx.* $(ALL_LIBRARIES) \ - obj/* lib/* -TEST_TARGETS += execLoadLibs $(ALL_CASES) $(ALL_ROOTMAP_CASES) - -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 - -obj/jet_dict.cxx: inc/jet_selection.xml inc/Jet_v1.h inc/DataVector.h - $(CMDECHO) mkdir -p obj lib && genreflex inc/Jet_v1.h --output obj/jet_dict.cxx -l lib/libjet.so -s inc/jet_selection.xml --rootmap lib/libjet.rootmap -Iinc - -obj/sjet_dict.cxx: inc/sjet_selection.xml inc/SJet_v1.h inc/DataVector.h - $(CMDECHO) mkdir -p obj lib && genreflex inc/SJet_v1.h --output obj/sjet_dict.cxx -l lib/libsjet.so -s inc/sjet_selection.xml --rootmap lib/libsjet.rootmap -Iinc - -obj/btag_dict.cxx: inc/btag_selection.xml inc/BTagVertex_v1.h inc/DataVector.h - $(CMDECHO) mkdir -p obj lib && genreflex inc/BTagVertex_v1.h --output obj/btag_dict.cxx -l lib/libbtag.so -s inc/btag_selection.xml --rootmap lib/libbtag.rootmap -Iinc - - -lib/libjet.$(DllSuf): obj/jet_dict.$(ObjSuf) - $(BuildFromObj) - -lib/libsjet.$(DllSuf): obj/sjet_dict.$(ObjSuf) - $(BuildFromObj) - -lib/libbtag.$(DllSuf): obj/btag_dict.$(ObjSuf) - $(BuildFromObj) - -$(ALL_CASES) : %: %.success -$(ALL_ROOTMAP_CASES) : %: %.success - -ALL_CASES_LOG = $(addsuffix .log,$(ALL_CASES)) -ALL_ROOTMAP_CASES_LOG = $(addsuffix .log,$(ALL_ROOTMAP_CASES)) - -$(addsuffix .success,$(ALL_CASES) $(ALL_ROOTMAP_CASES)) : %.success: %.log %.ref - $(SuccessTestDiff) && touch $@ - - -$(ALL_CASES_LOG): %.log: scripts/%.script lib/libjet.$(DllSuf) lib/libbtag.$(DllSuf) lib/libsjet.$(DllSuf) $(UTILS_PREREQ) $(ROOTCORELIBS) $(ROOTCINT) $(ROOTV) - $(CMDECHO) $(CALLROOTEXE) -l -b < $< > $@ 2>&1 || handleError.sh --cmd='Execution of $<' --result=$$? --log=$@ --test=$* - -$(ALL_ROOTMAP_CASES_LOG): rmap-%.log: scripts/%.script lib/libjet.$(DllSuf) lib/libbtag.$(DllSuf) lib/libsjet.$(DllSuf) $(UTILS_PREREQ) $(ROOTCORELIBS) $(ROOTCINT) $(ROOTV) - $(CMDECHO) $(CALLROOTEXE) -l -b scripts/loadrootmap.C < $< > $@ 2>&1 || handleError.sh --cmd='Execution of $<' --result=$$? --log=$@ --test=$* - - - diff --git a/roottest/root/meta/ROOT-7181/runscript.C b/roottest/root/meta/ROOT-7181/runscript.C new file mode 100644 index 0000000000000..06cb206229d57 --- /dev/null +++ b/roottest/root/meta/ROOT-7181/runscript.C @@ -0,0 +1,30 @@ +#include +#include +#include + +void runscript(const std::string &fname, bool with_rootmap = false) +{ + if (with_rootmap) { + int old = gInterpreter->SetClassAutoloading(kFALSE); + gInterpreter->LoadLibraryMap("libbtag.rootmap"); + gInterpreter->LoadLibraryMap("libjet.rootmap"); + gInterpreter->LoadLibraryMap("libsjet.rootmap"); + gInterpreter->SetClassAutoloading(old); + } + + std::ifstream f(fname); + + std::string str; + while (std::getline(f, str)) { + + if (gSystem->InheritsFrom("TWinNTSystem")) + if (str.find(".L") == 0) { + auto p = str.find(".so"); + if (p != std::string::npos) + str = str.substr(0, p) + ".dll"; + } + + if (str.length() > 0) + gInterpreter->ProcessLineSynch(str.c_str()); + } +} diff --git a/roottest/root/meta/ROOT-7181/scripts/case1.script b/roottest/root/meta/ROOT-7181/scripts/case1.script index 05272158cc514..78ec2c542a39e 100644 --- a/roottest/root/meta/ROOT-7181/scripts/case1.script +++ b/roottest/root/meta/ROOT-7181/scripts/case1.script @@ -1,6 +1,8 @@ -.L lib/libjet.so -.L lib/libbtag.so +.L libjet_dictrflx.so +.L libbtag_dictrflx.so + #include "DataVector.h" + TClass::GetClass("SG::AuxTypeVectorFactory > > >"); auto c = TClass::GetClass("DataVector")->GetClassInfo(); printf("Classinfo for DataVector is %s\n",gInterpreter->ClassInfo_IsValid(c) ? "valid" : "invalid"); diff --git a/roottest/root/meta/ROOT-7181/scripts/case2.script b/roottest/root/meta/ROOT-7181/scripts/case2.script index 187e5c72d02ef..2456556091026 100644 --- a/roottest/root/meta/ROOT-7181/scripts/case2.script +++ b/roottest/root/meta/ROOT-7181/scripts/case2.script @@ -1,6 +1,8 @@ -.L lib/libsjet.so -.L lib/libbtag.so +.L libsjet_dictrflx.so +.L libbtag_dictrflx.so + #include "DataVector.h" + TClass::GetClass("SG::AuxTypeVectorFactory > > >"); auto c = TClass::GetClass("SDataVector")->GetClassInfo(); printf("Classinfo for SDataVector is %s\n",gInterpreter->ClassInfo_IsValid(c) ? "valid" : "invalid"); diff --git a/roottest/root/meta/ROOT-7181/scripts/case3.script b/roottest/root/meta/ROOT-7181/scripts/case3.script index ed02144391419..1c556588c7ac4 100644 --- a/roottest/root/meta/ROOT-7181/scripts/case3.script +++ b/roottest/root/meta/ROOT-7181/scripts/case3.script @@ -1,6 +1,8 @@ -.L lib/libjet.so -.L lib/libbtag.so +.L libjet_dictrflx.so +.L libbtag_dictrflx.so + #include "DataVector.h" + auto c = TClass::GetClass("DataVector"); printf("TClass for DataVector is %s\n",c->IsLoaded() ? "loaded" : "not loaded"); diff --git a/roottest/root/meta/ROOT-7181/scripts/case4.script b/roottest/root/meta/ROOT-7181/scripts/case4.script index 9c3e85a5a0105..97eb23c05bd90 100644 --- a/roottest/root/meta/ROOT-7181/scripts/case4.script +++ b/roottest/root/meta/ROOT-7181/scripts/case4.script @@ -1,6 +1,8 @@ -.L lib/libjet.so -.L lib/libbtag.so +.L libjet_dictrflx.so +.L libbtag_dictrflx.so + #include "DataVector.h" + DataVector obj; std::string name; diff --git a/roottest/root/meta/ROOT-7181/scripts/loadrootmap.C b/roottest/root/meta/ROOT-7181/scripts/loadrootmap.C deleted file mode 100644 index e7807d5118489..0000000000000 --- a/roottest/root/meta/ROOT-7181/scripts/loadrootmap.C +++ /dev/null @@ -1,8 +0,0 @@ -{ -int old = gInterpreter->SetClassAutoloading(kFALSE); -gInterpreter->LoadLibraryMap("lib/libbtag.rootmap"); -gInterpreter->LoadLibraryMap("lib/libjet.rootmap"); -gInterpreter->LoadLibraryMap("lib/libsjet.rootmap"); -gInterpreter->SetClassAutoloading(old); -} -