mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-25 14:56:10 +01:00
db32550898
There are two reasons for this: 1) It is highly unlikely that someone has use for this header, which has no customization points and only provides simplest possible main, and cannot link the static library which also provides a default main implementation. 2) It being a header was causing extra complications with the convenience headers, and our checking script. This would either require special handling in the checking script, or would break user's of the main convenience header. All in all, it is simpler and better in the long term to remove it, than to fix its problems.
23 lines
553 B
C++
23 lines
553 B
C++
#include <catch2/catch_test_macros.hpp>
|
|
|
|
TEST_CASE("Tests that run") {
|
|
// All of these should be run and be reported
|
|
CHECK(1 == 2);
|
|
CHECK(1 == 1);
|
|
CHECK(1 != 3);
|
|
CHECK(1 == 4);
|
|
}
|
|
|
|
|
|
|
|
TEST_CASE("Tests that abort") {
|
|
// Avoid abort and other exceptional exits -- there is no way
|
|
// to tell CMake that abort is the desired outcome of a test.
|
|
std::set_terminate([](){exit(1);});
|
|
REQUIRE(1 == 1);
|
|
REQUIRE(1 != 2);
|
|
REQUIRE(1 == 3);
|
|
// We should not get here, because the test above aborts
|
|
REQUIRE(1 != 4);
|
|
}
|