Skip to content

Commit 36db1d8

Browse files
committed
[roottest] use cmake for root/treeformula/parse
1 parent 7cfa690 commit 36db1d8

File tree

9 files changed

+169
-391
lines changed

9 files changed

+169
-391
lines changed

roottest/root/treeformula/parse/.rootrc

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 118 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,119 @@
1-
#-------------------------------------------------------------------------------
2-
#
3-
# Placeholder file to translate the tests to the new CTest system. Meanwhile we
4-
# define a CTest test that calls 'make' in ${CMAKE_CURRENT_SOURCE_DIR}
5-
#
6-
#-------------------------------------------------------------------------------
7-
ROOTTEST_ADD_OLDTEST(LABELS longtest)
1+
ROOTTEST_ADD_TEST(StringFormula
2+
MACRO testString.C
3+
OUTREF testStringFormula.ref)
84

5+
ROOTTEST_ADD_TEST(BoolOpt
6+
MACRO testBoolOpt.C
7+
OUTREF testBoolOpt.ref)
8+
9+
ROOTTEST_ADD_TEST(expotest
10+
MACRO runexpotest.C
11+
OUTREF expotest.ref)
12+
13+
# test was failing before, but now seems to be mean value calculated correctly
14+
ROOTTEST_ADD_TEST(NonFormulaMean
15+
MACRO NonFormulaMean.C
16+
OUTREF NonFormulaMean.ref)
17+
18+
ROOTTEST_ADD_TEST(BoolOrder
19+
MACRO runBoolOrder.C
20+
COPY_TO_BUILDDIR mksm.root sm.root
21+
OUTREF BoolOrder.ref)
22+
23+
if(NOT MSVC AND NOT ClingWorkAroundUnloadingVTABLES)
24+
# test uses grep internally therefore not run on Windows
25+
26+
ROOTTEST_ADD_TEST(copymacros
27+
COMMAND ${CMAKE_COMMAND} -E echo "copy macros"
28+
COPY_TO_BUILDDIR forproxy.C templateName.cpp
29+
FIXTURES_SETUP root-treeformula-parse-copy_macros-fixture)
30+
31+
ROOTTEST_COMPILE_MACRO(templateName.cpp
32+
FIXTURES_REQUIRED root-treeformula-parse-copy_macros-fixture
33+
FIXTURES_SETUP root-treeformula-parse-templateName_cpp-fixture)
34+
35+
ROOTTEST_ADD_TEST(templateName
36+
MACRO runtemplateName.C
37+
OUTREF templateName.ref
38+
ROOTEXE_OPTS -e "gROOT->SetMacroPath(\"${CMAKE_CURRENT_BINARY_DIR}\")"
39+
OUTCNVCMD grep -v -e "ROOT version" -v -e "Creating library" -e "from Tree" -e "found on file" -e "TBranchProxy::Setup" -e "creating shared" -e "Warning in <TClassTable::Add>: class generatedSel already in TClassTable" -e "Not unloading file" -e "unloading" -e "::UnloadFile"
40+
LABELS longtest
41+
FIXTURES_REQUIRED root-treeformula-parse-templateName_cpp-fixture)
42+
endif()
43+
44+
ROOTTEST_ADD_TEST(templateBase
45+
MACRO runtemplateBase.C
46+
COPY_TO_BUILDDIR CaloJets.root
47+
OUTREF templateBase.ref)
48+
49+
ROOTTEST_ADD_TEST(aliases
50+
MACRO runaliases.C
51+
OUTREF aliases.ref)
52+
53+
ROOTTEST_ADD_TEST(AliasTest
54+
MACRO execAliasTest.C
55+
COPY_TO_BUILDDIR McGen-E5-T45-P0-MonteCarloMcHitsC100743.root
56+
OUTREF execAliasTest.ref)
57+
58+
ROOTTEST_ADD_TEST(branchSlash
59+
MACRO execbranchSlash.C
60+
OUTREF execbranchSlash.ref)
61+
62+
ROOTTEST_COMPILE_MACRO(gausbug.cxx
63+
FIXTURES_SETUP root-treeformula-parse-gausbug-fixture)
64+
65+
ROOTTEST_ADD_TEST(gaus
66+
MACRO rungaus.C
67+
OUTREF gaus.ref
68+
FIXTURES_REQUIRED root-treeformula-parse-gausbug-fixture)
69+
70+
ROOTTEST_ADD_TEST(cscan
71+
MACRO runcscan.C+
72+
OUTREF cscan.ref)
73+
74+
ROOTTEST_COMPILE_MACRO(EventTcaMember.cc
75+
FIXTURES_SETUP root-treeformula-parse-EventTcaMember-fixture)
76+
77+
ROOTTEST_ADD_TEST(functca
78+
MACRO runfunctca.C
79+
OUTREF functca.ref
80+
ROOTEXE_OPTS -e "(void)gROOT->ProcessLine(\".L EventTcaMember.cc+\")"
81+
FIXTURES_REQUIRED root-treeformula-parse-EventTcaMember-fixture)
82+
83+
ROOTTEST_COMPILE_MACRO(PEvent.cc
84+
FIXTURES_SETUP root-treeformula-parse-PEvent-fixture)
85+
86+
ROOTTEST_ADD_TEST(PEvent
87+
MACRO runPEvent.C
88+
OUTREF PEvent.ref
89+
ROOTEXE_OPTS -e "(void)gROOT->ProcessLine(\".L PEvent.cc+\")"
90+
FIXTURES_REQUIRED root-treeformula-parse-PEvent-fixture)
91+
92+
# does not work, but not triggered in the makefile
93+
ROOTTEST_ADD_TEST(strings
94+
MACRO runstrings.C
95+
COPY_TO_BUILDDIR itsdb.2006-03-17-22-28-46.root
96+
WILLFAIL
97+
OUTREF strings.ref)
98+
99+
ROOTTEST_COMPILE_MACRO(runbase.C
100+
FIXTURES_SETUP root-treeformula-parse-runbase-fixture)
101+
102+
ROOTTEST_ADD_TEST(writebase
103+
MACRO runbase.C+
104+
MACROARG "true"
105+
FIXTURES_REQUIRED root-treeformula-parse-runbase-fixture
106+
FIXTURES_SETUP root-treeformula-parse-writebase-fixture)
107+
108+
ROOTTEST_ADD_TEST(base
109+
MACRO runbase.C+
110+
OUTREF base.ref
111+
FIXTURES_REQUIRED root-treeformula-parse-writebase-fixture)
112+
113+
ROOTTEST_ADD_TEST(form
114+
MACRO runform.C
115+
OUTREF form.ref)
116+
117+
ROOTTEST_ADD_TEST(nodot
118+
MACRO runnodot.C+
119+
OUTREF nodot.ref)

