Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Attributes | List of all members
testing::BasicEnvironmentConfiguration Struct Reference

Class holding a configuration for a test environment. More...

#include <unit_test_base.h>

Inheritance diagram for testing::BasicEnvironmentConfiguration:
testing::BasicGeometryEnvironmentConfiguration< geo::ChannelMapCRMAlg > testing::BasicGeometryEnvironmentConfiguration< geo::ChannelMapCRMAlg > testing::BasicGeometryEnvironmentConfiguration< geo::ChannelMapStandardAlg > testing::BasicGeometryEnvironmentConfiguration< geo::ChannelMapStandardAlg > testing::BasicGeometryEnvironmentConfiguration< CHANNELMAP > testing::BasicGeometryEnvironmentConfiguration< CHANNELMAP > testing::BoostCommandLineConfiguration< testing::BasicGeometryEnvironmentConfiguration< geo::ChannelMapCRMAlg > > testing::BoostCommandLineConfiguration< testing::BasicGeometryEnvironmentConfiguration< geo::ChannelMapCRMAlg > > testing::BoostCommandLineConfiguration< testing::BasicGeometryEnvironmentConfiguration< geo::ChannelMapStandardAlg > > testing::BoostCommandLineConfiguration< testing::BasicGeometryEnvironmentConfiguration< geo::ChannelMapStandardAlg > > dune::testing::DUNEFDDPGeometryEnvironmentConfiguration< CHANNELMAP > testing::BoostCommandLineConfiguration< testing::BasicGeometryEnvironmentConfiguration< geo::ChannelMapCRMAlg > > testing::BoostCommandLineConfiguration< testing::BasicGeometryEnvironmentConfiguration< geo::ChannelMapCRMAlg > > testing::BoostCommandLineConfiguration< testing::BasicGeometryEnvironmentConfiguration< geo::ChannelMapStandardAlg > > testing::BoostCommandLineConfiguration< testing::BasicGeometryEnvironmentConfiguration< geo::ChannelMapStandardAlg > > dune::testing::DUNEFDDPGeometryEnvironmentConfiguration< CHANNELMAP >

Public Member Functions

 BasicEnvironmentConfiguration ()
 Default constructor; this is what is used in Boost unit test. More...
 
 BasicEnvironmentConfiguration (int argc, char **argv)
 Constructor: acquires parameters from the command line. More...
 
 BasicEnvironmentConfiguration (std::string name)
 Constructor; accepts the name as parameter. More...
 
 BasicEnvironmentConfiguration (int argc, char **argv, std::string name)
 
 BasicEnvironmentConfiguration ()
 Default constructor; this is what is used in Boost unit test. More...
 
 BasicEnvironmentConfiguration (int argc, char **argv)
 Constructor: acquires parameters from the command line. More...
 
 BasicEnvironmentConfiguration (std::string name)
 Constructor; accepts the name as parameter. More...
 
 BasicEnvironmentConfiguration (int argc, char **argv, std::string name)
 
Access to configuration

Name of the application

std::string ApplicationName () const
 
std::string ConfigurationPath () const
 Path to the configuration file. More...
 
std::string TesterParameterSetPath (std::string name) const
 FHiCL path for the configuration of the test algorithm. More...
 
std::string MainTesterParameterSetName () const
 Name of the test algorithm instance. More...
 
std::string MainTesterParameterSetPath () const
 FHiCL path for the configuration of the test algorithm. More...
 
std::string ServiceParameterSetPath (std::string name) const
 FHiCL path for the configuration of the service. More...
 
std::string DefaultTesterConfiguration (std::string tester_name) const
 A string describing default parameter set to configure specified test. More...
 
std::string DefaultServiceConfiguration (std::string service_name) const
 A string describing the default parameter set to configure the test. More...
 
std::string DefaultConfiguration () const
 A string describing the full default parameter set. More...
 
std::string ExecutablePath () const
 Returns the name of the executable as started. More...
 
std::vector< std::string > const & EexcutableArguments () const
 Returns the list of non-Boost-test arguments on the command line. More...
 
std::string ApplicationName () const
 
std::string ConfigurationPath () const
 Path to the configuration file. More...
 
std::string TesterParameterSetPath (std::string name) const
 FHiCL path for the configuration of the test algorithm. More...
 
std::string MainTesterParameterSetName () const
 Name of the test algorithm instance. More...
 
std::string MainTesterParameterSetPath () const
 FHiCL path for the configuration of the test algorithm. More...
 
std::string ServiceParameterSetPath (std::string name) const
 FHiCL path for the configuration of the service. More...
 
std::string DefaultTesterConfiguration (std::string tester_name) const
 A string describing default parameter set to configure specified test. More...
 
std::string DefaultServiceConfiguration (std::string service_name) const
 A string describing the default parameter set to configure the test. More...
 
std::string DefaultConfiguration () const
 A string describing the full default parameter set. More...
 
std::string ExecutablePath () const
 Returns the name of the executable as started. More...
 
std::vector< std::string > const & EexcutableArguments () const
 Returns the list of non-Boost-test arguments on the command line. More...
 
Set configuration
void SetApplicationName (std::string name)
 Sets the name of the application. More...
 
void SetConfigurationPath (std::string path)
 Sets the path to the configuration file. More...
 
