Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/tests/ExtraTests/X03-DisabledExceptions-DefaultHandler.cpp
diff options
context:
space:
mode:
authorMartin Hořeňovský2019-12-05 16:00:20 +0100
committerMartin Hořeňovský2019-12-05 16:00:20 +0100
commit0fea081ad1a678b379182930a3ec22a3e275dbf0 (patch)
tree3afa04ce6805d7a86e9c59f87ac68cb1d21eb8b2 /tests/ExtraTests/X03-DisabledExceptions-DefaultHandler.cpp
parent90e2549cecc2e886d563b7a88e752c9b4104f798 (diff)
downloadcatch3-0fea081ad1a678b379182930a3ec22a3e275dbf0.tar.gz
Move tests from projects/ to tests/
Diffstat (limited to 'tests/ExtraTests/X03-DisabledExceptions-DefaultHandler.cpp')
-rw-r--r--tests/ExtraTests/X03-DisabledExceptions-DefaultHandler.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/ExtraTests/X03-DisabledExceptions-DefaultHandler.cpp b/tests/ExtraTests/X03-DisabledExceptions-DefaultHandler.cpp
new file mode 100644
index 00000000..846c9b0f
--- /dev/null
+++ b/tests/ExtraTests/X03-DisabledExceptions-DefaultHandler.cpp
@@ -0,0 +1,23 @@
+#define CATCH_CONFIG_MAIN
+#include <catch2/catch.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);
+}