|
16 | 16 | #include "Framework/DriverConfig.h" |
17 | 17 | #include "../src/DeviceSpecHelpers.h" |
18 | 18 | #include <catch_amalgamated.hpp> |
19 | | -#include <algorithm> |
20 | 19 | #include <sstream> |
21 | 20 | #include <cstring> |
22 | 21 | #include <vector> |
@@ -67,10 +66,10 @@ void check(const std::vector<std::string>& arguments, |
67 | 66 | std::vector<DataProcessorInfo> dataProcessorInfos; |
68 | 67 | for (auto& [name, _] : matrix) { |
69 | 68 | dataProcessorInfos.push_back(DataProcessorInfo{ |
70 | | - name, |
71 | | - "executable-name", |
72 | | - arguments, |
73 | | - workflowOptions, |
| 69 | + .name = name, |
| 70 | + .executable = "executable-name", |
| 71 | + .cmdLineArgs = arguments, |
| 72 | + .workflowOptions = workflowOptions, |
74 | 73 | }); |
75 | 74 | } |
76 | 75 | DriverConfig driverConfig{}; |
@@ -184,38 +183,38 @@ TEST_CASE("CheckOptionReworking") |
184 | 183 | { |
185 | 184 | { |
186 | 185 | std::vector<DataProcessorInfo> infos = { |
187 | | - {{}, {}, {"--driver-client-backend", "foo"}}, |
| 186 | + {.cmdLineArgs = {"--driver-client-backend", "foo"}}, |
188 | 187 | {}}; |
189 | 188 | DeviceSpecHelpers::reworkHomogeneousOption(infos, "--driver-client-backend", "stdout://"); |
190 | 189 | REQUIRE(infos[0].cmdLineArgs[1] == "foo"); |
191 | 190 | REQUIRE(infos[1].cmdLineArgs[1] == "foo"); |
192 | 191 | } |
193 | 192 | { |
194 | 193 | std::vector<DataProcessorInfo> infos = { |
195 | | - {{}, {}, {"--driver-client-backend", "foo"}}, |
196 | | - {{}, {}, {"--driver-client-backend", "bar"}}}; |
| 194 | + {.cmdLineArgs = {"--driver-client-backend", "foo"}}, |
| 195 | + {.cmdLineArgs = {"--driver-client-backend", "bar"}}}; |
197 | 196 | REQUIRE_THROWS_AS(DeviceSpecHelpers::reworkHomogeneousOption(infos, "--driver-client-backend", "stdout://"), o2::framework::RuntimeErrorRef); |
198 | 197 | } |
199 | 198 | { |
200 | 199 | std::vector<DataProcessorInfo> infos = { |
201 | | - {{}, {}, {"--driver-client-backend", "foo"}}, |
202 | | - {{}, {}, {"--driver-client-backend", "foo"}}}; |
| 200 | + {.cmdLineArgs = {"--driver-client-backend", "foo"}}, |
| 201 | + {.cmdLineArgs = {"--driver-client-backend", "foo"}}}; |
203 | 202 | DeviceSpecHelpers::reworkHomogeneousOption(infos, "--driver-client-backend", "stdout://"); |
204 | 203 | REQUIRE(infos[0].cmdLineArgs[1] == "foo"); |
205 | 204 | REQUIRE(infos[1].cmdLineArgs[1] == "foo"); |
206 | 205 | } |
207 | 206 | { |
208 | 207 | std::vector<DataProcessorInfo> infos = { |
209 | | - {{}, {}, {"foo", "bar"}}, |
210 | | - {{}, {}, {"fnjcnak", "foo"}}}; |
| 208 | + {.cmdLineArgs = {"foo", "bar"}}, |
| 209 | + {.cmdLineArgs = {"fnjcnak", "foo"}}}; |
211 | 210 | DeviceSpecHelpers::reworkHomogeneousOption(infos, "--driver-client-backend", "stdout://"); |
212 | 211 | REQUIRE(infos[0].cmdLineArgs[3] == "stdout://"); |
213 | 212 | REQUIRE(infos[1].cmdLineArgs[3] == "stdout://"); |
214 | 213 | } |
215 | 214 | { |
216 | 215 | std::vector<DataProcessorInfo> infos = { |
217 | | - {{}, {}, {"foo", "bar", "--driver-client-backend", "bar"}}, |
218 | | - {{}, {}, {"fnjcnak", "foo"}}}; |
| 216 | + {.cmdLineArgs = {"foo", "bar", "--driver-client-backend", "bar"}}, |
| 217 | + {.cmdLineArgs = {"fnjcnak", "foo"}}}; |
219 | 218 | DeviceSpecHelpers::reworkHomogeneousOption(infos, "--driver-client-backend", "stdout://"); |
220 | 219 | REQUIRE(infos[0].cmdLineArgs[3] == "bar"); |
221 | 220 | REQUIRE(infos[1].cmdLineArgs[3] == "bar"); |
@@ -277,8 +276,8 @@ TEST_CASE("CheckIntegerReworking") |
277 | 276 | } |
278 | 277 | { |
279 | 278 | std::vector<DataProcessorInfo> infos = { |
280 | | - {{}, {}, {"foo", "bar", "--readers", "3"}}, |
281 | | - {{}, {}, {"--readers", "2"}}}; |
| 279 | + {.cmdLineArgs = {"foo", "bar", "--readers", "3"}}, |
| 280 | + {.cmdLineArgs = {"--readers", "2"}}}; |
282 | 281 | DeviceSpecHelpers::reworkIntegerOption( |
283 | 282 | infos, "--readers", []() { return 1; }, 1, [](long long x, long long y) { return x > y ? x : y; }); |
284 | 283 | REQUIRE(infos[0].cmdLineArgs.size() == 4); |
|
0 commit comments