mirror of
https://github.com/catchorg/Catch2.git
synced 2025-09-23 21:15:39 +02:00

For now we add just two binaries, one with assertions taking the fast path, one with assertions taking the slow path, and the ability to run 1 of `REQUIRE(true)`, `REQUIRE_NOTHROW`, `REQUIRE_THROWS` in a loop. I also split off a CMake preset which enables more tests than the basic `simple-tests` preset, but does not enable the most expensive tests which force recompilation of Catch2 multiple times.
29 lines
917 B
C++
29 lines
917 B
C++
|
|
// Copyright Catch2 Authors
|
|
// Distributed under the Boost Software License, Version 1.0.
|
|
// (See accompanying file LICENSE.txt or copy at
|
|
// https://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
// SPDX-License-Identifier: BSL-1.0
|
|
|
|
#include <catch2/reporters/catch_reporter_event_listener.hpp>
|
|
#include <catch2/reporters/catch_reporter_registrars.hpp>
|
|
|
|
/**
|
|
* Event listener that listens to all assertions, forcing assertion slow path
|
|
*/
|
|
class AssertionSlowPathListener : public Catch::EventListenerBase {
|
|
public:
|
|
static std::string getDescription() {
|
|
return "Validates ordering of Catch2's listener events";
|
|
}
|
|
|
|
AssertionSlowPathListener(Catch::IConfig const* config) :
|
|
EventListenerBase(config) {
|
|
m_preferences.shouldReportAllAssertions = true;
|
|
m_preferences.shouldReportAllAssertionStarts = true;
|
|
}
|
|
};
|
|
|
|
CATCH_REGISTER_LISTENER( AssertionSlowPathListener )
|