From 2b3fc8f53de9d0d547e4e5b7900c7257bdd1be1a Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Fri, 12 Jul 2024 18:16:06 +0200 Subject: domain/tests: initialize glib --- test_support/CMakeLists.txt | 20 ++++++++++++++++++++ test_support/src/glib_main.cpp | 10 ++++++++++ 2 files changed, 30 insertions(+) create mode 100644 test_support/src/glib_main.cpp (limited to 'test_support') diff --git a/test_support/CMakeLists.txt b/test_support/CMakeLists.txt index bb2ae4f..ce77a90 100644 --- a/test_support/CMakeLists.txt +++ b/test_support/CMakeLists.txt @@ -1,5 +1,25 @@ get_target_property(TRANSLATIONS_BINARY_DIR "lang" BINARY_DIR) +# Glib test support + +add_library("test_support-glib" OBJECT + "src/glib_main.cpp" +) + +add_library("turns::glib-test-main" ALIAS "test_support-glib") + +target_compile_features("test_support-glib" PRIVATE + "cxx_std_23" +) + +target_compile_definitions("test_support-glib" PUBLIC + "TESTLOCALEDIR=\"${TRANSLATIONS_BINARY_DIR}\"" +) + +target_link_libraries("test_support-glib" PUBLIC + "PkgConfig::glibmm" +) + # GTK test support add_library("test_support-gtk" OBJECT diff --git a/test_support/src/glib_main.cpp b/test_support/src/glib_main.cpp new file mode 100644 index 0000000..d224bad --- /dev/null +++ b/test_support/src/glib_main.cpp @@ -0,0 +1,10 @@ +#include + +#include + +auto main(int argc, char * argv[]) -> int +{ + Glib::init(); + + return Catch::Session().run(argc, argv); +} \ No newline at end of file -- cgit v1.2.3