Skip to content
Merged
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
4 changes: 2 additions & 2 deletions cmake/modules/RootMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2756,7 +2756,7 @@ macro(ROOTTEST_SETUP_MACROTEST)
set(root_buildcmd ${ROOT_root_CMD} ${RootExeDefines} -q -l -b)

# Compile macro, then add to CTest.
if(ARG_MACRO MATCHES "[.]C\\+" OR ARG_MACRO MATCHES "[.]cxx\\+")
if(ARG_MACRO MATCHES "[.]C\\+" OR ARG_MACRO MATCHES "[.]cxx\\+" OR ARG_MACRO MATCHES "[.]cpp\\+" OR ARG_MACRO MATCHES "[.]cc\\+")
string(REPLACE "+" "" compile_name "${ARG_MACRO}")
get_filename_component(realfp ${compile_name} REALPATH)

Expand All @@ -2767,7 +2767,7 @@ macro(ROOTTEST_SETUP_MACROTEST)
endif()

# Add interpreted macro to CTest.
elseif(ARG_MACRO MATCHES "[.]C" OR ARG_MACRO MATCHES "[.]cxx")
elseif(ARG_MACRO MATCHES "[.]C" OR ARG_MACRO MATCHES "[.]cxx" OR ARG_MACRO MATCHES "[.]cpp" OR ARG_MACRO MATCHES "[.]cc")
get_filename_component(realfp ${ARG_MACRO} REALPATH)
if(DEFINED ARG_MACROARG)
set(realfp "${realfp}(${ARG_MACROARG})")
Expand Down
1 change: 0 additions & 1 deletion roottest/root/tree/branches/.rootrc

This file was deleted.

125 changes: 114 additions & 11 deletions roottest/root/tree/branches/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,116 @@
#-------------------------------------------------------------------------------
#
# 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)

# New tests follow

# ROOT-5983
ROOTTEST_ADD_TEST(initOffset
MACRO initOffset.C+)
MACRO initOffset.C+)

ROOTTEST_ADD_TEST(abc_rflx
COMMAND ${ROOT_genreflex_CMD} ${CMAKE_CURRENT_SOURCE_DIR}/abc.h -o abc_rflx.cpp
FIXTURES_SETUP root-tree-branches-abc-rflx-dict-fixture)

ROOTTEST_COMPILE_MACRO(abc.h
FIXTURES_SETUP root-tree-branches-abc-fixture)

ROOTTEST_GENERATE_REFLEX_DICTIONARY(abc_rflx abc.h
SELECTION selection.xml
LIBNAME libabc_rflx
NO_ROOTMAP
FIXTURES_SETUP root-tree-branches-libabc_rflx-fixture)

set(_opts_cint -e "(void)gROOT->ProcessLine(\".L abc.h+\")")
set(_opts_rflx -e "(void)gSystem->Load(\"libabc_rflx\")")

ROOTTEST_ADD_TEST(abc-cint-write
MACRO abcwrite.C
MACROARG "\"cint\""
ROOTEXE_OPTS ${_opts_cint}
FIXTURES_REQUIRED root-tree-branches-abc-fixture
FIXTURES_SETUP root-tree-branches-abc-cint-write-fixture)

ROOTTEST_ADD_TEST(abc-reflex-write
MACRO abcwrite.C
MACROARG "\"reflex\""
ROOTEXE_OPTS ${_opts_rflx}
FIXTURES_REQUIRED root-tree-branches-libabc_rflx-fixture
FIXTURES_SETUP root-tree-branches-abc-reflex-write-fixture)

ROOTTEST_ADD_TEST(abc-cint-cint-read
MACRO abcread.C
MACROARG "\"cint\",\"cint\""
ROOTEXE_OPTS ${_opts_cint}
OUTREF abc.ref
FIXTURES_REQUIRED root-tree-branches-abc-cint-write-fixture
root-tree-branches-abc-fixture)

ROOTTEST_ADD_TEST(abc-cint-reflex-read
MACRO abcread.C
MACROARG "\"cint\",\"reflex\""
ROOTEXE_OPTS ${_opts_rflx}
OUTREF abc.ref
FIXTURES_REQUIRED root-tree-branches-abc-cint-write-fixture
root-tree-branches-libabc_rflx-fixture)

ROOTTEST_ADD_TEST(abc-reflex-cint-read
MACRO abcread.C
MACROARG "\"reflex\",\"cint\""
ROOTEXE_OPTS ${_opts_cint}
OUTREF abc.ref
FIXTURES_REQUIRED root-tree-branches-abc-reflex-write-fixture
root-tree-branches-abc-fixture)