void SetMainTesterParameterSetName (std::string name)
 Sets the FHiCL name for the configuration of the test algorithm. More...
 
void SetTesterParameterSetPath (std::string test_name, std::string path)
 Sets the FHiCL path for the configuration of a test algorithm. More...
 
void SetMainTesterParameterSetPath (std::string path)
 Sets the FHiCL path for the configuration of the main test algorithm. More...
 
void SetServiceParameterSetPath (std::string service_name, std::string path)
 Sets the FHiCL path for the configuration of a test algorithm. More...
 
void AddDefaultServiceConfiguration (std::string service_name, std::string service_cfg)
 Adds a default configuration for the specified service. More...
 
void AddDefaultTesterConfiguration (std::string tester_name, std::string tester_cfg)
 Adds a default configuration for the specified tester. More...
 
void AddDefaultTesterConfiguration (std::string tester_cfg)
 Adds a default configuration for the main tester. More...
 
void SetApplicationName (std::string name)
 Sets the name of the application. More...
 
void SetConfigurationPath (std::string path)
 Sets the path to the configuration file. More...
 
void SetMainTesterParameterSetName (std::string name)
 Sets the FHiCL name for the configuration of the test algorithm. More...
 
void SetTesterParameterSetPath (std::string test_name, std::string path)
 Sets the FHiCL path for the configuration of a test algorithm. More...
 
void SetMainTesterParameterSetPath (std::string path)
 Sets the FHiCL path for the configuration of the main test algorithm. More...
 
void SetServiceParameterSetPath (std::string service_name, std::string path)
 Sets the FHiCL path for the configuration of a test algorithm. More...
 
void AddDefaultServiceConfiguration (std::string service_name, std::string service_cfg)
 Adds a default configuration for the specified service. More...
 
void AddDefaultTesterConfiguration (std::string tester_name, std::string tester_cfg)
 Adds a default configuration for the specified tester. More...
 
void AddDefaultTesterConfiguration (std::string tester_cfg)
 Adds a default configuration for the main tester. More...
 

Protected Types

using ConfigurationMap_t = std::map< std::string, std::string >
 
using PathMap_t = std::map< std::string, std::string >
 
using ConfigurationMap_t = std::map< std::string, std::string >
 
using PathMap_t = std::map< std::string, std::string >
 

Protected Member Functions

void ParseCommandLine (int argc, char **argv)
 Extracts arguments from the command line, uses first one as config path. More...
 
void DefaultInit ()
 Initialize with some default values. More...
 
std::string BuildDefaultServiceConfiguration () const
 A string describing the full default parameter set. More...
 
std::string BuildDefaultTestConfiguration () const
 A string describing the full default parameter set. More...
 
std::string BuildDefaultConfiguration () const
 A string describing the full default parameter set. More...
 
void ParseCommandLine (int argc, char **argv)
 Extracts arguments from the command line, uses first one as config path. More...
 
void DefaultInit ()
 Initialize with some default values. More...
 
std::string BuildDefaultServiceConfiguration () const
 A string describing the full default parameter set. More...
 
std::string BuildDefaultTestConfiguration () const
 A string describing the full default parameter set. More...
 
std::string BuildDefaultConfiguration () const
 A string describing the full default parameter set. More...
 

Static Protected Member Functions

static std::string DefaultApplicationName ()
 Returns the default test name. More...
 
static std::string BuildServiceConfiguration (ConfigurationMap_t const &services)
 A string with the service section from service parameter sets. More...
 
static std::string BuildTestConfiguration (ConfigurationMap_t const &analyzers)
 A string with the physics section from analyzer parameter sets. More...
 
static std::string BuildConfiguration (ConfigurationMap_t const &services, ConfigurationMap_t const &modules)
 A string describing the full default parameter set. More...
 
static std::string DefaultApplicationName ()
 Returns the default test name. More...
 
static std::string BuildServiceConfiguration (ConfigurationMap_t const &services)
 A string with the service section from service parameter sets. More...
 
static std::string BuildTestConfiguration (ConfigurationMap_t const &analyzers)
 A string with the physics section from analyzer parameter sets. More...
 
static std::string BuildConfiguration (ConfigurationMap_t const &services, ConfigurationMap_t const &modules)
 A string describing the full default parameter set. More...
 

Protected Attributes

std::string appl_name
 name of the application More...
 
std::string config_path
 configuration file path More...
 
std::string main_test_name
 name of main test algorithm More...
 
std::string main_test_path
 path of main test algorithm configuration More...
 
ConfigurationMap_t services_default_cfg
 Configuration of all the services. More...
 
ConfigurationMap_t analyzers_default_cfg
 Configuration of all the analyzer modules. More...
 
PathMap_t test_paths
 Set of paths for tester configuration. More...
 
PathMap_t service_paths
 Set of paths for service configuration. More...
 

Private Attributes

details::CommandLineArguments arguments
 command line arguments More...
 

Detailed Description

Class holding a configuration for a test environment.


This class needs to be fully constructed by the default constructor in order to be useful as Boost unit test fixture. It is supposed to be passed as a template parameter to another class that can store an instance of it and extract configuration information from it.

Definition at line 126 of file unit_test_base.h.

