Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Private Member Functions | Private Attributes | List of all members
testing::BasicTesterEnvironment< ConfigurationClass > Class Template Reference

Environment for a test. More...

#include <unit_test_base.h>

Inheritance diagram for testing::BasicTesterEnvironment< ConfigurationClass >:
testing::details::CommandLineArguments testing::TesterEnvironment< CRMGeometryConfiguration > testing::TesterEnvironment< CRMGeometryConfiguration > testing::TesterEnvironment< StandardGeometryConfiguration > testing::TesterEnvironment< StandardGeometryConfiguration > testing::TesterEnvironment< ConfigurationClass > testing::TesterEnvironment< ConfigurationClass > testing::GeometryTesterEnvironment< CRMGeometryConfiguration > testing::GeometryTesterEnvironment< CRMGeometryConfiguration > testing::GeometryTesterEnvironment< StandardGeometryConfiguration > testing::GeometryTesterEnvironment< StandardGeometryConfiguration > testing::GeometryTesterEnvironment< ConfigurationClass > testing::GeometryTesterEnvironment< ConfigurationClass > testing::GeometryTesterEnvironment< CRMGeometryConfiguration > testing::GeometryTesterEnvironment< CRMGeometryConfiguration > testing::GeometryTesterEnvironment< StandardGeometryConfiguration > testing::GeometryTesterEnvironment< StandardGeometryConfiguration > testing::GeometryTesterEnvironment< ConfigurationClass > testing::GeometryTesterEnvironment< ConfigurationClass >

Classes

struct  Options_t
 Test environment options. More...
 

Public Types

using Configuration_t = ConfigurationClass
 
using Configuration_t = ConfigurationClass
 

Public Member Functions

 BasicTesterEnvironment (bool bSetup=true)
 Constructor: sets everything up and declares the test started. More...
 
virtual ~BasicTesterEnvironment ()
 Destructor: closing remarks. More...
 
 BasicTesterEnvironment (bool bSetup=true)
 Constructor: sets everything up and declares the test started. More...
 
virtual ~BasicTesterEnvironment ()
 Destructor: closing remarks. More...
 
 BasicTesterEnvironment (Configuration_t const &cfg_obj, bool bSetup=true)
 Setup from a configuration. More...
 
 BasicTesterEnvironment (Configuration_t &&cfg_obj, bool bSetup=true)
 
Configuration retrieval
fhicl::ParameterSet const & Parameters () const
 Returns the full configuration. More...
 
fhicl::ParameterSet ServiceParameters (std::string service_name) const
 Returns the configuration of the specified service. More...
 
fhicl::ParameterSet TesterParameters (std::string test_name) const
 Returns the configuration of the specified test. More...
 
fhicl::ParameterSet TesterParameters () const
 Returns the configuration of the main test (undefined if no main test) More...
 
fhicl::ParameterSet const & Parameters () const
 Returns the full configuration. More...
 
fhicl::ParameterSet ServiceParameters (std::string service_name) const
 Returns the configuration of the specified service. More...
 
fhicl::ParameterSet TesterParameters (std::string test_name) const
 Returns the configuration of the specified test. More...
 
fhicl::ParameterSet TesterParameters () const
 Returns the configuration of the main test (undefined if no main test) More...
 
 BasicTesterEnvironment (Configuration_t const &configurer, bool bSetup=true)
 Setup from a configuration. More...
 
 BasicTesterEnvironment (Configuration_t &&configurer, bool bSetup=true)
 

Static Public Member Functions

static fhicl::ParameterSet CompileParameterSet (std::string cfg)
 Compiles a parameter set from a string. More...
 
static fhicl::ParameterSet CompileParameterSet (std::string cfg)
 

Protected Member Functions

Configuration_t const & Config () const
 Returns a read-only version of the configuration. More...
 
virtual void Setup ()
 The complete initialization, ran at construction by default. More...
 
virtual void Configure ()
 Reads and translates the configuration. More...
 
virtual fhicl::ParameterSet DefaultParameters () const
 Creates a full configuration for the test. More...
 
Configuration_t const & Config () const
 Returns a read-only version of the configuration. More...
 
virtual void Setup ()
 The complete initialization, ran at construction by default. More...
 
virtual void Configure ()
 Reads and translates the configuration. More...
 
