summaryrefslogtreecommitdiff
path: root/test_support
diff options
context:
space:
mode:
Diffstat (limited to 'test_support')
-rw-r--r--test_support/CMakeLists.txt14
-rw-r--r--test_support/src/gtk_main.cpp12
2 files changed, 26 insertions, 0 deletions
diff --git a/test_support/CMakeLists.txt b/test_support/CMakeLists.txt
new file mode 100644
index 0000000..04bb256
--- /dev/null
+++ b/test_support/CMakeLists.txt
@@ -0,0 +1,14 @@
+add_library("test_support-gtk" OBJECT
+ "src/gtk_main.cpp"
+)
+
+add_library("turns::gtk-test-main" ALIAS "test_support-gtk")
+
+target_compile_features("test_support-gtk" PRIVATE
+ "cxx_std_23"
+)
+
+target_link_libraries("test_support-gtk" PUBLIC
+ "PkgConfig::adwaita"
+ "PkgConfig::gtkmm"
+) \ No newline at end of file
diff --git a/test_support/src/gtk_main.cpp b/test_support/src/gtk_main.cpp
new file mode 100644
index 0000000..02173f9
--- /dev/null
+++ b/test_support/src/gtk_main.cpp
@@ -0,0 +1,12 @@
+#include <catch2/catch_session.hpp>
+
+#include <adwaita.h>
+#include <gtkmm/init.h>
+
+auto main(int argc, char * argv[]) -> int
+{
+ Gtk::init_gtkmm_internals();
+ adw_init();
+
+ return Catch::Session().run(argc, argv);
+} \ No newline at end of file