Member Typedef Documentation

using testing::BasicEnvironmentConfiguration::ConfigurationMap_t = std::map<std::string, std::string>
protected

Definition at line 257 of file unit_test_base.h.

using testing::BasicEnvironmentConfiguration::ConfigurationMap_t = std::map<std::string, std::string>
protected

Definition at line 259 of file unit_test_base.h.

using testing::BasicEnvironmentConfiguration::PathMap_t = std::map<std::string, std::string>
protected

Definition at line 258 of file unit_test_base.h.

using testing::BasicEnvironmentConfiguration::PathMap_t = std::map<std::string, std::string>
protected

Definition at line 260 of file unit_test_base.h.

Constructor & Destructor Documentation

testing::BasicEnvironmentConfiguration::BasicEnvironmentConfiguration ( )
inline

Default constructor; this is what is used in Boost unit test.

Definition at line 129 of file unit_test_base.h.

129 { DefaultInit(); }
void DefaultInit()
Initialize with some default values.
testing::BasicEnvironmentConfiguration::BasicEnvironmentConfiguration ( int  argc,
char **  argv 
)
inline

Constructor: acquires parameters from the command line.

Definition at line 132 of file unit_test_base.h.

132  :
134  { ParseCommandLine(argc, argv); }
void ParseCommandLine(int argc, char **argv)
Extracts arguments from the command line, uses first one as config path.
BasicEnvironmentConfiguration()
Default constructor; this is what is used in Boost unit test.
testing::BasicEnvironmentConfiguration::BasicEnvironmentConfiguration ( std::string  name)
inline

Constructor; accepts the name as parameter.

Definition at line 137 of file unit_test_base.h.

137  :
static QCString name
Definition: declinfo.cpp:673
void SetApplicationName(std::string name)
Sets the name of the application.
BasicEnvironmentConfiguration()
Default constructor; this is what is used in Boost unit test.
testing::BasicEnvironmentConfiguration::BasicEnvironmentConfiguration ( int  argc,
char **  argv,
std::string  name 
)
inline

Definition at line 141 of file unit_test_base.h.

141  :
static QCString name
Definition: declinfo.cpp:673
void SetApplicationName(std::string name)
Sets the name of the application.
BasicEnvironmentConfiguration()
Default constructor; this is what is used in Boost unit test.
testing::BasicEnvironmentConfiguration::BasicEnvironmentConfiguration ( )
inline

Default constructor; this is what is used in Boost unit test.

Definition at line 131 of file unit_test_base.h.

131 { DefaultInit(); }
void DefaultInit()
Initialize with some default values.
testing::BasicEnvironmentConfiguration::BasicEnvironmentConfiguration ( int  argc,
char **  argv 
)
inline

Constructor: acquires parameters from the command line.

Definition at line 134 of file unit_test_base.h.

134  :
136  { ParseCommandLine(argc, argv); }
void ParseCommandLine(int argc, char **argv)
Extracts arguments from the command line, uses first one as config path.
BasicEnvironmentConfiguration()
Default constructor; this is what is used in Boost unit test.
testing::BasicEnvironmentConfiguration::BasicEnvironmentConfiguration ( std::string  name)
inline

Constructor; accepts the name as parameter.

Definition at line 139 of file unit_test_base.h.

139  :
static QCString name
Definition: declinfo.cpp:673
void SetApplicationName(std::string name)
Sets the name of the application.
BasicEnvironmentConfiguration()
Default constructor; this is what is used in Boost unit test.
testing::BasicEnvironmentConfiguration::BasicEnvironmentConfiguration ( int  argc,
char **  argv,
std::string  name 
)
inline

Definition at line 143 of file unit_test_base.h.

143  :
static QCString name
Definition: declinfo.cpp:673
void SetApplicationName(std::string name)
Sets the name of the application.
BasicEnvironmentConfiguration()
Default constructor; this is what is used in Boost unit test.

Member Function Documentation

void testing::BasicEnvironmentConfiguration::AddDefaultServiceConfiguration ( std::string  service_name,
std::string  service_cfg 
)
inline

Adds a default configuration for the specified service.

Definition at line 234 of file unit_test_base.h.

235  { services_default_cfg[service_name] = service_cfg; }
ConfigurationMap_t services_default_cfg
Configuration of all the services.
void testing::BasicEnvironmentConfiguration::AddDefaultServiceConfiguration ( std::string  service_name,
std::string  service_cfg 
)
inline

Adds a default configuration for the specified service.

Definition at line 236 of file unit_test_base.h.

237  { services_default_cfg[service_name] = service_cfg; }
ConfigurationMap_t services_default_cfg
Configuration of all the services.
void testing::BasicEnvironmentConfiguration::AddDefaultTesterConfiguration ( std::string  tester_name,
std::string  tester_cfg 
)
inline

Adds a default configuration for the specified tester.

Definition at line 239 of file unit_test_base.h.

240  { analyzers_default_cfg[tester_name] = tester_cfg; }
ConfigurationMap_t analyzers_default_cfg
Configuration of all the analyzer modules.
void testing::BasicEnvironmentConfiguration::AddDefaultTesterConfiguration ( std::string  tester_name,
std::string  tester_cfg 
)
inline

Adds a default configuration for the specified tester.

