test/nextgen/common/test_registry.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // | ||
| 2 | // SPDX-FileCopyrightText: Copyright 2025 Arm Limited and/or its affiliates <open-source-office@arm.com> | ||
| 3 | // | ||
| 4 | // SPDX-License-Identifier: Apache-2.0 | ||
| 5 | // | ||
| 6 | |||
| 7 | #include "test/nextgen/common/test_registry.hpp" | ||
| 8 | |||
| 9 | #include <utility> | ||
| 10 | #include <vector> | ||
| 11 | |||
| 12 | namespace kai::test { | ||
| 13 | |||
| 14 | namespace { | ||
| 15 | |||
| 16 | 9 | std::vector<TestRegistry::Fn>& call_in_main_fns() { | |
| 17 |
3/4✓ Branch 0 taken 3 times.
✓ Branch 1 taken 6 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 3 times.
|
9 | static std::vector<TestRegistry::Fn> fns{}; |
| 18 | |||
| 19 | 9 | return fns; | |
| 20 | } | ||
| 21 | |||
| 22 | } // namespace | ||
| 23 | |||
| 24 | 8 | TestRegistry::Handle::Handle(Fn&& fn) { | |
| 25 | 6 | call_in_main_fns().emplace_back(std::move(fn)); | |
| 26 | 8 | } | |
| 27 | |||
| 28 | 3 | void TestRegistry::init() { | |
| 29 |
2/2✓ Branch 0 taken 3 times.
✓ Branch 1 taken 6 times.
|
9 | for (const TestRegistry::Fn& fn : call_in_main_fns()) { |
| 30 | 6 | fn(); | |
| 31 | 6 | } | |
| 32 | 3 | } | |
| 33 | |||
| 34 | } // namespace kai::test | ||
| 35 |