Skip to content

[roottest] use cmake for root/treeproxy tests #19565

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions roottest/cmake/modules/RoottestCTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ add_definitions(
-DClingWorkAroundBrokenUnnamedReturn
-DClingWorkAroundUnnamedDetection2
-DClingWorkAroundNoPrivateClassIO
-DClingWorkAroundUnloadingVTABLES
)

# Variables to be used in CMakeLists.txt files.
Expand All @@ -56,6 +57,7 @@ set(ClingWorkAroundMissingUnloading TRUE) # disabled in Mak
set(ClingWorkAroundBrokenUnnamedReturn TRUE) # See https://sft.its.cern.ch/jira/browse/ROOT-4719
set(ClingWorkAroundNoPrivateClassIO TRUE) # See https://sft.its.cern.ch/jira/browse/ROOT-4865
set(ClingWorkAroundUnnamedDetection2 TRUE) # See https://sft.its.cern.ch/jira/browse/ROOT-8025
set(ClingWorkAroundUnloadingVTABLES TRUE) # See https://sft.its.cern.ch/jira/browse/ROOT-6219

set(PYROOT_EXTRAFLAGS --fixcling)

Expand Down
2 changes: 0 additions & 2 deletions roottest/root/treeproxy/.rootrc

This file was deleted.

130 changes: 123 additions & 7 deletions roottest/root/treeproxy/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,124 @@
#-------------------------------------------------------------------------------
#
# 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(LABELS longtest)
ROOTTEST_ADD_TESTDIRS()

ROOTTEST_ADD_TEST(leaflist
MACRO runleaflist.C
COPY_TO_BUILDDIR simPosProxy.C hsimpleProxy.C
ROOTEXE_OPTS -e "(void)gROOT->SetMacroPath(\"${CMAKE_CURRENT_BINARY_DIR}\")"
OUTREF leaflist.ref)

ROOTTEST_ADD_TEST(createRed
MACRO createRed.C
COPY_TO_BUILDDIR reduced.N00008257_0002.spill.sntp.R1_18.0.root sum.C
FIXTURES_SETUP root-treeproxy-createRed-fixture)

ROOTTEST_ADD_TEST(reducedSpill
MACRO runreducedSpill.C
ROOTEXE_OPTS -e "(void)gROOT->SetMacroPath(\"${CMAKE_CURRENT_BINARY_DIR}\")"
OUTREF reducedSpill.ref
FIXTURES_REQUIRED root-treeproxy-createRed-fixture
FIXTURES_SETUP root-treeproxy-reducedSpill-fixture)


# was not run in Makefile, run after reducedSpill while creating same red.h file again
ROOTTEST_ADD_TEST(producereducedSpill
MACRO producereducedSpill.C
ROOTEXE_OPTS -e "(void)gROOT->SetMacroPath(\"${CMAKE_CURRENT_BINARY_DIR}\")"
OUTREF producereducedSpill.ref
FIXTURES_REQUIRED root-treeproxy-reducedSpill-fixture)

ROOTTEST_ADD_TEST(createSearch
MACRO createSearch.C
COPY_TO_BUILDDIR p0dNuESearch.root pns.C
FIXTURES_SETUP root-treeproxy-createSearch-fixture)

ROOTTEST_ADD_TEST(execsearch
MACRO execsearch.C
ROOTEXE_OPTS -e "(void)gROOT->SetMacroPath(\"${CMAKE_CURRENT_BINARY_DIR}\")"
OUTREF execsearch.ref
FIXTURES_REQUIRED root-treeproxy-createSearch-fixture)

# copy files that produced TTrack class has proper set of class declaration file
ROOTTEST_ADD_TEST(copydim3files
COMMAND ${CMAKE_COMMAND} -E echo "copy dim3 files"
COPY_TO_BUILDDIR val3dim.C Track.h Track.C
FIXTURES_SETUP root-treeproxy-copydim3files-fixture)

ROOTTEST_COMPILE_MACRO(Track.C
FIXTURES_REQUIRED root-treeproxy-copydim3files-fixture
FIXTURES_SETUP root-treeproxy-Track-fixture)

ROOTTEST_COMPILE_MACRO(createvaldim3.C
BUILDLIB Track_C
FIXTURES_REQUIRED root-treeproxy-Track-fixture
FIXTURES_SETUP root-treeproxy-createvaldim3-fixture)

ROOTTEST_ADD_TEST(val3dimSel
MACRO createvaldim3.C+
ROOTEXE_OPTS -e "(void)gROOT->SetMacroPath(\"${CMAKE_CURRENT_BINARY_DIR}\")"
FIXTURES_REQUIRED root-treeproxy-createvaldim3-fixture
FIXTURES_SETUP root-treeproxy-val3dimSel-fixture)

ROOTTEST_COMPILE_MACRO(runvaldim3.C
FIXTURES_REQUIRED root-treeproxy-Track-fixture
FIXTURES_SETUP root-treeproxy-runvaldim3-fixture)

