FixtureBase.h
Go to the documentation of this file.
1 #ifndef fhiclcpp_test_types_FixtureBase_h
2 #define fhiclcpp_test_types_FixtureBase_h
3 
4 // ======================================================================
5 //
6 // Test struct for BOOST fixture tests
7 //
8 // ======================================================================
9 
10 #include "fhiclcpp/ParameterSet.h"
11 #include "fhiclcpp/types/Table.h"
12 
13 namespace fhiclcpp_types {
14 
15  template <typename Config>
16  struct FixtureBase {
17 
19  : pset{get_pset(filename)}
20  , config{pset.get<fhicl::ParameterSet>("pset"), {}}
21  {}
22 
25 
26  private:
29  {
30  using namespace fhicl;
31  putenv(const_cast<char*>("FHICL_FILE_PATH=./test:."));
32  cet::filepath_lookup policy("FHICL_FILE_PATH");
33  std::string cfg_in(filename);
34  return ParameterSet::make(cfg_in, policy);
35  }
36  };
37 }
38 
39 #endif /* fhiclcpp_test_types_FixtureBase_h */
40 
41 // Local variables:
42 // mode: c++
43 // End:
FixtureBase(std::string const &filename)
Definition: FixtureBase.h:18
std::string string
Definition: nybbler.cc:12
string filename
Definition: train.py:213
T get(std::string const &key) const
Definition: ParameterSet.h:271
fhicl::Table< Config > config
Definition: FixtureBase.h:24
fhicl::ParameterSet pset
Definition: FixtureBase.h:23
unique_ptr< InputSource > make(ParameterSet const &conf, InputSourceDescription &desc)
fhicl::ParameterSet get_pset(std::string const &filename)
Definition: FixtureBase.h:28