Skip to content

Commit c061944

Browse files
committed
[roottest] move text scripts into runscript.C
Use of ProcessLine does not work on CI nodes
1 parent 86e112f commit c061944

File tree

6 files changed

+30
-44
lines changed

6 files changed

+30
-44
lines changed

roottest/root/meta/ROOT-7181/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ macro(ROOT_7181_TEST name use_rmap)
2424

2525
ROOTTEST_ADD_TEST(${testname}
2626
MACRO runscript.C
27-
MACROARG "\"${CMAKE_CURRENT_SOURCE_DIR}/scripts/${name}.script\",${use_rmap}"
27+
MACROARG "\"${name}\",${use_rmap}"
2828
ROOTEXE_OPTS -e "gInterpreter->AddIncludePath(\"-I${CMAKE_CURRENT_SOURCE_DIR}\")"
2929
-e "gInterpreter->AddIncludePath(\"-I${CMAKE_CURRENT_SOURCE_DIR}/inc\")"
3030
OUTREF ${testname}.ref

roottest/root/meta/ROOT-7181/runscript.C

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
#include <sstream>
44
#include <string>
55

6-
void runscript(const char *fname, bool with_rootmap = false)
6+
7+
#include "DataVector.h"
8+
9+
void runscript(const std::string &name, bool with_rootmap = false)
710
{
811
if (with_rootmap) {
912
int old = gInterpreter->SetClassAutoloading(kFALSE);
@@ -13,16 +16,31 @@ void runscript(const char *fname, bool with_rootmap = false)
1316
gInterpreter->SetClassAutoloading(old);
1417
}
1518

16-
std::ifstream f(fname);
17-
if (!f) {
18-
std::cout << "Not able to open " << fname << std::endl;
19-
return;
20-
}
21-
22-
std::string line;
23-
while (std::getline(f, line)) {
24-
// std::cout << "Process: " << line << std::endl;
25-
gROOT->ProcessLine(line.c_str());
19+
if (name == "case1") {
20+
gSystem->Load("libjet_dictrflx");
21+
gSystem->Load("libbtag_dictrflx");
22+
TClass::GetClass("SG::AuxTypeVectorFactory<std::vector<ElementLink<DataVector<xAOD::Jet_v1> > > >");
23+
auto c = TClass::GetClass("DataVector<xAOD::Jet_v1>")->GetClassInfo();
24+
printf("Classinfo for DataVector<xAOD::Jet_v1> is %s\n",gInterpreter->ClassInfo_IsValid(c) ? "valid" : "invalid");
25+
} else if (name == "case2") {
26+
gSystem->Load("libsjet_dictrflx");
27+
gSystem->Load("libbtag_dictrflx");
28+
TClass::GetClass("SG::AuxTypeVectorFactory<std::vector<ElementLink<SDataVector<xAOD::SJet_v1> > > >");
29+
auto c = TClass::GetClass("SDataVector<xAOD::SJet_v1>")->GetClassInfo();
30+
printf("Classinfo for SDataVector<xAOD::SJet_v1> is %s\n",gInterpreter->ClassInfo_IsValid(c) ? "valid" : "invalid");
31+
} else if (name == "case3") {
32+
gSystem->Load("libjet_dictrflx");
33+
gSystem->Load("libbtag_dictrflx");
34+
auto c = TClass::GetClass("DataVector<xAOD::Jet_v1>");
35+
printf("TClass for DataVector<xAOD::Jet_v1> is %s\n",c->IsLoaded() ? "loaded" : "not loaded");
36+
} else if (name == "case4") {
37+
gSystem->Load("libjet_dictrflx");
38+
gSystem->Load("libbtag_dictrflx");
39+
gROOT->ProcessLine("DataVector<xAOD::Jet_v1> obj;");
40+
std::string name;
41+
TClassEdit::GetNormalizedName(name,"DataVector<xAOD::Jet_v1>");
42+
// TClass::GetClass("DataVector<xAOD::Jet_v1>");
43+
printf("Normalized name for DataVector<xAOD::Jet_v1> is : %s\n",name.c_str());
2644
}
2745
}
2846

roottest/root/meta/ROOT-7181/scripts/case1.script

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

roottest/root/meta/ROOT-7181/scripts/case2.script

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

roottest/root/meta/ROOT-7181/scripts/case3.script

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

roottest/root/meta/ROOT-7181/scripts/case4.script

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

0 commit comments

Comments
 (0)