From 451bd4f8a75dd798e95911d9c5aa556158325b41 Mon Sep 17 00:00:00 2001 From: Sergey Linev Date: Fri, 8 Aug 2025 13:16:00 +0200 Subject: [PATCH 1/8] [roottest] adjust meta/autoloading tests Use fixture and explicit tests creation By this reactivate ROOT-5759 test --- roottest/root/meta/autoloading/.rootrc | 1 - roottest/root/meta/autoloading/CMakeLists.txt | 70 ++++++++++++--- roottest/root/meta/autoloading/Makefile | 87 ------------------- .../autoloading/MissingEntriesROOT-5759.ref | 10 +-- .../meta/autoloading/NestedClasses/.rootrc | 1 - .../autoloading/NestedClasses/CMakeLists.txt | 13 +-- .../meta/autoloading/NestedClasses/Makefile | 44 ---------- .../autoloading/ROOT-12378/CMakeLists.txt | 26 ++++-- .../meta/autoloading/ROOT-8432/CMakeLists.txt | 10 ++- .../meta/autoloading/classInNamespace/.rootrc | 1 - .../classInNamespace/CMakeLists.txt | 15 ++-- .../autoloading/headerParsingOnDemand/.rootrc | 1 - .../headerParsingOnDemand/CMakeLists.txt | 31 ++++--- .../root/meta/autoloading/templates/.rootrc | 1 - .../meta/autoloading/templates/CMakeLists.txt | 24 +++-- .../root/meta/autoloading/templates/Makefile | 17 ---- 16 files changed, 137 insertions(+), 215 deletions(-) delete mode 100644 roottest/root/meta/autoloading/.rootrc delete mode 100644 roottest/root/meta/autoloading/Makefile delete mode 100644 roottest/root/meta/autoloading/NestedClasses/.rootrc delete mode 100644 roottest/root/meta/autoloading/NestedClasses/Makefile delete mode 100644 roottest/root/meta/autoloading/classInNamespace/.rootrc delete mode 100644 roottest/root/meta/autoloading/headerParsingOnDemand/.rootrc delete mode 100644 roottest/root/meta/autoloading/templates/.rootrc delete mode 100644 roottest/root/meta/autoloading/templates/Makefile diff --git a/roottest/root/meta/autoloading/.rootrc b/roottest/root/meta/autoloading/.rootrc deleted file mode 100644 index 6ebe75fd4ec5a..0000000000000 --- a/roottest/root/meta/autoloading/.rootrc +++ /dev/null @@ -1 +0,0 @@ -Rint.History: .root_hist diff --git a/roottest/root/meta/autoloading/CMakeLists.txt b/roottest/root/meta/autoloading/CMakeLists.txt index 33b94d97137be..e7a4f2dc16944 100644 --- a/roottest/root/meta/autoloading/CMakeLists.txt +++ b/roottest/root/meta/autoloading/CMakeLists.txt @@ -1,19 +1,65 @@ -ROOTTEST_GENERATE_REFLEX_DICTIONARY(classes classes.h SELECTION classes_selection.xml NO_ROOTMAP) -set(depends ${GENERATE_REFLEX_TEST}) +ROOTTEST_ADD_TESTDIRS() + +ROOTTEST_GENERATE_REFLEX_DICTIONARY(classes + classes.h + SELECTION classes_selection.xml + NO_ROOTMAP + FIXTURES_SETUP root-meta-autoloading-classes-fixture) + +ROOTTEST_GENERATE_REFLEX_DICTIONARY(ROOT7114classes + ROOT7114classes.h + SELECTION ROOT7114classes_selection.xml + FIXTURES_SETUP root-meta-autoloading-ROOT7114classes-fixture) + +ROOTTEST_GENERATE_REFLEX_DICTIONARY(TriggerTypeDefs + TriggerTypeDefs.h + SELECTION TriggerTypeDefs_selection.xml + FIXTURES_SETUP root-meta-autoloading-TriggerTypeDefs-fixture) + +ROOTTEST_ADD_TEST(ROOT7114 + MACRO assertROOT7114.C + OUTREF assertROOT7114.ref + FIXTURES_REQUIRED root-meta-autoloading-ROOT7114classes-fixture) + +ROOTTEST_ADD_TEST(AutoLoadEntriesAsSelected + MACRO execAutoLoadEntriesAsSelected.C + OUTREF execAutoLoadEntriesAsSelected.ref) -ROOTTEST_GENERATE_REFLEX_DICTIONARY(ROOT7114classes ROOT7114classes.h SELECTION ROOT7114classes_selection.xml) -set(depends ${depends} ${GENERATE_REFLEX_TEST}) +ROOTTEST_ADD_TEST(AutoloadOnInclusion + MACRO execAutoloadOnInclusion.C + COPY_TO_BUILDDIR aHeader.h aRootmap.rootmap + OUTREF execAutoloadOnInclusion.ref) -ROOTTEST_GENERATE_REFLEX_DICTIONARY(TriggerTypeDefs TriggerTypeDefs.h SELECTION TriggerTypeDefs_selection.xml) -set(depends ${depends} ${GENERATE_REFLEX_TEST}) +ROOTTEST_ADD_TEST(execTriggerTypedefs + MACRO execTriggerTypedefs.C + OUTREF execTriggerTypedefs.ref + FIXTURES_REQUIRED root-meta-autoloading-TriggerTypeDefs-fixture) + +ROOTTEST_ADD_TEST(typeDefAutoloading + MACRO exectypeDefAutoloading.C + COPY_TO_BUILDDIR exectypeDefAutoloading.rootmap + OUTREF exectypeDefAutoloading.ref + FIXTURES_REQUIRED root-meta-autoloading-classes-fixture) + +ROOTTEST_ADD_TEST(Typeinfo + MACRO execTypeinfo.cxx+ + OUTREF execTypeinfo.ref) + +ROOTTEST_ADD_TEST(MissingEntriesROOT-5759 + MACRO runFullMissingEntriesROOT-5759.C + COPY_TO_BUILDDIR MissingEntriesROOT-5759.rootmap + OUTREF MissingEntriesROOT-5759.ref) + +#ROOTTEST_ADD_TEST( +# MACRO +# OUTREF .ref) #---Copy from source to binary some of the files -configure_file(exectypeDefAutoloading.rootmap . COPYONLY) -configure_file(aRootmap.rootmap . COPYONLY) -configure_file(aHeader.h . COPYONLY) +#configure_file( . COPYONLY) +#configure_file( . COPYONLY) +#configure_file( . COPYONLY) #--With ACLiC--------------------------------------------------------- -set(execTypeinfo-suffix +) +#set(execTypeinfo-suffix +) -ROOTTEST_ADD_AUTOMACROS(DEPENDS ${depends}) -ROOTTEST_ADD_TESTDIRS() +#ROOTTEST_ADD_AUTOMACROS(DEPENDS ${depends}) diff --git a/roottest/root/meta/autoloading/Makefile b/roottest/root/meta/autoloading/Makefile deleted file mode 100644 index 3ac203318c202..0000000000000 --- a/roottest/root/meta/autoloading/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 classes_rflx.cpp lib*_dictrflx.rootmap - -# 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 += MissingEntriesROOT-5759 mytest typeDefAutoloading AutoLoadEntriesAsSelected - -# 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) - - -# Sed-away the line number. A different number of new-style rootmap files (i.e. -# with forward declarations) for example on different platforms can result in a -# different line number. -MissingEntriesROOT-5759.log: FullMissingEntriesROOT-5759.log - $(CMDECHO) cat FullMissingEntriesROOT-5759.log |sed 's/input_line_[0-9]*://g' > MissingEntriesROOT-5759.log 2>&1 - - -MissingEntriesROOT-5759: MissingEntriesROOT-5759.log - $(TestDiff) - -exectypeDefAutoloading.log: libclasses_dictrflx.$(DllSuf) - -execTriggerTypedefs.log: libTriggerTypeDefs_dictrflx.$(DllSuf) - -assertROOT7114.elog: libROOT7114classes_dictrflx.$(DllSuf) -assertROOT7114.elog: CALLROOTEXE += -e 'gSystem->AddDynamicPath("$(ROOTTEST_HOME)/root/meta/autoloading")' - - -ROOT7114classes_rflx.cpp: GENREFLEXFLAGS += --rootmap libROOT7114classes_dictrflx.rootmap --library libROOT7114classes_dictrflx.$(DllSuf) diff --git a/roottest/root/meta/autoloading/MissingEntriesROOT-5759.ref b/roottest/root/meta/autoloading/MissingEntriesROOT-5759.ref index d5f1fabddf52e..265b63a65a355 100644 --- a/roottest/root/meta/autoloading/MissingEntriesROOT-5759.ref +++ b/roottest/root/meta/autoloading/MissingEntriesROOT-5759.ref @@ -1,12 +1,8 @@ Processing runFullMissingEntriesROOT-5759.C... -1:10: fatal error: 'does_not_exist.h' file not found +input_line_26:1:10: fatal error: 'does_not_exist.h' file not found #include "does_not_exist.h" ^~~~~~~~~~~~~~~~~~ -2:6: error: expected ';' after expression +input_line_27:2:2: error: unknown type name 'cool' cool d; - ^ - ; -2:7: error: use of undeclared identifier 'd' - cool d; - ^ + ^ diff --git a/roottest/root/meta/autoloading/NestedClasses/.rootrc b/roottest/root/meta/autoloading/NestedClasses/.rootrc deleted file mode 100644 index 6ebe75fd4ec5a..0000000000000 --- a/roottest/root/meta/autoloading/NestedClasses/.rootrc +++ /dev/null @@ -1 +0,0 @@ -Rint.History: .root_hist diff --git a/roottest/root/meta/autoloading/NestedClasses/CMakeLists.txt b/roottest/root/meta/autoloading/NestedClasses/CMakeLists.txt index 00c929c03a919..b78326f27831f 100644 --- a/roottest/root/meta/autoloading/NestedClasses/CMakeLists.txt +++ b/roottest/root/meta/autoloading/NestedClasses/CMakeLists.txt @@ -1,22 +1,25 @@ ROOTTEST_GENERATE_REFLEX_DICTIONARY(nestedTemplate nestedTemplate.h - SELECTION sel1.xml) + SELECTION sel1.xml + FIXTURES_SETUP root-meta-autoloading-NestedClasses-dic1-fixture) if(NOT MSVC OR win_broken_tests) ROOTTEST_GENERATE_REFLEX_DICTIONARY(nestedTemplateClone nestedTemplate_clone.h - SELECTION sel2.xml) + SELECTION sel2.xml + FIXTURES_SETUP root-meta-autoloading-NestedClasses-dic1-fixture) endif() ROOTTEST_ADD_TEST(nestedTemplate MACRO execnestedTemplate.C OUTREF nestedTemplate.ref - DEPENDS ${GENERATE_REFLEX_TEST}) + FIXTURES_REQUIRED root-meta-autoloading-NestedClasses-dic1-fixture) ROOTTEST_GENERATE_REFLEX_DICTIONARY(nestedClasses nestedClasses.h - SELECTION nestedClasses_selection.xml) + SELECTION nestedClasses_selection.xml + FIXTURES_SETUP root-meta-autoloading-NestedClasses-dic2-fixture) ROOTTEST_ADD_TEST(nestedClasses MACRO execNestedClasses.C OUTREF execNestedClasses${ref_suffix} - DEPENDS ${GENERATE_REFLEX_TEST}) + FIXTURES_REQUIRED root-meta-autoloading-NestedClasses-dic2-fixture) diff --git a/roottest/root/meta/autoloading/NestedClasses/Makefile b/roottest/root/meta/autoloading/NestedClasses/Makefile deleted file mode 100644 index 6d905b9b2cb8d..0000000000000 --- a/roottest/root/meta/autoloading/NestedClasses/Makefile +++ /dev/null @@ -1,44 +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 *_rflx.cpp *rootmap - -# 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 += execNestedClasses - -# 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 - -GENREFLEXCXXFLAGS += --rootmap nestedClasses.rootmap --rootmap-lib libnestedClasses_dictrflx.$(DllSuf) - -execNestedClasses.log: libnestedClasses_dictrflx.$(DllSuf) - diff --git a/roottest/root/meta/autoloading/ROOT-12378/CMakeLists.txt b/roottest/root/meta/autoloading/ROOT-12378/CMakeLists.txt index 41f97c035c95a..6c5bd85b0d6f7 100644 --- a/roottest/root/meta/autoloading/ROOT-12378/CMakeLists.txt +++ b/roottest/root/meta/autoloading/ROOT-12378/CMakeLists.txt @@ -1,12 +1,20 @@ -ROOTTEST_GENERATE_REFLEX_DICTIONARY(libatlas00 classes00.hh SELECTION sel00.xml) -set(depends ${GENERATE_REFLEX_TEST}) +ROOTTEST_GENERATE_REFLEX_DICTIONARY(libatlas00 + classes00.hh + SELECTION sel00.xml + FIXTURES_SETUP root-meta-autoloading-ROOT-12378-libatlas00-fixture) -ROOTTEST_GENERATE_REFLEX_DICTIONARY(libatlas01 classes01.hh SELECTION sel01.xml) -set(depends ${depends} ${GENERATE_REFLEX_TEST}) +ROOTTEST_GENERATE_REFLEX_DICTIONARY(libatlas01 + classes01.hh + SELECTION sel01.xml + FIXTURES_SETUP root-meta-autoloading-ROOT-12378-libatlas01-fixture) -ROOTTEST_GENERATE_REFLEX_DICTIONARY(libatlas02 classes02.hh SELECTION sel02.xml) -set(depends ${depends} ${GENERATE_REFLEX_TEST}) +ROOTTEST_GENERATE_REFLEX_DICTIONARY(libatlas02 + classes02.hh + SELECTION sel02.xml + FIXTURES_SETUP root-meta-autoloading-ROOT-12378-libatlas02-fixture) - -ROOTTEST_ADD_AUTOMACROS(DEPENDS ${depends}) -ROOTTEST_ADD_TESTDIRS() +ROOTTEST_ADD_TEST(testtypedef + MACRO exec_testtypedef.C + FIXTURES_REQUIRED root-meta-autoloading-ROOT-12378-libatlas00-fixture + root-meta-autoloading-ROOT-12378-libatlas01-fixture + root-meta-autoloading-ROOT-12378-libatlas02-fixture) diff --git a/roottest/root/meta/autoloading/ROOT-8432/CMakeLists.txt b/roottest/root/meta/autoloading/ROOT-8432/CMakeLists.txt index 5e5b97d243fb7..f32811ceb25b6 100644 --- a/roottest/root/meta/autoloading/ROOT-8432/CMakeLists.txt +++ b/roottest/root/meta/autoloading/ROOT-8432/CMakeLists.txt @@ -1,5 +1,9 @@ -ROOTTEST_GENERATE_REFLEX_DICTIONARY(cmswrapper cmswrapper.h SELECTION sel.xml) -set(depends ${GENERATE_REFLEX_TEST}) +ROOTTEST_GENERATE_REFLEX_DICTIONARY(cmswrapper + cmswrapper.h + SELECTION sel.xml + FIXTURES_SETUP root-meta-autoloading-ROOT-8432-dic-fixture) -ROOTTEST_ADD_AUTOMACROS(DEPENDS ${depends}) +ROOTTEST_ADD_TEST(cmsWrapper + MACRO execcmsWrapper.C + FIXTURES_REQUIRED root-meta-autoloading-ROOT-8432-dic-fixture) diff --git a/roottest/root/meta/autoloading/classInNamespace/.rootrc b/roottest/root/meta/autoloading/classInNamespace/.rootrc deleted file mode 100644 index 6ebe75fd4ec5a..0000000000000 --- a/roottest/root/meta/autoloading/classInNamespace/.rootrc +++ /dev/null @@ -1 +0,0 @@ -Rint.History: .root_hist diff --git a/roottest/root/meta/autoloading/classInNamespace/CMakeLists.txt b/roottest/root/meta/autoloading/classInNamespace/CMakeLists.txt index 68a4f6d7607f9..cfe0c363bf0ca 100644 --- a/roottest/root/meta/autoloading/classInNamespace/CMakeLists.txt +++ b/roottest/root/meta/autoloading/classInNamespace/CMakeLists.txt @@ -1,9 +1,12 @@ -ROOTTEST_GENERATE_REFLEX_DICTIONARY(classInNamespace classInNamespace.h +ROOTTEST_GENERATE_REFLEX_DICTIONARY(classInNamespace + classInNamespace.h SELECTION classInNamespace_selection.xml LIBNAME libclassInNamespace_dictrflx - NO_ROOTMAP) + NO_ROOTMAP + FIXTURES_SETUP root-meta-autoloading-classInNamespace-dict-fixture) -#---Copy from source to binary some of the files -configure_file(classInNamespace.rootmap . COPYONLY) - -ROOTTEST_ADD_AUTOMACROS(DEPENDS ${GENERATE_REFLEX_TEST}) +ROOTTEST_ADD_TEST(ClassInNamespace + MACRO execClassInNamespace.C + OUTREF execClassInNamespace.ref + COPY_TO_BUILDDIR classInNamespace.rootmap + FIXTURES_REQUIRED root-meta-autoloading-classInNamespace-dict-fixture) \ No newline at end of file diff --git a/roottest/root/meta/autoloading/headerParsingOnDemand/.rootrc b/roottest/root/meta/autoloading/headerParsingOnDemand/.rootrc deleted file mode 100644 index 6ebe75fd4ec5a..0000000000000 --- a/roottest/root/meta/autoloading/headerParsingOnDemand/.rootrc +++ /dev/null @@ -1 +0,0 @@ -Rint.History: .root_hist diff --git a/roottest/root/meta/autoloading/headerParsingOnDemand/CMakeLists.txt b/roottest/root/meta/autoloading/headerParsingOnDemand/CMakeLists.txt index 9a1abddc0388f..f005c82f1e796 100644 --- a/roottest/root/meta/autoloading/headerParsingOnDemand/CMakeLists.txt +++ b/roottest/root/meta/autoloading/headerParsingOnDemand/CMakeLists.txt @@ -10,27 +10,29 @@ ROOTTEST_GENERATE_REFLEX_DICTIONARY(FullheaderParsingOnDemand FullheaderParsingOnDemand.h SELECTION FullheaderParsingOnDemand_selection.xml LIBNAME libFullheaderParsingOnDemand_dictrflx - NO_ROOTMAP) + NO_ROOTMAP + FIXTURES_SETUP root-meta-autoloading-headerParsingOnDemand-dic1-fixture) ROOTTEST_ADD_TEST(runFullheaderParsingOnDemand COPY_TO_BUILDDIR headerParsingOnDemand.rootmap MACRO runFullheaderParsingOnDemand.C OUTREF headerParsingOnDemand.ref OUTCNV FullheaderParsingOnDemand_convert.sh - DEPENDS ${GENERATE_REFLEX_TEST}) + FIXTURES_REQUIRED root-meta-autoloading-headerParsingOnDemand-dic1-fixture) ROOTTEST_GENERATE_REFLEX_DICTIONARY(complexTypedefs complexTypedefs.h SELECTION complexTypedefs_selection.xml LIBNAME libcomplexTypedefs_dictrflx - NO_ROOTMAP) + NO_ROOTMAP + FIXTURES_SETUP root-meta-autoloading-headerParsingOnDemand-dic2-fixture) ROOTTEST_ADD_TEST(execCheckComplexTypedefs COPY_TO_BUILDDIR complexTypedefs.rootmap MACRO execCheckComplexTypedefs.C OUTREF execCheckComplexTypedefs.ref ${WILLFAIL_ON_WIN32} - DEPENDS ${GENERATE_REFLEX_TEST}) + FIXTURES_REQUIRED root-meta-autoloading-headerParsingOnDemand-dic2-fixture) ROOTTEST_ADD_TEST(execLDAPAttribute MACRO execLDAPAttribute.C @@ -39,36 +41,41 @@ ROOTTEST_ADD_TEST(execLDAPAttribute ROOTTEST_GENERATE_REFLEX_DICTIONARY(scopedEnums scopedEnums.h SELECTION scopedEnums_selection.xml - LIBNAME libscopedEnums_dictrflx) + LIBNAME libscopedEnums_dictrflx + FIXTURES_SETUP root-meta-autoloading-headerParsingOnDemand-dic3-fixture) ROOTTEST_ADD_TEST(runscopedEnums MACRO runscopedEnums.C OUTREF scopedEnums.ref OUTCNV scopedEnums_convert.sh - DEPENDS ${GENERATE_REFLEX_TEST}) + FIXTURES_REQUIRED root-meta-autoloading-headerParsingOnDemand-dic3-fixture) ROOTTEST_GENERATE_DICTIONARY(libno_autoparse_v10 no_autoparse.h OPTIONS -DITEM_V10 + SOURCES no_autoparse_writer.cxx LINKDEF no_autoparseLinkDef.h - NO_ROOTMAP NO_CXXMODULE) + NO_ROOTMAP NO_CXXMODULE + FIXTURES_SETUP root-meta-autoloading-headerParsingOnDemand-dicv10-fixture) target_compile_definitions(libno_autoparse_v10libgen PUBLIC ITEM_V10) -target_sources(libno_autoparse_v10libgen PRIVATE no_autoparse_writer.cxx) ROOTTEST_GENERATE_DICTIONARY(libno_autoparse_v11 no_autoparse.h OPTIONS -DITEM_V11 + SOURCES no_autoparse_writer.cxx LINKDEF no_autoparseLinkDef.h - NO_ROOTMAP NO_CXXMODULE) + NO_ROOTMAP NO_CXXMODULE + FIXTURES_SETUP root-meta-autoloading-headerParsingOnDemand-dicv11-fixture) target_compile_definitions(libno_autoparse_v11libgen PUBLIC ITEM_V11) -target_sources(libno_autoparse_v11libgen PRIVATE no_autoparse_writer.cxx) ROOTTEST_ADD_TEST(no_autoparse_write MACRO no_autoparse_write.C - DEPENDS libno_autoparse_v10-build) + FIXTURES_REQUIRED root-meta-autoloading-headerParsingOnDemand-dicv10-fixture + FIXTURES_SETUP root-meta-autoloading-headerParsingOnDemand-no_autoparse_write-fixture) ROOTTEST_ADD_TEST(no_autoparse_read MACRO no_autoparse_read.cxx+ - DEPENDS libno_autoparse_v11-build no_autoparse_write) + FIXTURES_REQUIRED root-meta-autoloading-headerParsingOnDemand-dicv11-fixture + root-meta-autoloading-headerParsingOnDemand-no_autoparse_write-fixture) diff --git a/roottest/root/meta/autoloading/templates/.rootrc b/roottest/root/meta/autoloading/templates/.rootrc deleted file mode 100644 index 6ebe75fd4ec5a..0000000000000 --- a/roottest/root/meta/autoloading/templates/.rootrc +++ /dev/null @@ -1 +0,0 @@ -Rint.History: .root_hist diff --git a/roottest/root/meta/autoloading/templates/CMakeLists.txt b/roottest/root/meta/autoloading/templates/CMakeLists.txt index a49cb61c4e71c..b32865fa554cd 100644 --- a/roottest/root/meta/autoloading/templates/CMakeLists.txt +++ b/roottest/root/meta/autoloading/templates/CMakeLists.txt @@ -1,11 +1,19 @@ -ROOTTEST_GENERATE_REFLEX_DICTIONARY(classes classes.h SELECTION classes_selection.xml NO_ROOTMAP) -set(depends ${GENERATE_REFLEX_TEST}) +ROOTTEST_GENERATE_REFLEX_DICTIONARY(classes + classes.h + SELECTION classes_selection.xml + NO_ROOTMAP + FIXTURES_SETUP root-meta-autoloading-templates-classes-fixture) -ROOTTEST_GENERATE_REFLEX_DICTIONARY(classes2 classes2.h SELECTION classes2_selection.xml NO_ROOTMAP) -set(depends ${depends} ${GENERATE_REFLEX_TEST}) +ROOTTEST_GENERATE_REFLEX_DICTIONARY(classes2 + classes2.h + SELECTION classes2_selection.xml + NO_ROOTMAP + FIXTURES_SETUP root-meta-autoloading-templates-classes2-fixture) -#---Copy from source to binary some of the files -configure_file(theRootmap.rootmap . COPYONLY) - -ROOTTEST_ADD_AUTOMACROS(DEPENDS ${depends}) +ROOTTEST_ADD_TEST(TemplateAutoloading + MACRO execTemplateAutoloading.C + COPY_TO_BUILDDIR theRootmap.rootmap + OUTREF execTemplateAutoloading.ref + FIXTURES_REQUIRED root-meta-autoloading-templates-classes-fixture + root-meta-autoloading-templates-classes2-fixture) diff --git a/roottest/root/meta/autoloading/templates/Makefile b/roottest/root/meta/autoloading/templates/Makefile deleted file mode 100644 index d539e058f12c2..0000000000000 --- a/roottest/root/meta/autoloading/templates/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -CLEAN_TARGETS += *.log dummy* *pcm *o *rflx.* $(ALL_LIBRARIES) -TEST_TARGETS += execTemplateAutoloading - -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 - -execTemplateAutoloading.log: libclasses_dictrflx.$(DllSuf) libclasses2_dictrflx.$(DllSuf) From 4005cebbde44348c4a306af88b37b0ec3bf8ceba Mon Sep 17 00:00:00 2001 From: Sergey Linev Date: Fri, 8 Aug 2025 14:22:15 +0200 Subject: [PATCH 2/8] [rootest] use cmake for meta/callfunc --- roottest/root/meta/callfunc/.rootrc | 1 - roottest/root/meta/callfunc/CMakeLists.txt | 15 ++++- roottest/root/meta/callfunc/Makefile | 73 ---------------------- 3 files changed, 14 insertions(+), 75 deletions(-) delete mode 100644 roottest/root/meta/callfunc/.rootrc delete mode 100644 roottest/root/meta/callfunc/Makefile diff --git a/roottest/root/meta/callfunc/.rootrc b/roottest/root/meta/callfunc/.rootrc deleted file mode 100644 index 6ebe75fd4ec5a..0000000000000 --- a/roottest/root/meta/callfunc/.rootrc +++ /dev/null @@ -1 +0,0 @@ -Rint.History: .root_hist diff --git a/roottest/root/meta/callfunc/CMakeLists.txt b/roottest/root/meta/callfunc/CMakeLists.txt index be8e4ae6be0ae..9a89392b0d5b8 100644 --- a/roottest/root/meta/callfunc/CMakeLists.txt +++ b/roottest/root/meta/callfunc/CMakeLists.txt @@ -1 +1,14 @@ -ROOTTEST_ADD_AUTOMACROS(DEPENDS ${depends}) +ROOTTEST_ADD_TEST(Unload + MACRO assertUnload.C) + +ROOTTEST_ADD_TEST(ResolveAt + MACRO execResolveAt.C + OUTREF execResolveAt.ref) + +ROOTTEST_ADD_TEST(memberFunc + MACRO runmemberFunc.C + OUTREF memberFunc.ref) + +ROOTTEST_ADD_TEST(simpleFunc + MACRO runsimpleFunc.C + OUTREF simpleFunc.ref) diff --git a/roottest/root/meta/callfunc/Makefile b/roottest/root/meta/callfunc/Makefile deleted file mode 100644 index 2572adf15e00a..0000000000000 --- a/roottest/root/meta/callfunc/Makefile +++ /dev/null @@ -1,73 +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 - -# 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 += simpleFunc memberFunc mytest - -# 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 - - -# 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) - - - -simpleFunc: simpleFunc.log - $(TestDiff) -memberFunc: memberFunc.log - $(TestDiff) From 79c7aef58259c1c00872fa005ac7fb339baef414 Mon Sep 17 00:00:00 2001 From: Sergey Linev Date: Fri, 8 Aug 2025 15:07:45 +0200 Subject: [PATCH 3/8] [rootest] convert to cmake meta/cmsUnload First generate all dicitonaries Provide runscript.C macro which executes line by line existing scripts from scripts/ sub-directory Minimally adjust ref files --- roottest/root/meta/cmsUnload/.rootrc | 2 - roottest/root/meta/cmsUnload/CMakeLists.txt | 51 ++++++++++++--- roottest/root/meta/cmsUnload/Makefile | 65 ------------------- roottest/root/meta/cmsUnload/case1.ref | 1 + roottest/root/meta/cmsUnload/case2.ref | 1 + roottest/root/meta/cmsUnload/case3.ref | 1 + roottest/root/meta/cmsUnload/rmap-case1.ref | 2 +- roottest/root/meta/cmsUnload/rmap-case2.lref | 4 -- roottest/root/meta/cmsUnload/rmap-case2.ref | 2 +- roottest/root/meta/cmsUnload/rmap-case3.ref | 2 +- roottest/root/meta/cmsUnload/runscript.C | 28 ++++++++ .../root/meta/cmsUnload/scripts/case1.script | 6 +- .../root/meta/cmsUnload/scripts/case2.script | 4 +- .../root/meta/cmsUnload/scripts/case3.script | 4 +- .../root/meta/cmsUnload/scripts/loadrootmap.C | 8 --- .../meta/cmsUnload/{scripts => }/step2.cxx | 0 16 files changed, 84 insertions(+), 97 deletions(-) delete mode 100644 roottest/root/meta/cmsUnload/.rootrc delete mode 100644 roottest/root/meta/cmsUnload/Makefile delete mode 100644 roottest/root/meta/cmsUnload/rmap-case2.lref create mode 100644 roottest/root/meta/cmsUnload/runscript.C delete mode 100644 roottest/root/meta/cmsUnload/scripts/loadrootmap.C rename roottest/root/meta/cmsUnload/{scripts => }/step2.cxx (100%) diff --git a/roottest/root/meta/cmsUnload/.rootrc b/roottest/root/meta/cmsUnload/.rootrc deleted file mode 100644 index 84c31bb3db13d..0000000000000 --- a/roottest/root/meta/cmsUnload/.rootrc +++ /dev/null @@ -1,2 +0,0 @@ -Rint.History: .root_hist -ACLiC.LinkLibs: 1 diff --git a/roottest/root/meta/cmsUnload/CMakeLists.txt b/roottest/root/meta/cmsUnload/CMakeLists.txt index 182629f9610bb..0b1a7d9e9fdde 100644 --- a/roottest/root/meta/cmsUnload/CMakeLists.txt +++ b/roottest/root/meta/cmsUnload/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(Edm + inc/Wrapper.h + SELECTION inc/edm_selection.xml + FIXTURES_SETUP root-meta-cmsUnload-Edm-fixture) + +ROOTTEST_GENERATE_REFLEX_DICTIONARY(Strip + inc/SiStripCluster_classes.h + SELECTION inc/strip_selection.xml + FIXTURES_SETUP root-meta-cmsUnload-Strip-fixture) + +ROOTTEST_GENERATE_REFLEX_DICTIONARY(Cluster + inc/ClusterTotals.h + SELECTION inc/cluster_selection.xml + FIXTURES_SETUP root-meta-cmsUnload-Cluster-fixture) + + +macro(CMS_UNLOAD_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 + COPY_TO_BUILDDIR step2.cxx + MACROARG "\"${CMAKE_CURRENT_SOURCE_DIR}/scripts/${name}.script\",${use_rmap}" + ROOTEXE_OPTS -e "gInterpreter->AddIncludePath(\"-I${CMAKE_CURRENT_SOURCE_DIR}\")" + OUTREF ${testname}.ref + FIXTURES_REQUIRED root-meta-cmsUnload-Edm-fixture + root-meta-cmsUnload-Strip-fixture + root-meta-cmsUnload-Cluster-fixture) +endmacro(CMS_UNLOAD_TEST) + +CMS_UNLOAD_TEST(case1 false) +CMS_UNLOAD_TEST(case2 false) +CMS_UNLOAD_TEST(case3 false) + +CMS_UNLOAD_TEST(case1 true) +CMS_UNLOAD_TEST(case2 true) +CMS_UNLOAD_TEST(case3 true) diff --git a/roottest/root/meta/cmsUnload/Makefile b/roottest/root/meta/cmsUnload/Makefile deleted file mode 100644 index 3fe5b27b9a434..0000000000000 --- a/roottest/root/meta/cmsUnload/Makefile +++ /dev/null @@ -1,65 +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/edm_dict.cxx: inc/Wrapper.h inc/edm_selection.xml - $(CMDECHO) mkdir -p obj lib && genreflex inc/Wrapper.h --output obj/edm_dict.cxx -l lib/libEdm.so -Iinc -s inc/edm_selection.xml --rootmap lib/libEdm.rootmap --rootmap-lib lib/libEdm.so > edm_dict.log - -lib/libEdm.so: obj/edm_dict.$(ObjSuf) - $(BuildFromObj) - -# SiStripCluster -obj/strip_dict.cxx: inc/SiStripCluster_classes.h inc/strip_selection.xml \ - inc/DetSetNew.h inc/DetSetVector.h inc/DetSetVectorNew.h \ - inc/SiStripCluster.h - $(CMDECHO) mkdir -p obj lib && genreflex inc/SiStripCluster_classes.h --output obj/strip_dict.cxx -l lib/libStrip.so -Iinc -s inc/strip_selection.xml --rootmap lib/libStrip.rootmap > strip_dict.log - -lib/libStrip.so: obj/strip_dict.$(ObjSuf) lib/libEdm.so - $(BuildFromObj) - - -# ClusterTotals -obj/cluster_dict.cxx: inc/ClusterTotals.h inc/cluster_selection.xml inc/DetSetNew.h \ - inc/DetSetVector.h inc/DetSetVectorNew.h inc/SiStripCluster.h - $(CMDECHO) mkdir -p obj lib && genreflex inc/ClusterTotals.h --output obj/cluster_dict.cxx -l lib/libCluster.so -Iinc -s cluster_selection.xml --rootmap lib/libCluster.rootmap > cluster_dict.log - -lib/libCluster.so: obj/cluster_dict.$(ObjSuf) lib/libStrip.so - $(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/libEdm.so lib/libStrip.so lib/libCluster.so $(UTILS_PREREQ) $(ROOTCORELIBS) $(ROOTCINT) $(ROOTV) - $(CMDECHO) LD_LIBRARY_PATH=${CURDIR}/lib:${LD_LIBRARY_PATH} $(CALLROOTEXE) -l -b < $< > $@ 2>&1 || handleError.sh --cmd='Execution of $<' --result=$$? --log=$@ --test=$* - -$(ALL_ROOTMAP_CASES_LOG): rmap-%.log: scripts/%.script lib/libEdm.so lib/libStrip.so lib/libCluster.so $(UTILS_PREREQ) $(ROOTCORELIBS) $(ROOTCINT) $(ROOTV) - $(CMDECHO) LD_LIBRARY_PATH=${CURDIR}/lib:${LD_LIBRARY_PATH} $(CALLROOTEXE) -l -b scripts/loadrootmap.C < $< > $@ 2>&1 || handleError.sh --cmd='Execution of $<' --result=$$? --log=$@ --test=$* - - - diff --git a/roottest/root/meta/cmsUnload/case1.ref b/roottest/root/meta/cmsUnload/case1.ref index 8b137891791fe..7ee8ca0993f84 100644 --- a/roottest/root/meta/cmsUnload/case1.ref +++ b/roottest/root/meta/cmsUnload/case1.ref @@ -1 +1,2 @@ +Processing runscript.C... diff --git a/roottest/root/meta/cmsUnload/case2.ref b/roottest/root/meta/cmsUnload/case2.ref index 4ca4599be6f2a..034b1c4c17eca 100644 --- a/roottest/root/meta/cmsUnload/case2.ref +++ b/roottest/root/meta/cmsUnload/case2.ref @@ -1,3 +1,4 @@ +Processing runscript.C... dest dest diff --git a/roottest/root/meta/cmsUnload/case3.ref b/roottest/root/meta/cmsUnload/case3.ref index d11928205e07e..a42649b57a485 100644 --- a/roottest/root/meta/cmsUnload/case3.ref +++ b/roottest/root/meta/cmsUnload/case3.ref @@ -1,4 +1,5 @@ +Processing runscript.C... dest The [almost] end. dest diff --git a/roottest/root/meta/cmsUnload/rmap-case1.ref b/roottest/root/meta/cmsUnload/rmap-case1.ref index 396312a962f6a..7ee8ca0993f84 100644 --- a/roottest/root/meta/cmsUnload/rmap-case1.ref +++ b/roottest/root/meta/cmsUnload/rmap-case1.ref @@ -1,2 +1,2 @@ -Processing scripts/loadrootmap.C... +Processing runscript.C... diff --git a/roottest/root/meta/cmsUnload/rmap-case2.lref b/roottest/root/meta/cmsUnload/rmap-case2.lref deleted file mode 100644 index 7710466694de2..0000000000000 --- a/roottest/root/meta/cmsUnload/rmap-case2.lref +++ /dev/null @@ -1,4 +0,0 @@ - -Processing scripts/loadrootmap.C... -dest -dest diff --git a/roottest/root/meta/cmsUnload/rmap-case2.ref b/roottest/root/meta/cmsUnload/rmap-case2.ref index 7710466694de2..034b1c4c17eca 100644 --- a/roottest/root/meta/cmsUnload/rmap-case2.ref +++ b/roottest/root/meta/cmsUnload/rmap-case2.ref @@ -1,4 +1,4 @@ -Processing scripts/loadrootmap.C... +Processing runscript.C... dest dest diff --git a/roottest/root/meta/cmsUnload/rmap-case3.ref b/roottest/root/meta/cmsUnload/rmap-case3.ref index 369912fdae8f4..a42649b57a485 100644 --- a/roottest/root/meta/cmsUnload/rmap-case3.ref +++ b/roottest/root/meta/cmsUnload/rmap-case3.ref @@ -1,5 +1,5 @@ -Processing scripts/loadrootmap.C... +Processing runscript.C... dest The [almost] end. dest diff --git a/roottest/root/meta/cmsUnload/runscript.C b/roottest/root/meta/cmsUnload/runscript.C new file mode 100644 index 0000000000000..f437039bbeb1b --- /dev/null +++ b/roottest/root/meta/cmsUnload/runscript.C @@ -0,0 +1,28 @@ +#include +#include +#include +#include + +void runscript(const char *fname, bool with_rootmap = false) +{ + if (with_rootmap) { + int old = gInterpreter->SetClassAutoloading(kFALSE); + gInterpreter->LoadLibraryMap("Edm.rootmap"); + gInterpreter->LoadLibraryMap("Strip.rootmap"); + gInterpreter->LoadLibraryMap("Cluster.rootmap"); + gInterpreter->SetClassAutoloading(old); + } + + std::ifstream f(fname); + if (!f) { + std::cout << "Not able to open " << fname << std::endl; + return; + } + + std::string line; + while (std::getline(f, line)) { + // std::cout << "Process: " << line << std::endl; + gROOT->ProcessLine(line.c_str()); + } +} + diff --git a/roottest/root/meta/cmsUnload/scripts/case1.script b/roottest/root/meta/cmsUnload/scripts/case1.script index c0b1b7b2cd3d3..f04950d8b8813 100644 --- a/roottest/root/meta/cmsUnload/scripts/case1.script +++ b/roottest/root/meta/cmsUnload/scripts/case1.script @@ -1,10 +1,10 @@ #include "inc/Nothing.h" // gDebug=1; -.L lib/libEdm.so -.L lib/libStrip.so +gSystem->Load("libEdm_dictrflx"); +gSystem->Load("libStrip_dictrflx"); // step2.cxx does a lookup that provokes a auto-parsing following by // an (intentional) compilation error and thus a set of unloading. -.x scripts/step2.cxx +.x step2.cxx // This use to lead to a strange error (complain that a class is a being // defined a second time on the ... same line in the same file) which was // due to the unloading now removing the DefinitionData cached in the forward diff --git a/roottest/root/meta/cmsUnload/scripts/case2.script b/roottest/root/meta/cmsUnload/scripts/case2.script index 2f5daf2de37a0..3466aaee94ee9 100644 --- a/roottest/root/meta/cmsUnload/scripts/case2.script +++ b/roottest/root/meta/cmsUnload/scripts/case2.script @@ -1,6 +1,6 @@ struct Marker { ~Marker() { fprintf(stdout,"dest\n"); } }; -.L lib/libEdm.so -.L lib/libStrip.so +gSystem->Load("libEdm_dictrflx"); +gSystem->Load("libStrip_dictrflx"); Marker m1; Marker m2; gInterpreter->AutoParse("SiStripCluster"); diff --git a/roottest/root/meta/cmsUnload/scripts/case3.script b/roottest/root/meta/cmsUnload/scripts/case3.script index ab8633f60f1f5..26e7d0dba1713 100644 --- a/roottest/root/meta/cmsUnload/scripts/case3.script +++ b/roottest/root/meta/cmsUnload/scripts/case3.script @@ -1,6 +1,6 @@ struct Marker { ~Marker() { fprintf(stdout,"dest\n"); } }; -.L lib/libEdm.so -.L lib/libStrip.so +gSystem->Load("libEdm_dictrflx"); +gSystem->Load("libStrip_dictrflx"); Marker m1; Marker m2; gInterpreter->AutoParse("SiStripCluster"); diff --git a/roottest/root/meta/cmsUnload/scripts/loadrootmap.C b/roottest/root/meta/cmsUnload/scripts/loadrootmap.C deleted file mode 100644 index 4c98f3a1bbb35..0000000000000 --- a/roottest/root/meta/cmsUnload/scripts/loadrootmap.C +++ /dev/null @@ -1,8 +0,0 @@ -{ -int old = gInterpreter->SetClassAutoloading(kFALSE); -gInterpreter->LoadLibraryMap("lib/libEdm.rootmap"); -gInterpreter->LoadLibraryMap("lib/libStrip.rootmap"); -gInterpreter->LoadLibraryMap("lib/libCluster.rootmap"); -gInterpreter->SetClassAutoloading(old); -} - diff --git a/roottest/root/meta/cmsUnload/scripts/step2.cxx b/roottest/root/meta/cmsUnload/step2.cxx similarity index 100% rename from roottest/root/meta/cmsUnload/scripts/step2.cxx rename to roottest/root/meta/cmsUnload/step2.cxx From 5265d8fcb4949804b67727293e818f0b039126d6 Mon Sep 17 00:00:00 2001 From: Sergey Linev Date: Fri, 8 Aug 2025 15:23:28 +0200 Subject: [PATCH 4/8] [roottest] improve cmake for meta/dictSelection --- roottest/root/meta/dictSelection/.rootrc | 1 - .../root/meta/dictSelection/CMakeLists.txt | 29 +++++++++++---- roottest/root/meta/dictSelection/Makefile | 35 ------------------- .../root/meta/dictSelection/dictSelection.ref | 2 -- 4 files changed, 22 insertions(+), 45 deletions(-) delete mode 100644 roottest/root/meta/dictSelection/.rootrc delete mode 100644 roottest/root/meta/dictSelection/Makefile delete mode 100644 roottest/root/meta/dictSelection/dictSelection.ref diff --git a/roottest/root/meta/dictSelection/.rootrc b/roottest/root/meta/dictSelection/.rootrc deleted file mode 100644 index 6ebe75fd4ec5a..0000000000000 --- a/roottest/root/meta/dictSelection/.rootrc +++ /dev/null @@ -1 +0,0 @@ -Rint.History: .root_hist diff --git a/roottest/root/meta/dictSelection/CMakeLists.txt b/roottest/root/meta/dictSelection/CMakeLists.txt index 8ccf2b011aed6..9f2fe71b88d77 100644 --- a/roottest/root/meta/dictSelection/CMakeLists.txt +++ b/roottest/root/meta/dictSelection/CMakeLists.txt @@ -1,23 +1,38 @@ -ROOTTEST_GENERATE_REFLEX_DICTIONARY(AtlasTest AtlasTest.h SELECTION AtlasTest_selection.xml NO_ROOTMAP) +ROOTTEST_GENERATE_REFLEX_DICTIONARY(AtlasTest + AtlasTest.h + SELECTION AtlasTest_selection.xml + NO_ROOTMAP + FIXTURES_SETUP root-meta-dictSelection-AtlasTest-fixture) ROOTTEST_ADD_TEST(execAtlasTest MACRO execAtlasTest.C OUTREF execAtlasTest.ref - DEPENDS ${GENERATE_REFLEX_TEST}) + FIXTURES_REQUIRED root-meta-dictSelection-AtlasTest-fixture) -ROOTTEST_GENERATE_REFLEX_DICTIONARY(AtlasTest2 AtlasTest2.h SELECTION AtlasTest2_selection.xml NO_ROOTMAP) +ROOTTEST_GENERATE_REFLEX_DICTIONARY(AtlasTest2 + AtlasTest2.h + SELECTION AtlasTest2_selection.xml + NO_ROOTMAP + FIXTURES_SETUP root-meta-dictSelection-AtlasTest2-fixture) ROOTTEST_ADD_TEST(execAtlasTest2 MACRO execAtlasTest2.C OUTREF execAtlasTest2.ref - DEPENDS ${GENERATE_REFLEX_TEST}) + FIXTURES_REQUIRED root-meta-dictSelection-AtlasTest2-fixture) -ROOTTEST_GENERATE_REFLEX_DICTIONARY(classesDictSelection classesDictSelection.h SELECTION classesDictSelection_selection.xml NO_ROOTMAP) +ROOTTEST_GENERATE_REFLEX_DICTIONARY(classesDictSelection + classesDictSelection.h + SELECTION classesDictSelection_selection.xml + NO_ROOTMAP + FIXTURES_SETUP root-meta-dictSelection-classesDictSelection-fixture) ROOTTEST_ADD_TEST(classesDictSelection MACRO execDictSelection.C OUTREF execDictSelection.ref ${WILLFAIL_ON_WIN32} - DEPENDS ${GENERATE_REFLEX_TEST}) + FIXTURES_REQUIRED root-meta-dictSelection-classesDictSelection-fixture) -ROOTTEST_GENERATE_REFLEX_DICTIONARY(Dict_ex2 Dict_ex2.h SELECTION Dict_ex2_selection.xml NO_ROOTMAP) +ROOTTEST_GENERATE_REFLEX_DICTIONARY(Dict_ex2 + Dict_ex2.h + SELECTION Dict_ex2_selection.xml + NO_ROOTMAP) diff --git a/roottest/root/meta/dictSelection/Makefile b/roottest/root/meta/dictSelection/Makefile deleted file mode 100644 index 630325881e89a..0000000000000 --- a/roottest/root/meta/dictSelection/Makefile +++ /dev/null @@ -1,35 +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 *rflx* - -# 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 += execDictSelection execAtlasTest execAtlasTest2 - -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 - -# Outputs a message if the FAIL variable is null - -testWithFailure: -ifeq ($(FAIL),) - $(WarnFailTest) -endif - - -execDictSelection.log: libclassesDictSelection_dictrflx.$(DllSuf) -execAtlasTest.log: libAtlasTest_dictrflx.$(DllSuf) -execAtlasTest2.log: libAtlasTest2_dictrflx.$(DllSuf) diff --git a/roottest/root/meta/dictSelection/dictSelection.ref b/roottest/root/meta/dictSelection/dictSelection.ref deleted file mode 100644 index da7a04a980c0e..0000000000000 --- a/roottest/root/meta/dictSelection/dictSelection.ref +++ /dev/null @@ -1,2 +0,0 @@ - -Processing rundictSelection.C... From 1cdbb1dc69b805da9d40de63ecbf2a3bf56cc159 Mon Sep 17 00:00:00 2001 From: Sergey Linev Date: Fri, 8 Aug 2025 15:26:46 +0200 Subject: [PATCH 5/8] [roottest] adjust cmake for meta/enumPayloadManipulation test --- .../enumPayloadManipulation/CMakeLists.txt | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/roottest/root/meta/enumPayloadManipulation/CMakeLists.txt b/roottest/root/meta/enumPayloadManipulation/CMakeLists.txt index f740ca8d36949..d7e27d8ff9988 100644 --- a/roottest/root/meta/enumPayloadManipulation/CMakeLists.txt +++ b/roottest/root/meta/enumPayloadManipulation/CMakeLists.txt @@ -2,20 +2,25 @@ # which I cannot figure out, CMake will pass multiple times the "-D"s relative to the # cling workarounds to genreflex. Given that other tests check some properties of the # fwd declaration payload in the dictionaries, this "feature" makes them fail. -# In a sense, this is a workaround to have a sane reproducer of ROOT-9660 which does +# In a sense, this is a workaround to have a sane reproducer of ROOT-9660 which does # not interfere with the other tests. # ROOT-9660 -ROOTTEST_GENERATE_REFLEX_DICTIONARY(checkEnumFwdDeclxDict x.h SELECTION selection_x.xml) -ROOTTEST_GENERATE_REFLEX_DICTIONARY(checkEnumFwdDeclyDict y.h SELECTION selection_y.xml) +ROOTTEST_GENERATE_REFLEX_DICTIONARY(checkEnumFwdDeclxDict + x.h + SELECTION selection_x.xml + FIXTURES_SETUP root-meta-enumPayloadManipulation-x-fixture) +ROOTTEST_GENERATE_REFLEX_DICTIONARY(checkEnumFwdDeclyDict + y.h + SELECTION selection_y.xml + FIXTURES_SETUP root-meta-enumPayloadManipulation-y-fixture) -if(ROOT_pyroot_FOUND) +if(pyroot) ROOTTEST_ADD_TEST(checkEnumFwdDecl MACRO checkEnumFwdDecl.py OUTREF empty.ref ERRREF empty.ref - DEPENDS checkEnumFwdDeclyDict-libgen-build checkEnumFwdDeclxDict-libgen-build) + FIXTURES_REQUIRED root-meta-enumPayloadManipulation-x-fixture + root-meta-enumPayloadManipulation-y-fixture) endif() -ROOTTEST_ADD_TESTDIRS() - From 30f661ffa896fa25983a38eb01bcd972b116d2db Mon Sep 17 00:00:00 2001 From: Sergey Linev Date: Mon, 1 Sep 2025 08:05:04 +0200 Subject: [PATCH 6/8] [roottest] copy step2.cxx file in extra rule --- roottest/root/meta/cmsUnload/CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/roottest/root/meta/cmsUnload/CMakeLists.txt b/roottest/root/meta/cmsUnload/CMakeLists.txt index 0b1a7d9e9fdde..4ae40ee5861ee 100644 --- a/roottest/root/meta/cmsUnload/CMakeLists.txt +++ b/roottest/root/meta/cmsUnload/CMakeLists.txt @@ -15,6 +15,10 @@ ROOTTEST_GENERATE_REFLEX_DICTIONARY(Cluster SELECTION inc/cluster_selection.xml FIXTURES_SETUP root-meta-cmsUnload-Cluster-fixture) +ROOTTEST_ADD_TEST(copyfiles + COMMAND ${CMAKE_COMMAND} -E echo "copy step2.cxx" + COPY_TO_BUILDDIR step2.cxx + FIXTURES_SETUP root-meta-cmsUnload-copyfiles-fixture) macro(CMS_UNLOAD_TEST name use_rmap) if(${use_rmap} STREQUAL "true") @@ -25,13 +29,13 @@ macro(CMS_UNLOAD_TEST name use_rmap) ROOTTEST_ADD_TEST(${testname} MACRO runscript.C - COPY_TO_BUILDDIR step2.cxx MACROARG "\"${CMAKE_CURRENT_SOURCE_DIR}/scripts/${name}.script\",${use_rmap}" ROOTEXE_OPTS -e "gInterpreter->AddIncludePath(\"-I${CMAKE_CURRENT_SOURCE_DIR}\")" OUTREF ${testname}.ref FIXTURES_REQUIRED root-meta-cmsUnload-Edm-fixture root-meta-cmsUnload-Strip-fixture - root-meta-cmsUnload-Cluster-fixture) + root-meta-cmsUnload-Cluster-fixture + root-meta-cmsUnload-copyfiles-fixture) endmacro(CMS_UNLOAD_TEST) CMS_UNLOAD_TEST(case1 false) From 011a5bcd1e6fe265a275d133946521a0756e3604 Mon Sep 17 00:00:00 2001 From: Sergey Linev Date: Mon, 1 Sep 2025 08:20:34 +0200 Subject: [PATCH 7/8] [roottest] add testing of TMethodCall #19777 Provide implementation for runAllThroughTMethodCall in runmemberFunc.C test - was missing --- roottest/root/meta/callfunc/memberFunc.ref | 2 ++ roottest/root/meta/callfunc/runmemberFunc.C | 33 +++++++++++++++++---- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/roottest/root/meta/callfunc/memberFunc.ref b/roottest/root/meta/callfunc/memberFunc.ref index 20fbd4bf46a82..91ae98d646b85 100644 --- a/roottest/root/meta/callfunc/memberFunc.ref +++ b/roottest/root/meta/callfunc/memberFunc.ref @@ -5,3 +5,5 @@ A::inlineNoArgsNoReturn A::outlinedNoArgsNoReturn ====================================================== Running through TMethodCall... +A::inlineNoArgsNoReturn +A::outlinedNoArgsNoReturn diff --git a/roottest/root/meta/callfunc/runmemberFunc.C b/roottest/root/meta/callfunc/runmemberFunc.C index 0f1c94315423b..cef5bf9099ea5 100644 --- a/roottest/root/meta/callfunc/runmemberFunc.C +++ b/roottest/root/meta/callfunc/runmemberFunc.C @@ -61,15 +61,38 @@ void runAllThroughTInterpreterInterfaces() { #include "TMethodCall.h" -void runAllThroughTMethodCall() { +void runAllThroughTMethodCall() +{ printf("Running through TMethodCall...\n"); - TMethodCall method; - Long_t result_long = 0; - Double_t result_double; + A obj; + + auto cl = TClass::GetClass("A"); + if (!cl) { + printf("Class instance is not there\n"); + return; + } + + + TMethodCall method1(cl, "inlineNoArgsNoReturn", ""); + if (!method1.IsValid()) { + printf("method1 instance is not valid\n"); + return; + } + + method1.Execute(&obj); + + TMethodCall method2(cl, "outlinedNoArgsNoReturn", ""); + if (!method2.IsValid()) { + printf("method2 instance is not valid\n"); + return; + } + + method2.Execute(&obj); } -void runmemberFunc() { +void runmemberFunc() +{ runAllThroughTInterpreterInterfaces(); printf("======================================================\n"); runAllThroughTMethodCall(); From d5b489192c5dd6e3591b36cc52e781ea9813e8a8 Mon Sep 17 00:00:00 2001 From: Sergey Linev Date: Mon, 1 Sep 2025 09:28:23 +0200 Subject: [PATCH 8/8] [roottest] adjust ref file for MissingEntriesROOT-5759 test --- roottest/root/meta/autoloading/MissingEntriesROOT-5759.ref | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roottest/root/meta/autoloading/MissingEntriesROOT-5759.ref b/roottest/root/meta/autoloading/MissingEntriesROOT-5759.ref index 265b63a65a355..cdeffed3137bc 100644 --- a/roottest/root/meta/autoloading/MissingEntriesROOT-5759.ref +++ b/roottest/root/meta/autoloading/MissingEntriesROOT-5759.ref @@ -1,8 +1,8 @@ Processing runFullMissingEntriesROOT-5759.C... -input_line_26:1:10: fatal error: 'does_not_exist.h' file not found +input_line_27:1:10: fatal error: 'does_not_exist.h' file not found #include "does_not_exist.h" ^~~~~~~~~~~~~~~~~~ -input_line_27:2:2: error: unknown type name 'cool' +input_line_28:2:2: error: unknown type name 'cool' cool d; ^