virtual fhicl::ParameterSet DefaultParameters () const
 Creates a full configuration for the test. More...
 
virtual void SetupMessageFacility (fhicl::ParameterSet const &pset, std::string appl_name="") const
 Sets up the message facility. More...
 
virtual void SetupMessageFacility () const
 
virtual void SetupMessageFacility (fhicl::ParameterSet const &pset, std::string appl_name="") const
 Sets up the message facility. More...
 
virtual void SetupMessageFacility () const
 

Static Protected Member Functions

static fhicl::ParameterSet ParseParameters (std::string config_path)
 Fills the test configuration from file or from default. More...
 
static fhicl::ParameterSet ParseParameters (std::string config_path)
 Fills the test configuration from file or from default. More...
 

Private Member Functions

void FillArgumentsFromCommandLine ()
 
void ParseEnvironmentOptions ()
 Parses the configuration, looking for the test environment options. More...
 
- Private Member Functions inherited from testing::details::CommandLineArguments
 CommandLineArguments ()
 Constructor: automatically parses from Boost arguments. More...
 
 CommandLineArguments (int argc, char **argv)
 Constructor: parses from specified arguments. More...
 
void ParseArguments (int argc, char **argv)
 Parses arguments. More...
 
std::string Executable () const
 Returns the name of the executable as started. More...
 
std::vector< std::string > const & Arguments () const
 Returns the list of non-Boost-test arguments on the command line. More...
 
bool hasArgument (size_t iArg) const
 Returns whether we have arguments up to the iArg-th (0-based) More...
 
std::string const & Argument (size_t iArg) const
 Returns the value of the iArg-th (0-based; no range check!) More...
 
 CommandLineArguments ()
 Constructor: automatically parses from Boost arguments. More...
 
 CommandLineArguments (int argc, char **argv)
 Constructor: parses from specified arguments. More...
 
void ParseArguments (int argc, char **argv)
 Parses arguments. More...
 
std::string Executable () const
 Returns the name of the executable as started. More...
 
std::vector< std::string > const & Arguments () const
 Returns the list of non-Boost-test arguments on the command line. More...
 
bool hasArgument (size_t iArg) const
 Returns whether we have arguments up to the iArg-th (0-based) More...
 
std::string const & Argument (size_t iArg) const
 Returns the value of the iArg-th (0-based; no range check!) More...
 

Private Attributes

Configuration_t config
 instance of the configurer More...
 
fhicl::ParameterSet params
 full configuration of the test More...
 
Options_t options
 options for the test environment More...
 

Detailed Description

template<typename ConfigurationClass>
class testing::BasicTesterEnvironment< ConfigurationClass >

Environment for a test.


Template Parameters
ConfigurationClassa class providing compile-time configuration

The test environment is set up on construction.

The environment provides:

This class or a derived one can be used as global fixture for unit tests.

Unfortunately Boost does not give any control on the initialization of the object, so everything must be ready to go as hard coded. The ConfigurationClass class tries to alleviate that. That is another, small static class that BasicTesterEnvironment uses to get its parameters.

The requirements for the ConfigurationClass are:

Whether the configuration comes from a file or from the two provided defaults, it is always expected within the parameter set paths: the default configuration must also contain that path.

Note that there is no room for polymorphism here since the setup happens on construction. Some methods are declared virtual in order to allow to tweak some steps of the set up, but it's not trivial to create a derived class that works correctly: the derived class must declare a new default constructor, and that default constructor must call the protected constructor (BasicTesterEnvironment<ConfigurationClass>(no_setup))

Definition at line 558 of file unit_test_base.h.

Member Typedef Documentation

template<typename ConfigurationClass>
using testing::BasicTesterEnvironment< ConfigurationClass >::Configuration_t = ConfigurationClass

Definition at line 561 of file unit_test_base.h.

template<typename ConfigurationClass>
using testing::BasicTesterEnvironment< ConfigurationClass >::Configuration_t = ConfigurationClass

Definition at line 563 of file unit_test_base.h.

Constructor & Destructor Documentation

template<typename ConfigurationClass>
testing::BasicTesterEnvironment< ConfigurationClass >::BasicTesterEnvironment ( bool  bSetup = true)
inline

Constructor: sets everything up and declares the test started.

The configuration is from a default-constructed ConfigurationClass. This is suitable for use as Boost unit test fixture.

Definition at line 569 of file unit_test_base.h.

