Project
Loading...
Searching...
No Matches
Mocking.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11#include "test_HelperMacros.h"
18
19namespace
20{
21std::unique_ptr<o2::framework::ConfigContext> makeEmptyConfigContext()
22{
23 using namespace o2::framework;
24 // FIXME: Ugly... We need to fix ownership and make sure the ConfigContext
25 // either owns or shares ownership of the registry.
26 std::vector<std::unique_ptr<ParamRetriever>> retrievers;
27 static std::vector<ConfigParamSpec> specs = WorkflowCustomizationHelpers::requiredWorkflowOptions();
28 for (auto& spec : specs) {
29 if (spec.name == "timeframes-rate-limit-ipcid") {
30 spec.defaultValue = "1";
31 }
32 }
33 auto store = std::make_unique<ConfigParamStore>(specs, std::move(retrievers));
34 store->preload();
35 store->activate();
36 static ConfigParamRegistry registry(std::move(store));
37 static std::unique_ptr<ServiceRegistry> services;
38 // We need to reset it because we will inject services into it.
39 services = std::make_unique<ServiceRegistry>();
40 auto context = std::make_unique<ConfigContext>(registry, ServiceRegistryRef{*services}, 0, nullptr);
41 return context;
42}
43
44using namespace o2::framework;
45
46std::vector<ChannelConfigurationPolicy> makeTrivialChannelPolicies(ConfigContext const& configContext)
47{
48 ChannelConfigurationPolicy defaultPolicy;
50 spec.rateLogging = 0;
51 spec.recvBufferSize = 1;
52 spec.sendBufferSize = 1;
53 spec.ipcPrefix = "@";
54
58
59 return {defaultPolicy};
60}
61} // namespace
std::unique_ptr< ConfigContext > makeEmptyConfigContext()
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
static PolicyMatcher matchAny
Catch all policy, used by the last rule.
static OutputChannelModifier pushOutput(FairMQChannelConfigSpec const &spec)
Makes the passed output channel bind and push.
static InputChannelModifier pullInput(FairMQChannelConfigSpec const &spec)
Makes the passed input channel connect and pull.
static std::vector< ConfigParamSpec > requiredWorkflowOptions()