#include <UnitTestFixture.h>
|
| static std::map< std::shared_ptr< Driver >, std::string > | m_jobs |
Definition at line 22 of file UnitTestFixture.h.
◆ checkFileExecuted()
| void EL::UnitTestFixture::checkFileExecuted |
( |
const std::string & | sampleName | ) |
|
Definition at line 210 of file UnitTestFixture.cxx.
212 {
213 std::set<std::string> filesOut;
214 {
215 SH::SampleHandler
sh;
217 SH::Sample *
sample =
sh.get (sampleName);
218 if (sample == nullptr)
220 auto vec = readVectorFromTree (sample,
"EventLoop_FileExecuted",
"file");
221 filesOut.insert (
vec.begin(),
vec.end());
222 }
223 std::set<std::string> filesIn;
225 {
227 if (
split == std::string::npos)
229 else
232 ASSERT_TRUE (filesIn.find (fileName) == filesIn.end());
233 filesIn.insert (fileName);
234 }
235 ASSERT_EQ (filesIn, filesOut);
236 }
std::vector< size_t > vec
#define RCU_THROW_MSG(message)
SH::SamplePtr getSample(const std::string &sameName)
std::vector< std::string > split(const std::string &s, const std::string &t=":")
◆ eventCount()
| unsigned EL::UnitTestFixture::eventCount |
( |
const std::string & | sampleName | ) |
|
Definition at line 193 of file UnitTestFixture.cxx.
195 {
197 return hist->GetBinContent (1);
198 }
T * getHist(const std::string &sampleName, const std::string &objectName, bool isMandatory)
◆ getCallbacks()
| TH1 * EL::UnitTestFixture::getCallbacks |
( |
const std::string & | sampleName | ) |
|
◆ getHist()
template<typename T>
| T * EL::UnitTestFixture::getHist |
( |
const std::string & | sampleName, |
|
|
const std::string & | objectName, |
|
|
bool | isMandatory ) |
◆ getJob()
| std::string EL::UnitTestFixture::getJob |
( |
| ) |
|
Definition at line 138 of file UnitTestFixture.cxx.
140 {
141 using namespace asg::msgUserCode;
143
144 std::shared_ptr<Driver>
driver = GetParam().m_driver;
148
151 GetParam().setupJob (job);
152 {
153 EL::AnaAlgorithmConfig
config;
154 config.setType (
"EL::UnitTestAlg2");
155 config.setName (
"newAlg");
156 config.setUseXAODs (
false);
158 job.algsAdd (config);
159 }
160 {
161 std::unique_ptr<UnitTestAlg1>
alg (
new UnitTestAlg1);
162 job.algsAdd (
alg.release());
163 }
164
165 std::ostringstream submit;
166 submit <<
"submit-" <<
driver.get();
167 driver->submit (job, submit.str());
168 driver->wait (submit.str());
170 return submit.str();
171 }
static std::map< std::shared_ptr< Driver >, std::string > m_jobs
SH::SampleHandler getSH()
◆ getSample()
| SH::SamplePtr EL::UnitTestFixture::getSample |
( |
const std::string & | sameName | ) |
|
Definition at line 75 of file UnitTestFixture.cxx.
77 {
78 if (sampleName == "empty")
79 {
80 static SH::SamplePtr
result;
82 {
83 std::unique_ptr<SH::SampleLocal> myresult (new SH::SampleLocal ("empty"));
85 result = myresult.release();
86 }
88 }
89 if (sampleName == "single")
90 {
91 static SH::SamplePtr
result;
93 {
94 std::unique_ptr<SH::SampleLocal> myresult (new SH::SampleLocal ("single"));
96 for (
unsigned iter = 0;
iter != 10000; ++
iter)
99 result = myresult.release();
100 }
102 }
103 if (sampleName == "multi")
104 {
105 static SH::SamplePtr
result;
107 {
108 std::unique_ptr<SH::SampleLocal> myresult (new SH::SampleLocal ("multi"));
109 for (unsigned jter = 0; jter != 10; ++ jter)
110 {
112 for (
unsigned iter = 0;
iter != 10000; ++
iter)
115 }
116 result = myresult.release();
117 }
119 }
121 }
std::string makeFile(const std::vector< unsigned > &entries)
◆ getSH()
◆ getTObject()
| TObject * EL::UnitTestFixture::getTObject |
( |
const std::string & | sampleName, |
|
|
const std::string & | objectName, |
|
|
bool | isMandatory ) |
Definition at line 175 of file UnitTestFixture.cxx.
179 {
180 SH::SampleHandler
sh;
182 SH::Sample *
sample =
sh.get (sampleName);
183 if (sample == nullptr)
185 TObject *
object =
sample->readHist (objectName);
186 if (isMandatory && object == nullptr)
189 }
◆ makeFile()
| std::string EL::UnitTestFixture::makeFile |
( |
const std::vector< unsigned > & | entries | ) |
|
|
private |
Definition at line 240 of file UnitTestFixture.cxx.
242 {
243 static unsigned index = 0;
246
247 std::unique_ptr<SH::DiskWriter>
file
248 = GetParam().make_file_writer (
fileName.str());
249 {
251 {
252 TTree *
tree =
new TTree (
"physics",
"physics");
253 Int_t el_n = 0;
254 tree->Branch (
"el_n", &el_n,
"el_n/I");
256 {
259 }
260 }
261 file->file()->Write ();
263 }
265 }
◆ m_jobs
| std::map< std::shared_ptr< Driver >, std::string > EL::UnitTestFixture::m_jobs |
|
staticprivate |
The documentation for this class was generated from the following files: