From 02a030a95b27034eedc151488a014950595510de Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Thu, 25 Jul 2024 08:53:59 +0200 Subject: turns: dissolve test_support library --- core/CMakeLists.txt | 5 ++--- core/tests/glib_test_init.cpp | 28 ++++++++++++++++++++++++++++ core/tests/register_types.cpp | 13 ------------- 3 files changed, 30 insertions(+), 16 deletions(-) create mode 100644 core/tests/glib_test_init.cpp delete mode 100644 core/tests/register_types.cpp (limited to 'core') 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 +#include + +#include + +#include + +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(core::participant{}); - static_cast(core::turn_order{}); - } - -} // namespace turns::tests \ No newline at end of file -- cgit v1.2.3