569 { if (bSetup) Setup(); }
virtual void Setup()
The complete initialization, ran at construction by default.
template<typename ConfigurationClass>
testing::BasicTesterEnvironment< ConfigurationClass >::BasicTesterEnvironment ( Configuration_t const &  cfg_obj,
bool  bSetup = true 
)
inline

Setup from a configuration.

Parameters
configureran instance of ConfigurationClass

The configuration is from the specified configurer class.

This constructor allows to use a non-default-constructed configuration. This can't be used (at best of my knowledge) when using this class as Boost unit test fixture.

In the r-value-reference constructor, the configurer is moved.

Definition at line 584 of file unit_test_base.h.

584  :
585  config(cfg_obj)
586  { if (bSetup) Setup(); }
Configuration_t config
instance of the configurer
virtual void Setup()
The complete initialization, ran at construction by default.
template<typename ConfigurationClass>
testing::BasicTesterEnvironment< ConfigurationClass >::BasicTesterEnvironment ( Configuration_t &&  cfg_obj,
bool  bSetup = true 
)
inline

Definition at line 587 of file unit_test_base.h.

587  :
588  config(cfg_obj)
589  { if (bSetup) Setup(); }
Configuration_t config
instance of the configurer
virtual void Setup()
The complete initialization, ran at construction by default.
template<typename ConfigurationClass >
testing::BasicTesterEnvironment< ConfigurationClass >::~BasicTesterEnvironment ( )
virtual

Destructor: closing remarks.

Definition at line 1054 of file unit_test_base.h.

1054  {
1055 
1056  mf::LogInfo("Test") << config.ApplicationName() << " completed.";
1057 
1058  } // BasicTesterEnvironment<>::~BasicTesterEnvironment()
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
Configuration_t config
instance of the configurer
template<typename ConfigurationClass>
testing::BasicTesterEnvironment< ConfigurationClass >::BasicTesterEnvironment ( bool  bSetup = true)
inline

Constructor: sets everything up and declares the test started.

Parameters
bSetup(default: true) call Setup() after construction

The configuration is from a default-constructed ConfigurationClass. This is suitable for use as Boost unit test fixture.

Definition at line 572 of file unit_test_base.h.

572 { if (bSetup) Setup(); }
virtual void Setup()
The complete initialization, ran at construction by default.
template<typename ConfigurationClass>
testing::BasicTesterEnvironment< ConfigurationClass >::BasicTesterEnvironment ( Configuration_t const &  configurer,
bool  bSetup = true 
)
inline

Setup from a configuration.

Parameters
configureran instance of ConfigurationClass
bSetup(default: true) call Setup() after construction

The configuration is from the specified configurer class.

This constructor allows to use a non-default-constructed configuration. This can't be used (at best of my knowledge) when using this class as Boost unit test fixture.

In the r-value-reference constructor, the configurer is moved.

Definition at line 589 of file unit_test_base.h.

589  :
590  config(configurer)
591  { if (bSetup) Setup(); }
Configuration_t config
instance of the configurer
virtual void Setup()
The complete initialization, ran at construction by default.
template<typename ConfigurationClass>
testing::BasicTesterEnvironment< ConfigurationClass >::BasicTesterEnvironment ( Configuration_t &&  configurer,
bool  bSetup = true 
)
inline

Definition at line 592 of file unit_test_base.h.

592  :
593  config(configurer)
594  { if (bSetup) Setup(); }
Configuration_t config
instance of the configurer
virtual void Setup()
The complete initialization, ran at construction by default.
template<typename ConfigurationClass>
virtual testing::BasicTesterEnvironment< ConfigurationClass >::~BasicTesterEnvironment ( )
virtual

Destructor: closing remarks.

Member Function Documentation

template<typename ConfigurationClass >
fhicl::ParameterSet testing::BasicTesterEnvironment< ConfigurationClass >::CompileParameterSet ( std::string  cfg)
static

Compiles a parameter set from a string.


Returns
a parameters set with the complete configuration

Definition at line 1068 of file unit_test_base.h.