roottest/root/treeformula/parse/Makefile

Lines changed: 0 additions & 116 deletions
This file was deleted.

roottest/root/treeformula/parse/NonFormulaMean.C

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33

44
Double_t gauss(Double_t *x, Double_t *par)
55
{
6-
return (par[0] * TMath::Gaus(x[0],par[1],par[2]));
6+
return (par[0] * TMath::Gaus(x[0],par[1],par[2]));
77
}
88

99
int NonFormulaMean()
1010
{
1111
TF1 *g1 = new TF1("hh3", gauss, 0, 10, 3);
12-
g1->SetParameters(1, 1, 1);
12+
g1->SetParameters(1, 5, 1);
1313
g1->Draw();
1414
Double_t m1 = g1->Mean(0, 10);
15-
return false; // because we know it is failling!
16-
}
15+
printf("Mean is %5.2f\n", m1);
16+
return 0;
17+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
Processing NonFormulaMean.C...
3+
Info in <TCanvas::MakeDefCanvas>: created default TCanvas with name c1
4+
Mean is 5.00
5+
(int) 0

roottest/root/treeformula/parse/gaus.ref-ClingWorkAroundCallfuncAndConversion

Lines changed: 0 additions & 3 deletions
This file was deleted.

roottest/root/treeformula/parse/templateName.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ void plot_my_i()
1717
{
1818
C c, *cp(&c);
1919
C c2, *cp2(&c2);
20-
20+
21+
TFile *f = TFile::Open("mytree.root", "recreate");
2122
TTree *t = new TTree("mytree", "Icecube", 10000);
2223

2324
t->Branch("my_c", "C", &cp);
@@ -37,12 +38,16 @@ void plot_my_i()
3738
t->Scan("plot_my_i.i:against_my_i.i","","",10);
3839
t->ResetBranchAddresses();
3940
//t->StartViewer();
41+
42+
delete t;
43+
delete f;
4044
}
4145

4246
class C2 { public: int i; };
4347
void makeclass()
4448
{
4549
C2 c, *cp(&c);
50+
TFile *f = TFile::Open("mytreemk.root", "recreate");
4651
TTree *t = new TTree("mytreemk", "foo", 10000);
4752
t->Branch("my_c", "C2", &cp);
4853
t->Branch("other_c.", "C2", &cp);
@@ -54,6 +59,8 @@ void makeclass()
5459
t->Draw("forproxy.C+","","goff");
5560
gSystem->Exec("diff generatedSel.old generatedSel.h");
5661
t->ResetBranchAddresses();
62+
delete t;
63+
delete f;
5764
}
5865

5966
void templateName() { plot_my_i(); makeclass(); }

0 commit comments

Comments
 (0)