summaryrefslogtreecommitdiff
path: root/test_support
diff options
context:
space:
mode:
Diffstat (limited to 'test_support')
-rw-r--r--test_support/CMakeLists.txt20
-rw-r--r--test_support/src/glib_main.cpp10
2 files changed, 30 insertions, 0 deletions
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 <catch2/catch_session.hpp>
+
+#include <glibmm/init.h>
+
+auto main(int argc, char * argv[]) -> int
+{
+ Glib::init();
+
+ return Catch::Session().run(argc, argv);
+} \ No newline at end of file