17 #ifndef LARDATA_DETECTORINFO_DETECTORPROPERTIESSTANDARDTESTHELPERS_H 18 #define LARDATA_DETECTORINFO_DETECTORPROPERTIESSTANDARDTESTHELPERS_H 1 58 static std::unique_ptr<detinfo::DetectorPropertiesStandard>
setup 65 std::string ServiceProviderPath;
66 if (pset.
get_if_present(
"service_provider", ServiceProviderPath)) {
67 std::string ServiceProviderName = ServiceProviderPath;
68 size_t iSlash = ServiceProviderPath.rfind(
'/');
69 if (iSlash != std::string::npos)
70 ServiceProviderName.erase(0, iSlash + 1);
72 if (ServiceProviderName ==
"DetectorPropertiesServiceStandard") {
73 LOG_TRACE(
"ProviderSetup") <<
"Verified service implementation for " 74 "DetectorPropertiesService" 75 ": '" << ServiceProviderPath <<
"'";
80 <<
"This set up is for a DetectorPropertiesStandard provider.\n" 81 "Your configuration specifies a '" << ServiceProviderPath
82 <<
"' service implementation" 83 " that is not known to use that provider.";
94 std::set<std::string> ignore_keys({
"InheritNumberTimeSamples" });
95 return std::make_unique<detinfo::DetectorPropertiesStandard>
96 (pset, providers, ignore_keys);
130 template <
typename TestEnv>
132 <
detinfo::DetectorPropertiesStandard, TestEnv>
136 auto* detp = env.template SetupProviderFor
139 env.ServiceParameters(
"DetectorPropertiesService"),
140 env.template ProviderPackFor<detinfo::DetectorPropertiesStandard>()
151 #endif // LARDATA_DETECTORINFO_DETECTORPROPERTIESSTANDARDTESTHELPERS_H
Helper classes to be used together with LArSoft's unit test.
static std::unique_ptr< Prov > setup(Args &&...args)
Instantiates a new provider with specified arguments for constructor.
Environment helper to set up a service provider.
static detinfo::DetectorPropertiesStandard * setup(TestEnv &env)
Class to create and set up a new provider.
bool get_if_present(std::string const &key, T &value) const
General LArSoft Utilities.
Container for a list of pointers to providers.
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning