| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #pragma once | ||
| 2 | |||
| 3 | #include <cstddef> | ||
| 4 | #include <string> | ||
| 5 | #include <string_view> | ||
| 6 | |||
| 7 | #include "task/include/task.hpp" | ||
| 8 | #include "util/include/util.hpp" | ||
| 9 | |||
| 10 | namespace ppc::util { | ||
| 11 | |||
| 12 | 308 | inline ppc::task::TaskDescriptor MakeTaskDescriptor(std::string_view task_namespace, ppc::task::TypeOfTask task_type, | |
| 13 | const std::string &settings_path, | ||
| 14 | std::string_view settings_task_path = {}) { | ||
| 15 | 308 | const auto status = ppc::task::GetTaskStatus(task_type, settings_path, settings_task_path); | |
| 16 | const std::string_view task_type_name = ppc::task::TypeOfTaskToString(task_type); | ||
| 17 | const auto task_name = task_type == ppc::task::TypeOfTask::kUnknown | ||
| 18 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 308 times.
|
308 | ? std::string(task_type_name) |
| 19 |
3/10✓ Branch 1 taken 308 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 308 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 308 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
|
924 | : std::string(task_type_name) + "_" + std::string(ppc::task::StatusOfTaskToString(status)); |
| 20 | return {.type = task_type, | ||
| 21 | .status = status, | ||
| 22 | 308 | .category = ppc::task::TaskCategoryFromSettingsPath(settings_task_path), | |
| 23 |
1/4✓ Branch 0 taken 308 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
|
616 | .display_name = std::string(task_namespace) + "_" + task_name}; |
| 24 |
1/2✓ Branch 1 taken 308 times.
✗ Branch 2 not taken.
|
308 | } |
| 25 | |||
| 26 | template <typename TestParam> | ||
| 27 | const ppc::task::TaskDescriptor &GetTaskDescriptor(const TestParam &test_param) { | ||
| 28 | return std::get<static_cast<std::size_t>(GTestParamIndex::kTaskDescriptor)>(test_param); | ||
| 29 | } | ||
| 30 | |||
| 31 | inline bool IsMpiTaskType(ppc::task::TypeOfTask type) { | ||
| 32 | return type == ppc::task::TypeOfTask::kMPI || type == ppc::task::TypeOfTask::kALL; | ||
| 33 | } | ||
| 34 | |||
| 35 | } // namespace ppc::util | ||
| 36 |