ROOTTEST_ADD_TEST(valdim3
MACRO runvaldim3.C+
OUTREF valdim3.ref
ROOTEXE_OPTS -e "(void)gROOT->SetMacroPath(\"${CMAKE_CURRENT_BINARY_DIR}\")"
-e "(void)gSystem->Load(\"Track_C\")"
FIXTURES_REQUIRED root-treeproxy-val3dimSel-fixture
root-treeproxy-runvaldim3-fixture)

ROOTTEST_COMPILE_MACRO(runfullmc.C
FIXTURES_SETUP root-treeproxy-runfullmc-fixture)

ROOTTEST_ADD_TEST(fullmcsel
MACRO runfullmc.C+
MACROARG 4
COPY_TO_BUILDDIR full-mcfile.root fullmc.cxx
ROOTEXE_OPTS -e "(void)gROOT->SetMacroPath(\"${CMAKE_CURRENT_BINARY_DIR}\")"
FIXTURES_REQUIRED root-treeproxy-runfullmc-fixture
FIXTURES_SETUP root-treeproxy-fullmcsel-fixture)

ROOTTEST_ADD_TEST(fullmc
MACRO runfullmc.C+
MACROARG 5
ROOTEXE_OPTS -e "(void)gROOT->SetMacroPath(\"${CMAKE_CURRENT_BINARY_DIR}\")"
OUTREF fullmc.ref
FIXTURES_REQUIRED root-treeproxy-runfullmc-fixture
root-treeproxy-fullmcsel-fixture)

ROOTTEST_ADD_TEST(make_tuple
MACRO runmake_tuple.C
COPY_TO_BUILDDIR make_tuple.C make_tuple_draw.C
ROOTEXE_OPTS -e "(void)gROOT->SetMacroPath(\"${CMAKE_CURRENT_BINARY_DIR}\")"
OUTREF make_tuple.ref)

ROOTTEST_ADD_TEST(friendchain
MACRO runfriendchain.C
COPY_TO_BUILDDIR vertex.C make_chains.cxx
longtree1.root longtree2.root
floattree1.root floattree2.root
ROOTEXE_OPTS -e "(void)gROOT->SetMacroPath(\"${CMAKE_CURRENT_BINARY_DIR}\")"
OUTREF friendchain.ref)

ROOTTEST_ADD_TEST(btagobjsSel
MACRO runbtagobjs.C
MACROARG 4
ROOTEXE_OPTS -e "(void)gROOT->SetMacroPath(\"${CMAKE_CURRENT_BINARY_DIR}\")"
COPY_TO_BUILDDIR btagobjs.root btagobjsScript.h btagobjsScript.cxx
FIXTURES_SETUP root-treeproxy-btagobjsSel-fixture)

ROOTTEST_ADD_TEST(btagobjsProxy
MACRO runbtagobjs.C
MACROARG 5
ROOTEXE_OPTS -e "(void)gROOT->SetMacroPath(\"${CMAKE_CURRENT_BINARY_DIR}\")"
OUTREF btagobjsProxy.ref
FIXTURES_REQUIRED root-treeproxy-btagobjsSel-fixture)

ROOTTEST_ADD_TEST(VectorProxyTest
MACRO execVectorProxyTest.C
COPY_TO_BUILDDIR VectorProxyTest.h VectorProxyTest.C VectorProxyTest.root
ROOTEXE_OPTS -e "(void)gROOT->SetMacroPath(\"${CMAKE_CURRENT_BINARY_DIR}\")"
OUTREF execVectorProxyTest.ref)
180 changes: 0 additions & 180 deletions roottest/root/treeproxy/Makefile

This file was deleted.

1 change: 0 additions & 1 deletion roottest/root/treeproxy/SpecialDirs

This file was deleted.

2 changes: 1 addition & 1 deletion roottest/root/treeproxy/Track.C
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "Track.h"

#if defined(__MAKECINT__) && !defined(R__ACLIC_ROOTMAP)
#ifdef __ROOTCLING__
#pragma link C++ class Track+;
#endif
2 changes: 1 addition & 1 deletion roottest/root/treeproxy/Track.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Track : public TObject {
}
}
}
ClassDef(Track,1);
ClassDefOverride(Track,1);
};
#endif

22 changes: 10 additions & 12 deletions roottest/root/treeproxy/createvaldim3.C
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
#include <TFile.h>
#include <TTree.h>
#include <TClass.h>
#include <TClonesArray.h>
#include "Track.h"

#if defined(R__MACOSX) && !defined(MAC_OS_X_VERSION_10_5)
# include "Track.C"
#else
# if defined(__CINT__) && !defined(__MAKECINT__)
# include "Track.C+"
# else
# include "Track.h"
# endif
#endif

void createvaldim3(bool process = false)
void createvaldim3(bool process = false)
{
auto cl = TClass::GetClass("Track");

printf("Track class %p\n", cl);

if (cl) printf("Declaration file %s\n", cl->GetDeclFileName());

Double_t a[2][3][4];
Double_t bb[2][3];
Int_t c[2];
Expand Down Expand Up @@ -47,5 +45,5 @@ void createvaldim3(bool process = false)

t->MakeProxy("val3dimSel","val3dim.C");
if (process) t->Process("val3dimSel.h+");

}
Loading
Loading