catch3
Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.
Clonegit clone https://git.progmasoft.com/catch3
Extra compilation checks for compiling without exceptions
- Commit
88b28ab5926e341a57305a62339507a4189343ca- Author
- Martin Hořeňovský ·
- Parents
ef3374ed8135
Changes
tests/ExtraTests/X03-DisabledExceptions-DefaultHandler.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/ExtraTests/X03-DisabledExceptions-DefaultHandler.cpp b/tests/ExtraTests/X03-DisabledExceptions-DefaultHandler.cpp index c981fa0b..fefbae0d 100644 --- a/tests/ExtraTests/X03-DisabledExceptions-DefaultHandler.cpp +++ b/tests/ExtraTests/X03-DisabledExceptions-DefaultHandler.cpp @@ -1,4 +1,7 @@ #include <catch2/catch_test_macros.hpp> +#include <catch2/benchmark/catch_benchmark.hpp> +#include <catch2/matchers/catch_matchers.hpp> +#include <catch2/matchers/catch_matchers_predicate.hpp> TEST_CASE("Tests that run") { // All of these should be run and be reported @@ -20,3 +23,9 @@ TEST_CASE("Tests that abort") { // We should not get here, because the test above aborts REQUIRE(1 != 4); } + +TEST_CASE( "Misc. macros to check that they compile without exceptions" ) { + BENCHMARK( "simple benchmark" ) { return 1 * 2 + 3; }; + REQUIRE_THAT( 1, + Catch::Matchers::Predicate<int>( []( int i ) { return i == 1; } ) ); +}