ROOTTEST_ADD_TEST(abc-reflex-reflex-read
MACRO abcread.C
MACROARG "\"reflex\",\"reflex\""
ROOTEXE_OPTS ${_opts_rflx}
OUTREF abc.ref
FIXTURES_REQUIRED root-tree-branches-abc-reflex-write-fixture
root-tree-branches-libabc_rflx-fixture)

ROOTTEST_ADD_TEST(MakeClass
MACRO assertMakeClass.C
ERRREF assertMakeClass.ref)

ROOTTEST_ADD_TEST(bref
MACRO execbref.C
OUTREF execbref.ref)

ROOTTEST_ADD_TEST(DupNames
MACRO execDupNames.cxx+
OUTREF execDupNames.ref)

ROOTTEST_ADD_TEST(EmptyBase
MACRO execEmptyBase.cxx+
OUTREF execEmptyBase.ref)

ROOTTEST_ADD_TEST(GetBranch
MACRO execGetBranch.cxx+
OUTREF execGetBranch.ref)

ROOTTEST_ADD_TEST(LeafFullName
MACRO execLeafFullName.cxx+
OUTREF execLeafFullName.ref)

ROOTTEST_ADD_TEST(WriteRead
MACRO execWriteRead.C
OUTREF execWriteRead.ref)

ROOTTEST_ADD_TEST(simple
MACRO runsimple.C+
OUTREF simple.ref)

ROOTTEST_ADD_TEST(i_simple
MACRO runsimple.C
OUTREF i_simple.ref)

ROOTTEST_ADD_TEST(noname
MACRO runnoname.C
OUTREF noname.ref)

# on windows test fails while after reading of treeobj.root file branch.root left open
if(NOT MSVC OR win_broken_tests)
ROOTTEST_ADD_TEST(separate
MACRO runseparate.C
OUTREF separate.ref)
endif()

ROOTTEST_ADD_TEST(updates
MACRO runupdates.C
OUTREF updates.ref)
140 changes: 0 additions & 140 deletions roottest/root/tree/branches/Makefile

This file was deleted.

14 changes: 7 additions & 7 deletions roottest/root/tree/branches/abc.h
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
class ABC {
class BaseABC {
public:
ABC(int i = -1): abc(i) {}
virtual ~ABC() {}
BaseABC(int i = -1): abc(i) {}
virtual ~BaseABC() {}
virtual int pv() = 0;
int abc;
};

class Derived: public ABC {
class Derived: public BaseABC {
public:
~Derived() override {}
Derived(int i = -2): ABC(i+1), derived(i) {}
Derived(int i = -2): BaseABC(i+1), derived(i) {}

int pv() override { return abc + derived; }
int derived;
};

class Holder {
public:
Holder(): fABC(0) {}
Holder(): fABC(nullptr) {}
~Holder() { delete fABC; }

void Set(int i) { delete fABC; fABC = new Derived(i); }

ABC* fABC;
BaseABC* fABC;
};

1 change: 1 addition & 0 deletions roottest/root/tree/branches/abc.ref
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

Processing abcread.C...
20: read d.abc==20, d.derived==19
40: read d.abc==40, d.derived==39
60: read d.abc==60, d.derived==59
Expand Down
9 changes: 3 additions & 6 deletions roottest/root/tree/branches/abcread.C
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#include "abcsetup.h"

void abcread(const char* mode, const char* what) {
abcsetup(mode);

void abcread(const char* mode, const char* what)
{
TFile f(TString::Format("abc_%s.root", mode));
TTree* t = 0;
f.GetObject("tree", t);
Expand All @@ -14,5 +11,5 @@ void abcread(const char* mode, const char* what) {
Derived * d = (Derived*) h->fABC;
std::cout << e << ": read d.abc==" << d->abc
<< ", d.derived==" << d->derived << std::endl;
}
}
}
17 changes: 0 additions & 17 deletions roottest/root/tree/branches/abcsetup.h

This file was deleted.

10 changes: 3 additions & 7 deletions roottest/root/tree/branches/abcwrite.C
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
#include "abcsetup.h"

void abcwrite(const char* mode) {
abcsetup(mode);
void abcwrite(const char* mode)
{
Holder h;

TFile f(TString::Format("abc_%s.root", mode), "recreate");
TTree* tree = new TTree("tree", "abc tree");
tree->Branch("h", &h);
for (int e = 0; e < 100; ++e) {
h.Set(e);
// gDebug = 3;
tree->Fill();
gDebug = 0;
tree->Fill();
}
tree->Write();
delete tree;
Expand Down
Loading
Loading