Definition at line 241 of file unit_test_base.h.

242  { analyzers_default_cfg[tester_name] = tester_cfg; }
ConfigurationMap_t analyzers_default_cfg
Configuration of all the analyzer modules.
void testing::BasicEnvironmentConfiguration::AddDefaultTesterConfiguration ( std::string  tester_cfg)
inline

Adds a default configuration for the main tester.

Definition at line 243 of file unit_test_base.h.

244  {
246  throw std::logic_error
247  ("Request adding configuration of non-existent main tester");
248  }
250  }
std::string MainTesterParameterSetName() const
Name of the test algorithm instance.
void AddDefaultTesterConfiguration(std::string tester_name, std::string tester_cfg)
Adds a default configuration for the specified tester.
decltype(auto) constexpr empty(T &&obj)
ADL-aware version of std::empty.
Definition: StdUtils.h:97
void testing::BasicEnvironmentConfiguration::AddDefaultTesterConfiguration ( std::string  tester_cfg)
inline

Adds a default configuration for the main tester.

Definition at line 245 of file unit_test_base.h.

246  {
248  throw std::logic_error
249  ("Request adding configuration of non-existent main tester");
250  }
252  }
std::string MainTesterParameterSetName() const
Name of the test algorithm instance.
void AddDefaultTesterConfiguration(std::string tester_name, std::string tester_cfg)
Adds a default configuration for the specified tester.
decltype(auto) constexpr empty(T &&obj)
ADL-aware version of std::empty.
Definition: StdUtils.h:97
std::string testing::BasicEnvironmentConfiguration::ApplicationName ( ) const
inline

Definition at line 148 of file unit_test_base.h.

148 { return appl_name; }
std::string appl_name
name of the application
std::string testing::BasicEnvironmentConfiguration::ApplicationName ( ) const
inline

Definition at line 150 of file unit_test_base.h.

150 { return appl_name; }
std::string appl_name
name of the application
static std::string testing::BasicEnvironmentConfiguration::BuildConfiguration ( ConfigurationMap_t const &  services,
ConfigurationMap_t const &  modules 
)
inlinestaticprotected

A string describing the full default parameter set.

Definition at line 364 of file unit_test_base.h.

365  {
366  std::string cfg;
367  cfg += BuildServiceConfiguration(services);
368  cfg += BuildTestConfiguration(modules);
369  return cfg;
370  } // BuildConfiguration()
std::string string
Definition: nybbler.cc:12
static std::string BuildServiceConfiguration(ConfigurationMap_t const &services)
A string with the service section from service parameter sets.
static std::string BuildTestConfiguration(ConfigurationMap_t const &analyzers)
A string with the physics section from analyzer parameter sets.
static std::string testing::BasicEnvironmentConfiguration::BuildConfiguration ( ConfigurationMap_t const &  services,
ConfigurationMap_t const &  modules 
)
inlinestaticprotected

A string describing the full default parameter set.

Definition at line 366 of file unit_test_base.h.

367  {
368  std::string cfg;
369  cfg += BuildServiceConfiguration(services);
370  cfg += BuildTestConfiguration(modules);
371  return cfg;
372  } // BuildConfiguration()
std::string string
Definition: nybbler.cc:12
static std::string BuildServiceConfiguration(ConfigurationMap_t const &services)
A string with the service section from service parameter sets.
static std::string BuildTestConfiguration(ConfigurationMap_t const &analyzers)
A string with the physics section from analyzer parameter sets.
std::string testing::BasicEnvironmentConfiguration::BuildDefaultConfiguration ( ) const
inlineprotected

A string describing the full default parameter set.

Definition at line 319 of file unit_test_base.h.

320  {
322  }
ConfigurationMap_t services_default_cfg
Configuration of all the services.
static std::string BuildConfiguration(ConfigurationMap_t const &services, ConfigurationMap_t const &modules)
A string describing the full default parameter set.
ConfigurationMap_t analyzers_default_cfg
Configuration of all the analyzer modules.
std::string testing::BasicEnvironmentConfiguration::BuildDefaultConfiguration ( ) const
inlineprotected

A string describing the full default parameter set.

Definition at line 321 of file unit_test_base.h.

322  {
324  }
ConfigurationMap_t services_default_cfg
Configuration of all the services.
static std::string BuildConfiguration(ConfigurationMap_t const &services, ConfigurationMap_t const &modules)
A string describing the full default parameter set.
ConfigurationMap_t analyzers_default_cfg
Configuration of all the analyzer modules.
std::string testing::BasicEnvironmentConfiguration::BuildDefaultServiceConfiguration ( ) const
inlineprotected

A string describing the full default parameter set.

Definition at line 311 of file unit_test_base.h.

ConfigurationMap_t services_default_cfg
Configuration of all the services.
static std::string BuildServiceConfiguration(ConfigurationMap_t const &services)
A string with the service section from service parameter sets.
std::string testing::BasicEnvironmentConfiguration::BuildDefaultServiceConfiguration ( ) const
inlineprotected

A string describing the full default parameter set.

Definition at line 313 of file unit_test_base.h.

