mirror of
https://github.com/catchorg/Catch2.git
synced 2025-09-18 19:05:40 +02:00
Add STATIC_REQUIRE assertion
By default, it expands into a `static_assert` + `SUCCEED` pair, but it can also be deferred to runtime by defining `CATCH_CONFIG_RUNTIME_STATIC_REQUIRE`, which causes it to expand into plain old `REQUIRE`. Closes #1362 Closes #1356
This commit is contained in:
@@ -4411,6 +4411,22 @@ PASSED:
|
||||
with expansion:
|
||||
!{?}
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Optionally static assertions
|
||||
-------------------------------------------------------------------------------
|
||||
Compilation.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Compilation.tests.cpp:<line number>:
|
||||
PASSED:
|
||||
with message:
|
||||
std::is_void<void>::value
|
||||
|
||||
Compilation.tests.cpp:<line number>:
|
||||
PASSED:
|
||||
with message:
|
||||
!(std::is_void<int>::value)
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Ordering comparison checks that should fail
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -10848,6 +10864,6 @@ Misc.tests.cpp:<line number>:
|
||||
PASSED:
|
||||
|
||||
===============================================================================
|
||||
test cases: 214 | 148 passed | 62 failed | 4 failed as expected
|
||||
assertions: 1243 | 1100 passed | 122 failed | 21 failed as expected
|
||||
test cases: 215 | 149 passed | 62 failed | 4 failed as expected
|
||||
assertions: 1245 | 1102 passed | 122 failed | 21 failed as expected
|
||||
|
||||
|
Reference in New Issue
Block a user