Container of service providers accessed by type and optional label.
std::string main_test_name
name of main test algorithm
fhicl::ParameterSet const & Parameters() const
Returns the full configuration.
BEGIN_PROLOG triggeremu_data_config_icarus settings PMTADCthresholds sequence::icarus_stage0_multiTPC_TPC physics sequence::icarus_stage0_EastHits_TPC physics sequence::icarus_stage0_WestHits_TPC physics producers purityana0 caloskimCalorimetryCryoE physics caloskimCalorimetryCryoW physics sequence::physics pathW services
virtual std::string operator()(std::string const &filename)
fhicl::ParameterSet params
full configuration of the test
T const * getPointer(std::string label="") const
Retrieve the object of type T stored with the specified label.
Prov const * Provider() const
Return the specified provider (throws if not available)
static fhicl::ParameterSet ParseParameters(std::string config_path)
Fills the test configuration from file or from default.
static void CreateDefaultResource(Args &&...args)
Constructs and registers a new resource with no name.
Helper classes to be used together with LArSoft's unit test.
void ParseArguments(int argc, char **argv)
Parses arguments.
std::string BuildDefaultConfiguration() const
A string describing the full default parameter set.
std::map< std::string, std::string > PathMap_t
Options_t options
options for the test environment
BEGIN_PROLOG could also be cerr
static ResourcePtr_t ProvideSharedResource(std::string res_name, ResourcePtr_t res_ptr)
Registers a shared resource only if none exists yet.
void SetApplicationName(std::string name)
Sets the name of the application.
std::map< std::string, std::string > ConfigurationMap_t
std::string DefaultConfiguration() const
A string describing the full default parameter set.
Prov * SetupProviderFromService(std::string name, Args &&...args)
Sets a service provider up by calling its testing::setupProvider()
virtual fhicl::ParameterSet DefaultParameters() const
Creates a full configuration for the test.
Container for service providers used in a test.
ConfigurationMap_t services_default_cfg
Configuration of all the services.
std::shared_ptr< Resource_t > ResourcePtr_t
BasicEnvironmentConfiguration(std::string name)
Constructor; accepts the name as parameter.
BasicTesterEnvironment(bool bSetup=true)
Constructor: sets everything up and declares the test started.
Configuration_t config
instance of the configurer
static ResourcePtr_t ProposeSharedResource(std::string res_name, Args &&...args)
Creates a shared resource only if none exists yet.
bool first
whether we are waiting for the first query
std::string main_test_path
path of main test algorithm configuration
void SetMainTesterParameterSetName(std::string name)
Sets the FHiCL name for the configuration of the test algorithm.
BEGIN_PROLOG could also be dds filename
std::string DefaultTesterConfiguration(std::string tester_name) const
A string describing default parameter set to configure specified test.
std::string ExecutablePath() const
Returns the name of the executable as started.
virtual void Configure()
Reads and translates the configuration.
details::CommandLineArguments arguments
command line arguments
Class holding a configuration for a test environment.
static std::string BuildConfiguration(ConfigurationMap_t const &services, ConfigurationMap_t const &modules)
A string describing the full default parameter set.
static bool hasResource(std::string name="")
BasicEnvironmentConfiguration(int argc, char **argv, std::string name)
std::string Executable() const
Returns the name of the executable as started.
std::string TesterParameterSetPath(std::string name) const
FHiCL path for the configuration of the test algorithm.
static bool ReplaceDefaultSharedResource(Resource_t const *old_res_ptr, ResourcePtr_t res_ptr)
Adds a shared resource as default resource only if it is old_res_ptr.
static std::string DefaultApplicationName()
Returns the default test name.
Prov * SetupProviderFromServiceFor(std::string name, Args &&...args)
Sets a provider up, recording it as implementation of Interface.
Configuration_t const & Config() const
Returns a read-only version of the configuration.
void FillProviderPack(lar::ProviderPack< Provs...> &pack) const
Fills the specified provider pack with providers.
Prov * AcquireProvider(std::unique_ptr< Prov > &&prov)
Acquires a service provider.
static void AddDefaultSharedResource(ResourcePtr_t res_ptr)
Adds a shared resource to the resource registry (empty name)
static std::string BuildServiceConfiguration(ConfigurationMap_t const &services)
A string with the service section from service parameter sets.
void ParseCommandLine(int argc, char **argv)
Extracts arguments from the command line, uses first one as config path.
CommandLineArguments()
Constructor: automatically parses from Boost arguments.
PathMap_t test_paths
Set of paths for tester configuration.
std::string MainTesterParameterSetPath() const
FHiCL path for the configuration of the test algorithm.
void AddDefaultServiceConfiguration(std::string service_name, std::string service_cfg)
Adds a default configuration for the specified service.
BEGIN_PROLOG triggeremu_data_config_icarus settings PMTADCthresholds sequence::icarus_stage0_multiTPC_TPC physics sequence::icarus_stage0_EastHits_TPC physics sequence::icarus_stage0_WestHits_TPC physics producers purityana0 caloskimCalorimetryCryoE physics caloskimCalorimetryCryoW physics path
bool acquire(std::unique_ptr< T > &&obj_ptr, std::string label="")
Registers and gets ownership of the specified object.
CommandLineArguments(int argc, char **argv)
Constructor: parses from specified arguments.
static std::string BuildTestConfiguration(ConfigurationMap_t const &analyzers)
A string with the physics section from analyzer parameter sets.
void SetupMessageFacility(fhicl::ParameterSet const &pset, std::string applName="standalone")
Sets up the message facility service.
std::string ServiceParameterSetPath(std::string name) const
FHiCL path for the configuration of the service.
bool erase(std::string label="")
Drops the object with the specified type and label.
Prov::providers_type ProviderPackFor() const
Returns a provider pack for the specified provider.
static Resource_t & DestroyResource(std::string name="")
Destroys the specified resource (does nothing if no such resource)
Prov * SimpleProviderSetup()
Oversimplified provider setup.
ProviderList providers
list of available providers
static std::map< std::string, ResourcePtr_t > Resources
FirstAbsoluteOrLookupWithDotPolicy(std::string const &paths)
bool hasArgument(size_t iArg) const
Returns whether we have arguments up to the iArg-th (0-based)
void DropProvider()
Removes and destroys the specified provider.
std::string config_path
configuration file path
std::string MainTesterParameterSetName() const
Name of the test algorithm instance.
void ParseEnvironmentOptions()
Parses the configuration, looking for the test environment options.
static bool ReplaceSharedResource(std::string res_name, Resource_t const *old_res_ptr, ResourcePtr_t res_ptr)
Adds a shared resource only if it is old_res_ptr.
std::string DefaultServiceConfiguration(std::string service_name) const
A string describing the default parameter set to configure the test.
static Resource_t & Resource(std::string name="")
Retrieves the specified resource, or throws if not available.
static ResourcePtr_t ShareResource(std::string name="")
Retrieves the specified resource for sharing (nullptr if none)
void AddDefaultTesterConfiguration(std::string tester_name, std::string tester_cfg)
Adds a default configuration for the specified tester.
std::vector< std::string > const & Arguments() const
Returns the list of non-Boost-test arguments on the command line.
bool set_alias(std::string alias_label="", std::string prov_label="")
Sets the Alias type as an alias of the Prov provider (with labels)
std::string exec_name
name of the test executable (from argv[0])
BasicTesterEnvironment< ConfigurationClass > TesterEnvBase_t
TESTENV CreateTesterEnvironment(CONFIG &&config, ARGS...other_args)
Constructs and returns a TesterEnvironment object.
std::vector< std::string > args
command line arguments (from argv[0])
bool MessageLevels
print message levels on screen
void fill(const art::PtrVector< recob::Hit > &hits, int only_plane)
BEGIN_PROLOG vertical distance to the surface Name
ConfigurationClass Configuration_t
fhicl::ParameterSet ServiceParameters(std::string service_name) const
Returns the configuration of the specified service.
std::string const & Argument(size_t iArg) const
Returns the value of the iArg-th (0-based; no range check!)
Reads and makes available the command line parameters.
Utility class providing singleton objects to the derived classes.
void SetTesterParameterSetPath(std::string test_name, std::string path)
Sets the FHiCL path for the configuration of a test algorithm.
bool setup(Args &&...args)
Construct and register an object of type T with specified arguments.
std::string BuildDefaultTestConfiguration() const
A string describing the full default parameter set.
PathMap_t service_paths
Set of paths for service configuration.
Prov * SetupProvider(Args &&...args)
Sets a service provider up by calling its testing::setupProvider()
cet::search_path after_paths
path for the other queries
virtual void Setup()
The complete initialization, ran at construction by default.
A test environment with some support for service providers.
BasicEnvironmentConfiguration()
Default constructor; this is what is used in Boost unit test.
fhicl::Table< sbnd::crt::CRTDetSimParams > Parameters
Prov * AcquireProviderFor(std::unique_ptr< Prov > &&prov)
Acquires a service provider implementing an interface.
void SetConfigurationPath(std::string path)
Sets the path to the configuration file.
fhicl::ParameterSet TesterParameters() const
Returns the configuration of the main test (undefined if no main test)
void AddDefaultTesterConfiguration(std::string tester_cfg)
Adds a default configuration for the main tester.
static ResourcePtr_t ProvideDefaultSharedResource(ResourcePtr_t res_ptr)
Creates a shared resource as default only if none exists yet.
std::string ConfigurationPath() const
Path to the configuration file.
Container for a list of pointers to providers.
then echo echo For and will not be changed by echo further linking echo echo B echo The symbol is in the uninitialized data multiple common symbols may appear with the echo same name If the symbol is defined the common echo symbols are treated as undefined references For more echo details on common see the discussion of warn common echo in *Note Linker options
std::string appl_name
name of the application
std::string BuildDefaultServiceConfiguration() const
A string describing the full default parameter set.
Data structure containing constant pointers to classes.
std::vector< std::string > const & EexcutableArguments() const
Returns the list of non-Boost-test arguments on the command line.
TesterEnvironment< ConfigurationClass > TesterEnv_t
void Clear()
Erases the stored arguments.
void SetServiceParameterSetPath(std::string service_name, std::string path)
Sets the FHiCL path for the configuration of a test algorithm.
std::string ApplicationName() const
void SetMainTesterParameterSetPath(std::string path)
Sets the FHiCL path for the configuration of the main test algorithm.
void DefaultInit()
Initialize with some default values.
bool empty(FixedBins< T, C > const &) noexcept
static fhicl::ParameterSet CompileParameterSet(std::string cfg)
Compiles a parameter set from a string.
static ResourcePtr_t ProposeDefaultSharedResource(Args &&...args)
Creates a shared resource as default only if none exists yet.
ConfigurationMap_t analyzers_default_cfg
Configuration of all the analyzer modules.
static ResourcePtr_t CreateResource(std::string res_name, Args &&...args)
Constructs and registers a new resource with a specified name.
static void AddSharedResource(std::string res_name, ResourcePtr_t res_ptr)
Adds a shared resource to the resource registry.
BEGIN_PROLOG could also be cout
virtual ~BasicTesterEnvironment()
Destructor: closing remarks.
virtual void SetupMessageFacility() const
Prov * SetupProviderFor(Args &&...args)
Sets a provider up, recording it as implementation of Interface.
BasicEnvironmentConfiguration(int argc, char **argv)
Constructor: acquires parameters from the command line.