ConfigurationMap_t services_default_cfg
Configuration of all the services.
static std::string BuildServiceConfiguration(ConfigurationMap_t const &services)
A string with the service section from service parameter sets.
std::string testing::BasicEnvironmentConfiguration::BuildDefaultTestConfiguration ( ) const
inlineprotected

A string describing the full default parameter set.

Definition at line 315 of file unit_test_base.h.

static std::string BuildTestConfiguration(ConfigurationMap_t const &analyzers)
A string with the physics section from analyzer parameter sets.
ConfigurationMap_t analyzers_default_cfg
Configuration of all the analyzer modules.
std::string testing::BasicEnvironmentConfiguration::BuildDefaultTestConfiguration ( ) const
inlineprotected

A string describing the full default parameter set.

Definition at line 317 of file unit_test_base.h.

static std::string BuildTestConfiguration(ConfigurationMap_t const &analyzers)
A string with the physics section from analyzer parameter sets.
ConfigurationMap_t analyzers_default_cfg
Configuration of all the analyzer modules.
static std::string testing::BasicEnvironmentConfiguration::BuildServiceConfiguration ( ConfigurationMap_t const &  services)
inlinestaticprotected

A string with the service section from service parameter sets.

Definition at line 327 of file unit_test_base.h.

328  {
329  std::string cfg;
330  cfg += "\nservices: {";
331  for (auto const& service_info: services) {
332  cfg += "\n " + service_info.first + ": {";
333  cfg += "\n" + service_info.second;
334  cfg += "\n } # " + service_info.first;
335  } // for services
336  cfg +=
337  "\n} # services"
338  "\n";
339  return cfg;
340  } // BuildServiceConfiguration()
std::string string
Definition: nybbler.cc:12
static std::string testing::BasicEnvironmentConfiguration::BuildServiceConfiguration ( ConfigurationMap_t const &  services)
inlinestaticprotected

A string with the service section from service parameter sets.

Definition at line 329 of file unit_test_base.h.

330  {
331  std::string cfg;
332  cfg += "\nservices: {";
333  for (auto const& service_info: services) {
334  cfg += "\n " + service_info.first + ": {";
335  cfg += "\n" + service_info.second;
336  cfg += "\n } # " + service_info.first;
337  } // for services
338  cfg +=
339  "\n} # services"
340  "\n";
341  return cfg;
342  } // BuildServiceConfiguration()
std::string string
Definition: nybbler.cc:12
static std::string testing::BasicEnvironmentConfiguration::BuildTestConfiguration ( ConfigurationMap_t const &  analyzers)
inlinestaticprotected

A string with the physics section from analyzer parameter sets.

Definition at line 344 of file unit_test_base.h.

345  {
346  std::string cfg;
347  cfg +=
348  "\nphysics: {"
349  "\n analyzers: {"
350  ;
351  for (auto const& module_info: analyzers) {
352  cfg += "\n " + module_info.first + ": {";
353  cfg += "\n" + module_info.second;
354  cfg += "\n } # " + module_info.first;
355  } // for analyzers
356  cfg +=
357  "\n } # analyzers"
358  "\n} # physics";
359  return cfg;
360  } // BuildServiceConfiguration()
std::string string
Definition: nybbler.cc:12
static std::string testing::BasicEnvironmentConfiguration::BuildTestConfiguration ( ConfigurationMap_t const &  analyzers)
inlinestaticprotected

A string with the physics section from analyzer parameter sets.

Definition at line 346 of file unit_test_base.h.

347  {
348  std::string cfg;
349  cfg +=
350  "\nphysics: {"
351  "\n analyzers: {"
352  ;
353  for (auto const& module_info: analyzers) {
354  cfg += "\n " + module_info.first + ": {";
355  cfg += "\n" + module_info.second;
356  cfg += "\n } # " + module_info.first;
357  } // for analyzers
358  cfg +=
359  "\n } # analyzers"
360  "\n} # physics";
361  return cfg;
362  } // BuildServiceConfiguration()
std::string string
Definition: nybbler.cc:12
std::string testing::BasicEnvironmentConfiguration::ConfigurationPath ( ) const
inline

Path to the configuration file.

Definition at line 151 of file unit_test_base.h.

151 { return config_path; }
std::string config_path
configuration file path
std::string testing::BasicEnvironmentConfiguration::ConfigurationPath ( ) const
inline

Path to the configuration file.

Definition at line 153 of file unit_test_base.h.

153 { return config_path; }
std::string config_path
configuration file path
static std::string testing::BasicEnvironmentConfiguration::DefaultApplicationName ( )
inlinestaticprotected

Returns the default test name.

Definition at line 266 of file unit_test_base.h.

266 { return "Test"; }
static std::string testing::BasicEnvironmentConfiguration::DefaultApplicationName ( )
inlinestaticprotected

Returns the default test name.

Definition at line 268 of file unit_test_base.h.

268 { return "Test"; }
std::string testing::BasicEnvironmentConfiguration::DefaultConfiguration ( ) const
inline

A string describing the full default parameter set.

Definition at line 188 of file unit_test_base.h.

189  { return BuildDefaultConfiguration(); }
std::string BuildDefaultConfiguration() const
A string describing the full default parameter set.
std::string testing::BasicEnvironmentConfiguration::DefaultConfiguration ( ) const
inline

A string describing the full default parameter set.

Definition at line 190 of file unit_test_base.h.