1069  {
1070  //fhicl::ParameterSet global_pset;
1071  //fhicl::make_ParameterSet(cfg, global_pset);
1072  auto global_pset = fhicl::ParameterSet::make(cfg);
1073  return global_pset;
1074  } // BasicTesterEnvironment<>::CompileParameterSet()
static ParameterSet make(intermediate_table const &tbl)
Definition: ParameterSet.cc:68
template<typename ConfigurationClass>
static fhicl::ParameterSet testing::BasicTesterEnvironment< ConfigurationClass >::CompileParameterSet ( std::string  cfg)
static
template<typename ConfigurationClass>
Configuration_t const& testing::BasicTesterEnvironment< ConfigurationClass >::Config ( ) const
inlineprotected

Returns a read-only version of the configuration.

Definition at line 630 of file unit_test_base.h.

630 { return config; }
Configuration_t config
instance of the configurer
template<typename ConfigurationClass>
Configuration_t const& testing::BasicTesterEnvironment< ConfigurationClass >::Config ( void  ) const
inlineprotected

Returns a read-only version of the configuration.

Definition at line 635 of file unit_test_base.h.

635 { return config; }
Configuration_t config
instance of the configurer
template<typename ConfigurationClass >
void testing::BasicTesterEnvironment< ConfigurationClass >::Configure ( )
protectedvirtual

Reads and translates the configuration.

Fills the configuration.


The complete configuration (message facility and services) is read and saved, hence accessible by Parameters() method.

The configuration file path is taken by default from the first argument of the test. If that first argument is not present or empty, the default configuration path is received from the configurer. If the configuration path is still empty, a hard-coded configuration is used; otherwise, the FHiCL file specified in that path is parsed and used as full configuration.

Definition at line 1122 of file unit_test_base.h.

1122  {
1123  std::string config_path = config.ConfigurationPath();
1124  params = config_path.empty()?
1125  DefaultParameters(): ParseParameters(config_path);
1126  } // BasicTesterEnvironment::Configure()
static fhicl::ParameterSet ParseParameters(std::string config_path)
Fills the test configuration from file or from default.
virtual fhicl::ParameterSet DefaultParameters() const
Creates a full configuration for the test.
std::string string
Definition: nybbler.cc:12
Configuration_t config
instance of the configurer
template<typename ConfigurationClass>
virtual void testing::BasicTesterEnvironment< ConfigurationClass >::Configure ( )
protectedvirtual

Reads and translates the configuration.

template<typename ConfigurationClass>
virtual fhicl::ParameterSet testing::BasicTesterEnvironment< ConfigurationClass >::DefaultParameters ( ) const
inlineprotectedvirtual

Creates a full configuration for the test.

Returns
a parameters set with the complete configuration

Definition at line 642 of file unit_test_base.h.

643  { return CompileParameterSet(config.DefaultConfiguration()); }
Configuration_t config
instance of the configurer
static fhicl::ParameterSet CompileParameterSet(std::string cfg)
Compiles a parameter set from a string.
template<typename ConfigurationClass>
virtual fhicl::ParameterSet testing::BasicTesterEnvironment< ConfigurationClass >::DefaultParameters ( ) const
inlineprotectedvirtual

Creates a full configuration for the test.

Returns
a parameters set with the complete configuration

Definition at line 647 of file unit_test_base.h.

648  { return CompileParameterSet(config.DefaultConfiguration()); }
Configuration_t config
instance of the configurer
static fhicl::ParameterSet CompileParameterSet(std::string cfg)
Compiles a parameter set from a string.
template<typename ConfigurationClass>
void testing::BasicTesterEnvironment< ConfigurationClass >::FillArgumentsFromCommandLine ( )
private
template<typename ConfigurationClass>
fhicl::ParameterSet const& testing::BasicTesterEnvironment< ConfigurationClass >::Parameters ( ) const
inline

Returns the full configuration.

Definition at line 600 of file unit_test_base.h.

600 { return params; }
fhicl::ParameterSet params
full configuration of the test
template<typename ConfigurationClass>
fhicl::ParameterSet const& testing::BasicTesterEnvironment< ConfigurationClass >::Parameters ( ) const
inline

Returns the full configuration.

Definition at line 605 of file unit_test_base.h.

605 { return params; }
fhicl::ParameterSet params
full configuration of the test
template<typename ConfigurationClass >
void testing::BasicTesterEnvironment< ConfigurationClass >::ParseEnvironmentOptions ( )
private

Parses the configuration, looking for the test environment options.

Definition at line 1221 of file unit_test_base.h.

