Skip to content

Commit 9d2128a

Browse files
committed
UnitTest/Settings: fastAbort
1 parent 9858ae7 commit 9d2128a

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

modules/Execution/EventSystem.mpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export namespace CppUtils::Execution
1212

1313
public:
1414
template<String::Hasher eventName = String::Hash{}>
15-
inline auto emit(const auto& event) -> void
15+
inline auto emit(const auto& event = nullptr) -> void
1616
{
1717
using Event = std::remove_cvref_t<decltype(event)>;
1818
auto lockGuard = std::shared_lock{m_mutex};

modules/UnitTest/UnitTest.mpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,13 @@ namespace CppUtils::UnitTest
108108
auto successfulTests = std::vector<std::string>{};
109109
auto failedTests = std::vector<std::string>{};
110110

111-
if (auto result = m_testSuites.forEach([&](const auto& name, const auto& tests, const auto& dependencies) -> void {
111+
if (auto result = m_testSuites.forEach([&](const auto& name, const auto& tests, const auto& dependencies) -> bool {
112112
if (std::empty(tests))
113113
{
114114
Logger::print<"warning">("No tests found in test suite {}", name);
115115
testSuiteIsSuccess[name] = true;
116116
successfulTests.push_back(name);
117-
return;
117+
return not settings.fastAbort;
118118
}
119119

120120
for (const auto& dependency : dependencies)
@@ -124,6 +124,7 @@ namespace CppUtils::UnitTest
124124
auto result = std::ranges::all_of(tests, [&](const auto& test) { return executeTest(test, settings); });
125125
testSuiteIsSuccess[name] = result;
126126
(result ? successfulTests : failedTests).push_back(name);
127+
return result or not settings.fastAbort;
127128
});
128129
not result)
129130
Logger::print<"error">("The tests cannot be run: {}", result.error());

0 commit comments

Comments
 (0)