191  { return BuildDefaultConfiguration(); }
std::string BuildDefaultConfiguration() const
A string describing the full default parameter set.
void testing::BasicEnvironmentConfiguration::DefaultInit ( )
inlineprotected

Initialize with some default values.

Definition at line 287 of file unit_test_base.h.

288  {
291  // a destination which will react to all messages from DEBUG up:
293  R"(
294  debugModules: [ '*' ]
295  destinations : {
296  stdout: {
297  type: cout
298  threshold: DEBUG
299  categories: {
300  default: {
301  limit: -1
302  }
303  } // categories
304  } // stdout
305  } // destinations
306  statistics: cout
307  )");
308  } // DefaultInit()
void SetApplicationName(std::string name)
Sets the name of the application.
void SetMainTesterParameterSetName(std::string name)
Sets the FHiCL name for the configuration of the test algorithm.
static std::string DefaultApplicationName()
Returns the default test name.
void AddDefaultServiceConfiguration(std::string service_name, std::string service_cfg)
Adds a default configuration for the specified service.
void testing::BasicEnvironmentConfiguration::DefaultInit ( )
inlineprotected

Initialize with some default values.

Definition at line 289 of file unit_test_base.h.

290  {
293  // a destination which will react to all messages from DEBUG up:
295  R"(
296  debugModules: [ '*' ]
297  destinations : {
298  stdout: {
299  type: cout
300  threshold: DEBUG
301  categories: {
302  default: {
303  limit: -1
304  }
305  } // categories
306  } // stdout
307  statistics: {type:cout}
308  } // destinations
309  )");
310  } // DefaultInit()
void SetApplicationName(std::string name)
Sets the name of the application.
void SetMainTesterParameterSetName(std::string name)
Sets the FHiCL name for the configuration of the test algorithm.
static std::string DefaultApplicationName()
Returns the default test name.
void AddDefaultServiceConfiguration(std::string service_name, std::string service_cfg)
Adds a default configuration for the specified service.
std::string testing::BasicEnvironmentConfiguration::DefaultServiceConfiguration ( std::string  service_name) const
inline

A string describing the default parameter set to configure the test.

Definition at line 184 of file unit_test_base.h.

185  { return services_default_cfg.at(service_name); }
ConfigurationMap_t services_default_cfg
Configuration of all the services.
std::string testing::BasicEnvironmentConfiguration::DefaultServiceConfiguration ( std::string  service_name) const
inline

A string describing the default parameter set to configure the test.

Definition at line 186 of file unit_test_base.h.

187  { return services_default_cfg.at(service_name); }
ConfigurationMap_t services_default_cfg
Configuration of all the services.
std::string testing::BasicEnvironmentConfiguration::DefaultTesterConfiguration ( std::string  tester_name) const
inline

A string describing default parameter set to configure specified test.

Definition at line 180 of file unit_test_base.h.

181  { return analyzers_default_cfg.at(tester_name); }
ConfigurationMap_t analyzers_default_cfg
Configuration of all the analyzer modules.
std::string testing::BasicEnvironmentConfiguration::DefaultTesterConfiguration ( std::string  tester_name) const
inline

A string describing default parameter set to configure specified test.

Definition at line 182 of file unit_test_base.h.

183  { return analyzers_default_cfg.at(tester_name); }
ConfigurationMap_t analyzers_default_cfg
Configuration of all the analyzer modules.
std::vector<std::string> const& testing::BasicEnvironmentConfiguration::EexcutableArguments ( ) const
inline

Returns the list of non-Boost-test arguments on the command line.

Definition at line 195 of file unit_test_base.h.

196  { return arguments.Arguments(); }
details::CommandLineArguments arguments
command line arguments
std::vector< std::string > const & Arguments() const
Returns the list of non-Boost-test arguments on the command line.
std::vector<std::string> const& testing::BasicEnvironmentConfiguration::EexcutableArguments ( ) const
inline

Returns the list of non-Boost-test arguments on the command line.

Definition at line 197 of file unit_test_base.h.

198  { return arguments.Arguments(); }
details::CommandLineArguments arguments
command line arguments
std::vector< std::string > const & Arguments() const
Returns the list of non-Boost-test arguments on the command line.
std::string testing::BasicEnvironmentConfiguration::ExecutablePath ( ) const
inline

Returns the name of the executable as started.

Definition at line 192 of file unit_test_base.h.

192 { return arguments.Executable(); }
details::CommandLineArguments arguments
command line arguments
std::string Executable() const
Returns the name of the executable as started.
std::string testing::BasicEnvironmentConfiguration::ExecutablePath ( ) const
inline

Returns the name of the executable as started.

Definition at line 194 of file unit_test_base.h.

194 { return arguments.Executable(); }
details::CommandLineArguments arguments
command line arguments
std::string Executable() const
Returns the name of the executable as started.
std::string testing::BasicEnvironmentConfiguration::MainTesterParameterSetName ( ) const
inline

Name of the test algorithm instance.

Definition at line 162 of file unit_test_base.h.

162 { return main_test_name; }
std::string main_test_name
name of main test algorithm
std::string testing::BasicEnvironmentConfiguration::MainTesterParameterSetName ( ) const
inline

