summaryrefslogtreecommitdiff
path: root/Tests
diff options
context:
space:
mode:
authorMichel Hermier <michel.hermier@gmail.com>2021-12-15 00:47:43 +0100
committerBrian Gianforcaro <b.gianfo@gmail.com>2021-12-19 14:22:06 -0800
commit7a44c11378bf4920728f117a586dfa9c589992aa (patch)
tree19f874ea0e7f033301452c55ce3f890e9e9019c4 /Tests
parent4c6e826c055e23493a8b3d72f5f9e5af7a5432ad (diff)
downloadserenity-7a44c11378bf4920728f117a586dfa9c589992aa.zip
LibTest: Add `EXPECT_NO_CRASH`
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeLists.txt1
-rw-r--r--Tests/LibTest/CMakeLists.txt7
-rw-r--r--Tests/LibTest/TestNoCrash.cpp14
3 files changed, 22 insertions, 0 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 0a2f7c9fd5..920f64749f 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -14,6 +14,7 @@ add_subdirectory(LibMarkdown)
add_subdirectory(LibPthread)
add_subdirectory(LibRegex)
add_subdirectory(LibSQL)
+add_subdirectory(LibTest)
add_subdirectory(LibThreading)
add_subdirectory(LibUnicode)
add_subdirectory(LibWasm)
diff --git a/Tests/LibTest/CMakeLists.txt b/Tests/LibTest/CMakeLists.txt
new file mode 100644
index 0000000000..1efe46d0c4
--- /dev/null
+++ b/Tests/LibTest/CMakeLists.txt
@@ -0,0 +1,7 @@
+set(TEST_SOURCES
+ TestNoCrash.cpp
+)
+
+foreach(source IN LISTS TEST_SOURCES)
+ serenity_test("${source}" LibSQL LIBS LibSQL LibIPC)
+endforeach()
diff --git a/Tests/LibTest/TestNoCrash.cpp b/Tests/LibTest/TestNoCrash.cpp
new file mode 100644
index 0000000000..d29fad6db7
--- /dev/null
+++ b/Tests/LibTest/TestNoCrash.cpp
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2021, the SerenityOS developers.
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#include <LibTest/TestCase.h>
+
+TEST_CASE(raise)
+{
+ EXPECT_NO_CRASH("This should never crash", [] {
+ return Test::Crash::Failure::DidNotCrash;
+ });
+}