summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2024-07-25 08:53:59 +0200
committerFelix Morgner <felix.morgner@gmail.com>2024-07-25 08:53:59 +0200
commit02a030a95b27034eedc151488a014950595510de (patch)
tree4a66c7321a32590d370a58f8729db2e0b2b2ddd8 /core
parente05d980091724358f689598643b0f17ec671d495 (diff)
downloadturns-02a030a95b27034eedc151488a014950595510de.tar.xz
turns-02a030a95b27034eedc151488a014950595510de.zip
turns: dissolve test_support library
Diffstat (limited to 'core')
-rw-r--r--core/CMakeLists.txt5
-rw-r--r--core/tests/glib_test_init.cpp28
-rw-r--r--core/tests/register_types.cpp13
3 files changed, 30 insertions, 16 deletions
diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt
index 245c7f7..034c759 100644
--- a/core/CMakeLists.txt
+++ b/core/CMakeLists.txt
@@ -30,7 +30,7 @@ enable_coverage("core")
# Tests
add_executable("core-tests"
- "tests/register_types.cpp"
+ "tests/glib_test_init.cpp"
"tests/disposition.cpp"
"tests/participant.cpp"
@@ -39,10 +39,9 @@ add_executable("core-tests"
)
target_link_libraries("core-tests" PRIVATE
- "Catch2::Catch2"
+ "Catch2::Catch2WithMain"
"turns::core"
- "turns::glib-test-main"
)
target_link_options("core-tests" PRIVATE
diff --git a/core/tests/glib_test_init.cpp b/core/tests/glib_test_init.cpp
new file mode 100644
index 0000000..b521189
--- /dev/null
+++ b/core/tests/glib_test_init.cpp
@@ -0,0 +1,28 @@
+#include "turns/core/init.hpp"
+
+#include <catch2/reporters/catch_reporter_event_listener.hpp>
+#include <catch2/reporters/catch_reporter_registrars.hpp>
+
+#include <glibmm/init.h>
+
+#include <giomm/init.h>
+
+namespace turns::core::tests
+{
+
+ struct glib_test_init : Catch::EventListenerBase
+ {
+ using Catch::EventListenerBase::EventListenerBase;
+
+ auto testRunStarting(Catch::TestRunInfo const &) -> void override
+ {
+ Gio::init();
+ Glib::init();
+
+ register_types();
+ }
+ };
+
+ CATCH_REGISTER_LISTENER(glib_test_init);
+
+} // namespace turns::core::tests \ No newline at end of file
diff --git a/core/tests/register_types.cpp b/core/tests/register_types.cpp
deleted file mode 100644
index 2ad0628..0000000
--- a/core/tests/register_types.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "turns/core/participant.hpp"
-#include "turns/core/turn_order.hpp"
-
-namespace turns::tests
-{
-
- auto register_types() -> void
- {
- static_cast<void>(core::participant{});
- static_cast<void>(core::turn_order{});
- }
-
-} // namespace turns::tests \ No newline at end of file