Name of the test algorithm instance.

Definition at line 164 of file unit_test_base.h.

164 { return main_test_name; }
std::string main_test_name
name of main test algorithm
std::string testing::BasicEnvironmentConfiguration::MainTesterParameterSetPath ( ) const
inline

FHiCL path for the configuration of the test algorithm.

Definition at line 165 of file unit_test_base.h.

166  {
167  return MainTesterParameterSetName().empty()
169  }
std::string TesterParameterSetPath(std::string name) const
FHiCL path for the configuration of the test algorithm.
std::string MainTesterParameterSetName() const
Name of the test algorithm instance.
std::string testing::BasicEnvironmentConfiguration::MainTesterParameterSetPath ( ) const
inline

FHiCL path for the configuration of the test algorithm.

Definition at line 167 of file unit_test_base.h.

168  {
169  return MainTesterParameterSetName().empty()
171  }
std::string TesterParameterSetPath(std::string name) const
FHiCL path for the configuration of the test algorithm.
std::string MainTesterParameterSetName() const
Name of the test algorithm instance.
void testing::BasicEnvironmentConfiguration::ParseCommandLine ( int  argc,
char **  argv 
)
inlineprotected

Extracts arguments from the command line, uses first one as config path.

Definition at line 279 of file unit_test_base.h.

280  {
282  if (arguments.hasArgument(0))
283  SetConfigurationPath(arguments.Argument(0)); // first argument
284  }
void ParseArguments(int argc, char **argv)
Parses arguments.
details::CommandLineArguments arguments
command line arguments
bool hasArgument(size_t iArg) const
Returns whether we have arguments up to the iArg-th (0-based)
std::string const & Argument(size_t iArg) const
Returns the value of the iArg-th (0-based; no range check!)
void SetConfigurationPath(std::string path)
Sets the path to the configuration file.
void testing::BasicEnvironmentConfiguration::ParseCommandLine ( int  argc,
char **  argv 
)
inlineprotected

Extracts arguments from the command line, uses first one as config path.

Definition at line 281 of file unit_test_base.h.

282  {
284  if (arguments.hasArgument(0))
285  SetConfigurationPath(arguments.Argument(0)); // first argument
286  }
void ParseArguments(int argc, char **argv)
Parses arguments.
details::CommandLineArguments arguments
command line arguments
bool hasArgument(size_t iArg) const
Returns whether we have arguments up to the iArg-th (0-based)
std::string const & Argument(size_t iArg) const
Returns the value of the iArg-th (0-based; no range check!)
void SetConfigurationPath(std::string path)
Sets the path to the configuration file.
std::string testing::BasicEnvironmentConfiguration::ServiceParameterSetPath ( std::string  name) const
inline

FHiCL path for the configuration of the service.

Definition at line 172 of file unit_test_base.h.

173  {
174  auto iPath = service_paths.find(name);
175  return (iPath == service_paths.end())
176  ? ("services." + name): iPath->second;
177  } // ServiceParameterSetPath()
static QCString name
Definition: declinfo.cpp:673
PathMap_t service_paths
Set of paths for service configuration.
std::string testing::BasicEnvironmentConfiguration::ServiceParameterSetPath ( std::string  name) const
inline

FHiCL path for the configuration of the service.

Definition at line 174 of file unit_test_base.h.

175  {
176  auto iPath = service_paths.find(name);
177  return (iPath == service_paths.end())
178  ? ("services." + name): iPath->second;
179  } // ServiceParameterSetPath()
static QCString name
Definition: declinfo.cpp:673
PathMap_t service_paths
Set of paths for service configuration.
void testing::BasicEnvironmentConfiguration::SetApplicationName ( std::string  name)
inline

Sets the name of the application.

Definition at line 205 of file unit_test_base.h.

205 { appl_name = name; }
static QCString name
Definition: declinfo.cpp:673
std::string appl_name
name of the application
void testing::BasicEnvironmentConfiguration::SetApplicationName ( std::string  name)
inline

Sets the name of the application.

Definition at line 207 of file unit_test_base.h.

207 { appl_name = name; }
static QCString name
Definition: declinfo.cpp:673
std::string appl_name
name of the application
void testing::BasicEnvironmentConfiguration::SetConfigurationPath ( std::string  path)
inline

Sets the path to the configuration file.

Definition at line 208 of file unit_test_base.h.

208 { config_path = path; }
std::string config_path
configuration file path
void testing::BasicEnvironmentConfiguration::SetConfigurationPath ( std::string  path)
inline

Sets the path to the configuration file.

Definition at line 210 of file unit_test_base.h.

210 { config_path = path; }
std::string config_path
configuration file path
void testing::BasicEnvironmentConfiguration::SetMainTesterParameterSetName ( std::string  name)
inline

Sets the FHiCL name for the configuration of the test algorithm.

Definition at line 211 of file unit_test_base.h.

212  { main_test_name = name; }
static QCString name
Definition: declinfo.cpp:673
std::string main_test_name
name of main test algorithm
void testing::BasicEnvironmentConfiguration::SetMainTesterParameterSetName ( std::string  name)
inline

Sets the FHiCL name for the configuration of the test algorithm.

Definition at line 213 of file unit_test_base.h.