1221  {
1222 
1223  struct OptionsFromConfig_t {
1224  fhicl::Atom<bool> messageLevels{
1225  fhicl::Name("messageLevels"),
1226  fhicl::Comment("prints a message per level (to verify the visible ones"),
1227  false // default: no
1228  };
1229  fhicl::Atom<bool> printOptions{
1230  fhicl::Name("printOptions"),
1231  fhicl::Comment("prints a the list of options (this is one of them!)"),
1232  false // default: no
1233  };
1234  }; // OptionsFromConfig_t
1235 
1236 
1237  struct ValidationHelper {
1238  static void printDummy(std::ostream& out)
1239  {
1241  (fhicl::Name("test"), fhicl::Comment("Test environment options"))
1243  } // printDummy()
1244 
1246  (fhicl::ParameterSet const& pset)
1247  {
1248  try {
1249  return fhicl::Table<OptionsFromConfig_t>(pset, {});
1250  }
1251  catch (...) {
1252  std::cerr << "Error parsing environment test options! Valid options:"
1253  << std::endl;
1254  ValidationHelper::printDummy(std::cerr);
1255  throw;
1256  }
1257  } // validate()
1258  };
1259 
1260 
1261  fhicl::ParameterSet pset = params.get<fhicl::ParameterSet>("test", {});
1262 
1263  // automatically performs validation
1266 
1267  if (configTable().printOptions()) {
1268  std::cout
1269  << "The following options can be passed to the test environment"
1270  << " by putting them in the \"test: {}\" table of the configuration file:"
1271  << std::endl;
1272  ValidationHelper::printDummy(std::cout);
1273  }
1274 
1275  options.MessageLevels = configTable().messageLevels();
1276 
1277  } // BasicTesterEnvironment<>::ParseEnvironmentOptions()
Options_t options
options for the test environment
ChannelGroupService::Name Name
std::string print_allowed_configuration(LibraryInfo const &li, std::string const &prefix, std::string const &type_spec)
bool MessageLevels
print message levels on screen
def validate(nxgraph, desc)
Definition: graph.py:45
#define Comment
QTextStream & endl(QTextStream &s)
template<typename ConfigurationClass >
fhicl::ParameterSet testing::BasicTesterEnvironment< ConfigurationClass >::ParseParameters ( std::string  config_path)
staticprotected

Fills the test configuration from file or from default.

Returns the configuration from a FHiCL file.

If a FHiCL configuration file is specified, the configuration of the test is read from it according to the parameter set path of the test. Otherwise, it is parsed from the default one provided by the configurer.Parses from file and returns a FHiCL data structure


Parameters
config_pathfull path of the FHiCL configuration file
Returns
a parameters set with the complete configuration from the file

Definition at line 1085 of file unit_test_base.h.

1086  {
1087  // configuration file lookup policy
1088  char const* fhicl_env = getenv("FHICL_FILE_PATH");
1089  std::string search_path = fhicl_env? std::string(fhicl_env) + ":": ".:";
1090  details::FirstAbsoluteOrLookupWithDotPolicy policy(search_path);
1091 
1092  // parse a configuration file; obtain intermediate form
1093  //fhicl::intermediate_table table;
1094  //fhicl::parse_document(config_path, policy, table);
1095  // idiom for art 3.0.9
1096  auto table = fhicl::parse_document(config_path, policy);
1097 
1098  // translate into a parameter set
1099  //fhicl::ParameterSet global_pset;
1100  //fhicl::make_ParameterSet(table, global_pset);
1101  auto global_pset = fhicl::ParameterSet::make(table);
1102 
1103  return global_pset;
1104  } // BasicTesterEnvironment<>::ParseParameters()
std::string string
Definition: nybbler.cc:12
static ParameterSet make(intermediate_table const &tbl)
Definition: ParameterSet.cc:68
std::string getenv(std::string const &name)
Definition: getenv.cc:15
intermediate_table parse_document(std::string const &filename, cet::filepath_maker &maker)
Definition: parse.cc:720
template<typename ConfigurationClass>
static fhicl::ParameterSet testing::BasicTesterEnvironment< ConfigurationClass >::ParseParameters ( std::string  config_path)
staticprotected

Fills the test configuration from file or from default.

If a FHiCL configuration file is specified, the configuration of the test is read from it according to the parameter set path of the test. Otherwise, it is parsed from the default one provided by the configurer.Parses from file and returns a FHiCL data structure

