Class holding a configuration for a test environment. More...
#include <unit_test_base.h>
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) | |
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... | |
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... | |
Protected Types | |
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... | |
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... | |
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... | |
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 128 of file unit_test_base.h.
|
protected |
Definition at line 259 of file unit_test_base.h.
|
protected |
Definition at line 260 of file unit_test_base.h.
|
inline |
Default constructor; this is what is used in Boost unit test.
Definition at line 131 of file unit_test_base.h.
|
inline |
Constructor: acquires parameters from the command line.
Definition at line 134 of file unit_test_base.h.
|
inline |
Constructor; accepts the name as parameter.
Definition at line 139 of file unit_test_base.h.
|
inline |
Definition at line 143 of file unit_test_base.h.
|
inline |
Adds a default configuration for the specified service.
Definition at line 236 of file unit_test_base.h.
|
inline |
Adds a default configuration for the specified tester.
Definition at line 241 of file unit_test_base.h.
|
inline |
Adds a default configuration for the main tester.
Definition at line 245 of file unit_test_base.h.
|
inline |
Definition at line 150 of file unit_test_base.h.
|
inlinestaticprotected |
A string describing the full default parameter set.
Definition at line 366 of file unit_test_base.h.
|
inlineprotected |
A string describing the full default parameter set.
Definition at line 321 of file unit_test_base.h.
|
inlineprotected |
A string describing the full default parameter set.
Definition at line 313 of file unit_test_base.h.
|
inlineprotected |
A string describing the full default parameter set.
Definition at line 317 of file unit_test_base.h.
|
inlinestaticprotected |
A string with the service section from service parameter sets.
Definition at line 329 of file unit_test_base.h.
|
inlinestaticprotected |
A string with the physics section from analyzer parameter sets.
Definition at line 346 of file unit_test_base.h.
|
inline |
Path to the configuration file.
Definition at line 153 of file unit_test_base.h.
|
inlinestaticprotected |
Returns the default test name.
Definition at line 268 of file unit_test_base.h.
|
inline |
A string describing the full default parameter set.
Definition at line 190 of file unit_test_base.h.
|
inlineprotected |
Initialize with some default values.
Definition at line 289 of file unit_test_base.h.
|
inline |
A string describing the default parameter set to configure the test.
Definition at line 186 of file unit_test_base.h.
|
inline |
A string describing default parameter set to configure specified test.
Definition at line 182 of file unit_test_base.h.
|
inline |
Returns the list of non-Boost-test arguments on the command line.
Definition at line 197 of file unit_test_base.h.
|
inline |
Returns the name of the executable as started.
Definition at line 194 of file unit_test_base.h.
|
inline |
Name of the test algorithm instance.
Definition at line 164 of file unit_test_base.h.
|
inline |
FHiCL path for the configuration of the test algorithm.
Definition at line 167 of file unit_test_base.h.
|
inlineprotected |
Extracts arguments from the command line, uses first one as config path.
Definition at line 281 of file unit_test_base.h.
|
inline |
FHiCL path for the configuration of the service.
Definition at line 174 of file unit_test_base.h.
|
inline |
Sets the name of the application.
Definition at line 207 of file unit_test_base.h.
|
inline |
Sets the path to the configuration file.
Definition at line 210 of file unit_test_base.h.
|
inline |
Sets the FHiCL name for the configuration of the test algorithm.
Definition at line 213 of file unit_test_base.h.
|
inline |
Sets the FHiCL path for the configuration of the main test algorithm.
Definition at line 221 of file unit_test_base.h.
|
inline |
Sets the FHiCL path for the configuration of a test algorithm.
Definition at line 231 of file unit_test_base.h.
|
inline |
Sets the FHiCL path for the configuration of a test algorithm.
Definition at line 217 of file unit_test_base.h.
|
inline |
FHiCL path for the configuration of the test algorithm.
Definition at line 156 of file unit_test_base.h.
|
protected |
Configuration of all the analyzer modules.
Definition at line 273 of file unit_test_base.h.
|
protected |
name of the application
Definition at line 262 of file unit_test_base.h.
|
private |
command line arguments
Definition at line 375 of file unit_test_base.h.
|
protected |
configuration file path
Definition at line 263 of file unit_test_base.h.
|
protected |
name of main test algorithm
Definition at line 264 of file unit_test_base.h.
|
protected |
path of main test algorithm configuration
Definition at line 265 of file unit_test_base.h.
|
protected |
Set of paths for service configuration.
Definition at line 278 of file unit_test_base.h.
|
protected |
Configuration of all the services.
Definition at line 271 of file unit_test_base.h.
|
protected |
Set of paths for tester configuration.
Definition at line 276 of file unit_test_base.h.