214  { main_test_name = name; }
static QCString name
Definition: declinfo.cpp:673
std::string main_test_name
name of main test algorithm
void testing::BasicEnvironmentConfiguration::SetMainTesterParameterSetPath ( std::string  path)
inline

Sets the FHiCL path for the configuration of the main test algorithm.

Definition at line 219 of file unit_test_base.h.

220  {
222  throw std::logic_error
223  ("Request setting configuration of non-existent main tester");
224  }
226  }
std::string MainTesterParameterSetName() const
Name of the test algorithm instance.
void SetTesterParameterSetPath(std::string test_name, std::string path)
Sets the FHiCL path for the configuration of a test algorithm.
decltype(auto) constexpr empty(T &&obj)
ADL-aware version of std::empty.
Definition: StdUtils.h:97
void testing::BasicEnvironmentConfiguration::SetMainTesterParameterSetPath ( std::string  path)
inline

Sets the FHiCL path for the configuration of the main test algorithm.

Definition at line 221 of file unit_test_base.h.

222  {
224  throw std::logic_error
225  ("Request setting configuration of non-existent main tester");
226  }
228  }
std::string MainTesterParameterSetName() const
Name of the test algorithm instance.
void SetTesterParameterSetPath(std::string test_name, std::string path)
Sets the FHiCL path for the configuration of a test algorithm.
decltype(auto) constexpr empty(T &&obj)
ADL-aware version of std::empty.
Definition: StdUtils.h:97
void testing::BasicEnvironmentConfiguration::SetServiceParameterSetPath ( std::string  service_name,
std::string  path 
)
inline

Sets the FHiCL path for the configuration of a test algorithm.

Definition at line 229 of file unit_test_base.h.

230  { service_paths[service_name] = path; }
PathMap_t service_paths
Set of paths for service configuration.
void testing::BasicEnvironmentConfiguration::SetServiceParameterSetPath ( std::string  service_name,
std::string  path 
)
inline

Sets the FHiCL path for the configuration of a test algorithm.

Definition at line 231 of file unit_test_base.h.

232  { service_paths[service_name] = path; }
PathMap_t service_paths
Set of paths for service configuration.
void testing::BasicEnvironmentConfiguration::SetTesterParameterSetPath ( std::string  test_name,
std::string  path 
)
inline

Sets the FHiCL path for the configuration of a test algorithm.

Definition at line 215 of file unit_test_base.h.

216  { test_paths[test_name] = path; }
PathMap_t test_paths
Set of paths for tester configuration.
void testing::BasicEnvironmentConfiguration::SetTesterParameterSetPath ( std::string  test_name,
std::string  path 
)
inline

Sets the FHiCL path for the configuration of a test algorithm.

Definition at line 217 of file unit_test_base.h.

218  { test_paths[test_name] = path; }
PathMap_t test_paths
Set of paths for tester configuration.
std::string testing::BasicEnvironmentConfiguration::TesterParameterSetPath ( std::string  name) const
inline

FHiCL path for the configuration of the test algorithm.

Definition at line 154 of file unit_test_base.h.

155  {
156  auto iPath = test_paths.find(name);
157  return (iPath == test_paths.end())
158  ? ("physics.analyzers." + name): iPath->second;
159  }
static QCString name
Definition: declinfo.cpp:673
PathMap_t test_paths
Set of paths for tester configuration.
std::string testing::BasicEnvironmentConfiguration::TesterParameterSetPath ( std::string  name) const
inline

FHiCL path for the configuration of the test algorithm.

Definition at line 156 of file unit_test_base.h.

157  {
158  auto iPath = test_paths.find(name);
159  return (iPath == test_paths.end())
160  ? ("physics.analyzers." + name): iPath->second;
161  }
static QCString name
Definition: declinfo.cpp:673
PathMap_t test_paths
Set of paths for tester configuration.

Member Data Documentation

ConfigurationMap_t testing::BasicEnvironmentConfiguration::analyzers_default_cfg
protected

Configuration of all the analyzer modules.

Definition at line 271 of file unit_test_base.h.

std::string testing::BasicEnvironmentConfiguration::appl_name
protected

name of the application

Definition at line 260 of file unit_test_base.h.

details::CommandLineArguments testing::BasicEnvironmentConfiguration::arguments
private

command line arguments

Definition at line 373 of file unit_test_base.h.

std::string testing::BasicEnvironmentConfiguration::config_path
protected

configuration file path

Definition at line 261 of file unit_test_base.h.

std::string testing::BasicEnvironmentConfiguration::main_test_name
protected

name of main test algorithm

Definition at line 262 of file unit_test_base.h.

std::string testing::BasicEnvironmentConfiguration::main_test_path
protected

path of main test algorithm configuration

Definition at line 263 of file unit_test_base.h.

PathMap_t testing::BasicEnvironmentConfiguration::service_paths
protected

Set of paths for service configuration.

Definition at line 276 of file unit_test_base.h.

ConfigurationMap_t testing::BasicEnvironmentConfiguration::services_default_cfg
protected

Configuration of all the services.

Definition at line 269 of file unit_test_base.h.

PathMap_t testing::BasicEnvironmentConfiguration::test_paths
protected

Set of paths for tester configuration.

Definition at line 274 of file unit_test_base.h.


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