template<typename ConfigurationClass>
fhicl::ParameterSet testing::BasicTesterEnvironment< ConfigurationClass >::ServiceParameters ( std::string  service_name) const
inline

Returns the configuration of the specified service.

Definition at line 603 of file unit_test_base.h.

604  {
605  return params.get<fhicl::ParameterSet>
606  (config.ServiceParameterSetPath(service_name));
607  }
Configuration_t config
instance of the configurer
template<typename ConfigurationClass>
fhicl::ParameterSet testing::BasicTesterEnvironment< ConfigurationClass >::ServiceParameters ( std::string  service_name) const
inline

Returns the configuration of the specified service.

Definition at line 608 of file unit_test_base.h.

609  {
610  return params.get<fhicl::ParameterSet>
611  (config.ServiceParameterSetPath(service_name));
612  }
Configuration_t config
instance of the configurer
template<typename ConfigurationClass >
void testing::BasicTesterEnvironment< ConfigurationClass >::Setup ( )
protectedvirtual

The complete initialization, ran at construction by default.

Reimplemented in testing::GeometryTesterEnvironment< ConfigurationClass >, testing::GeometryTesterEnvironment< ConfigurationClass >, testing::GeometryTesterEnvironment< CRMGeometryConfiguration >, testing::GeometryTesterEnvironment< CRMGeometryConfiguration >, testing::GeometryTesterEnvironment< StandardGeometryConfiguration >, and testing::GeometryTesterEnvironment< StandardGeometryConfiguration >.

Definition at line 1168 of file unit_test_base.h.

1169  {
1170 
1171  //
1172  // get the configuration
1173  //
1174  Configure();
1175 
1176  //
1177  // set up the message facility
1178  //
1180 
1181  //
1182  // Optionally print the configuration
1183  //
1184  {
1185  mf::LogInfo msg("Configuration");
1186  msg << "Complete configuration (";
1187  if (config.ConfigurationPath().empty()) msg << "default";
1188  else msg << "'" << config.ConfigurationPath() << "'";
1189  msg << "):\n" << Parameters().to_indented_string(1);
1190  }
1191 
1192 
1193  mf::LogInfo("Test") << config.ApplicationName() << " base setup complete.";
1194 
1195  } // BasicTesterEnvironment<>::Setup()
fhicl::ParameterSet const & Parameters() const
Returns the full configuration.
void msg(const char *fmt,...)
Definition: message.cpp:107
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
Configuration_t config
instance of the configurer
virtual void Configure()
Reads and translates the configuration.
std::string to_indented_string() const
virtual void SetupMessageFacility() const
template<typename ConfigurationClass>
virtual void testing::BasicTesterEnvironment< ConfigurationClass >::Setup ( )
protectedvirtual
template<typename ConfigurationClass >
void testing::BasicTesterEnvironment< ConfigurationClass >::SetupMessageFacility ( fhicl::ParameterSet const &  pset,
std::string  appl_name = "" 
) const
protectedvirtual

Sets up the message facility.

Sets the message facility up.


Message facility configuration is expected in "services.message" parameter set. If not there, the default configuration is used.

Definition at line 1137 of file unit_test_base.h.

1138  {
1139  fhicl::ParameterSet mf_pset;
1140 
1141  if
1142  (!pset.get_if_present(config.ServiceParameterSetPath("message"), mf_pset))
1143  {
1144  mf_pset
1145  = CompileParameterSet(config.DefaultServiceConfiguration("message"));
1146  std::cout << "Using default message facility configuration:\n"
1147  << mf_pset.to_indented_string(1) << std::endl;
1148  } // if no configuration is available
1149 
1150  //mf::StartMessageFacility(mf::MessageFacilityService::SingleThread, mf_pset);
1151  //if (!appl_name.empty()) mf::SetApplicationName(appl_name);
1152  //mf::SetContext("Initialization");
1153  // mf::LogProblem("MessageFacility") << "Error messages are shown.";
1154  // mf::LogPrint("MessageFacility") << "Warning messages are shown.";
1155  // mf::LogVerbatim("MessageFacility") << "Info messages are shown.";
1156  // mf::LogTrace("MessageFacility") << "Debug messages are shown.";
1157  // LOG_TRACE("MessageFacility")
1158  // << "LOG_TRACE/LOG_DEBUG messages are not compiled away.";
1159 
1160  //mf::LogInfo("MessageFacility") << "MessageFacility started.";
1161  //mf::SetModuleName("main");
1162 
1163  } // BasicTesterEnvironment::SetupMessageFacility()
Configuration_t config
instance of the configurer
std::string to_indented_string() const
static fhicl::ParameterSet CompileParameterSet(std::string cfg)
Compiles a parameter set from a string.
QTextStream & endl(QTextStream &s)
template<typename ConfigurationClass>
virtual void testing::BasicTesterEnvironment< ConfigurationClass >::SetupMessageFacility ( ) const
inlineprotectedvirtual

