summaryrefslogtreecommitdiff
path: root/test_support
diff options
context:
space:
mode:
Diffstat (limited to 'test_support')
-rw-r--r--test_support/CMakeLists.txt23
-rw-r--r--test_support/src/intl_main.cpp13
2 files changed, 36 insertions, 0 deletions
diff --git a/test_support/CMakeLists.txt b/test_support/CMakeLists.txt
index fe30782..bb2ae4f 100644
--- a/test_support/CMakeLists.txt
+++ b/test_support/CMakeLists.txt
@@ -1,5 +1,7 @@
get_target_property(TRANSLATIONS_BINARY_DIR "lang" BINARY_DIR)
+# GTK test support
+
add_library("test_support-gtk" OBJECT
"src/gtk_main.cpp"
)
@@ -20,3 +22,24 @@ target_link_libraries("test_support-gtk" PUBLIC
"PkgConfig::adwaita"
"PkgConfig::gtkmm"
)
+
+# Intl test support
+
+add_library("test_support-intl" OBJECT
+ "src/intl_main.cpp"
+)
+
+add_library("turns::intl-test-main" ALIAS "test_support-intl")
+
+target_compile_features("test_support-intl" PRIVATE
+ "cxx_std_23"
+)
+
+target_compile_definitions("test_support-intl" PUBLIC
+ "TESTLOCALEDIR=\"${TRANSLATIONS_BINARY_DIR}\""
+)
+
+target_link_libraries("test_support-intl" PUBLIC
+ "Intl::Intl"
+ "turns::lang"
+)
diff --git a/test_support/src/intl_main.cpp b/test_support/src/intl_main.cpp
new file mode 100644
index 0000000..4a74ac5
--- /dev/null
+++ b/test_support/src/intl_main.cpp
@@ -0,0 +1,13 @@
+#include <catch2/catch_session.hpp>
+
+#include <libintl.h>
+
+auto main(int argc, char * argv[]) -> int
+{
+ setlocale(LC_ALL, "");
+ bindtextdomain("turns", TESTLOCALEDIR);
+ bind_textdomain_codeset("turns", "UTF-8");
+ textdomain("turns");
+
+ return Catch::Session().run(argc, argv);
+} \ No newline at end of file