Definition at line 649 of file unit_test_base.h.

650  { SetupMessageFacility(Parameters(), config.ApplicationName()); }
fhicl::ParameterSet const & Parameters() const
Returns the full configuration.
Configuration_t config
instance of the configurer
virtual void SetupMessageFacility() const
template<typename ConfigurationClass>
virtual void testing::BasicTesterEnvironment< ConfigurationClass >::SetupMessageFacility ( fhicl::ParameterSet const &  pset,
std::string  appl_name = "" 
) const
protectedvirtual

Sets up the message facility.

template<typename ConfigurationClass>
virtual void testing::BasicTesterEnvironment< ConfigurationClass >::SetupMessageFacility ( ) const
inlineprotectedvirtual

Definition at line 654 of file unit_test_base.h.

655  { SetupMessageFacility(Parameters(), config.ApplicationName()); }
fhicl::ParameterSet const & Parameters() const
Returns the full configuration.
Configuration_t config
instance of the configurer
virtual void SetupMessageFacility() const
template<typename ConfigurationClass>
fhicl::ParameterSet testing::BasicTesterEnvironment< ConfigurationClass >::TesterParameters ( std::string  test_name) const
inline

Returns the configuration of the specified test.

Definition at line 610 of file unit_test_base.h.

611  {
612  return params.get<fhicl::ParameterSet>
613  (config.TesterParameterSetPath(test_name));
614  }
Configuration_t config
instance of the configurer
template<typename ConfigurationClass>
fhicl::ParameterSet testing::BasicTesterEnvironment< ConfigurationClass >::TesterParameters ( std::string  test_name) const
inline

Returns the configuration of the specified test.

Definition at line 615 of file unit_test_base.h.

616  {
617  return params.get<fhicl::ParameterSet>
618  (config.TesterParameterSetPath(test_name));
619  }
Configuration_t config
instance of the configurer
template<typename ConfigurationClass>
fhicl::ParameterSet testing::BasicTesterEnvironment< ConfigurationClass >::TesterParameters ( ) const
inline

Returns the configuration of the main test (undefined if no main test)

Definition at line 617 of file unit_test_base.h.

618  {
619  if (config.MainTesterParameterSetName().empty()) return {};
620  else return TesterParameters(config.MainTesterParameterSetName());
621  }
Configuration_t config
instance of the configurer
fhicl::ParameterSet TesterParameters() const
Returns the configuration of the main test (undefined if no main test)
template<typename ConfigurationClass>
fhicl::ParameterSet testing::BasicTesterEnvironment< ConfigurationClass >::TesterParameters ( ) const
inline

Returns the configuration of the main test (undefined if no main test)

Definition at line 622 of file unit_test_base.h.

623  {
624  if (config.MainTesterParameterSetName().empty()) return {};
625  else return TesterParameters(config.MainTesterParameterSetName());
626  }
Configuration_t config
instance of the configurer
fhicl::ParameterSet TesterParameters() const
Returns the configuration of the main test (undefined if no main test)

Member Data Documentation

template<typename ConfigurationClass>
Configuration_t testing::BasicTesterEnvironment< ConfigurationClass >::config
private

instance of the configurer

Definition at line 664 of file unit_test_base.h.

template<typename ConfigurationClass>
Options_t testing::BasicTesterEnvironment< ConfigurationClass >::options
private

options for the test environment

Definition at line 675 of file unit_test_base.h.

template<typename ConfigurationClass>
fhicl::ParameterSet testing::BasicTesterEnvironment< ConfigurationClass >::params
private

full configuration of the test

Definition at line 669 of file unit_test_base.h.


The documentation for this class was generated from the following file: