[libgweather] tests: Skip translation tests if .mo file does not exist



commit 233d5608ab4b5226c956c3355d4bee50a5a454f5
Author: Benjamin Berg <bberg redhat com>
Date:   Fri Apr 24 16:57:53 2020 +0200

    tests: Skip translation tests if .mo file does not exist
    
    The translation only works after the library has been installed. The
    test really should not fail when that is not the case.

 libgweather/test_libgweather.c | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/libgweather/test_libgweather.c b/libgweather/test_libgweather.c
index f152a4f..d08700d 100644
--- a/libgweather/test_libgweather.c
+++ b/libgweather/test_libgweather.c
@@ -667,6 +667,12 @@ test_location_names (void)
     gweather_location_unref (brussels);
 
     setlocale (LC_ALL, "fr_FR.UTF-8");
+
+    if (!g_file_test (GNOMELOCALEDIR "/fr/LC_MESSAGES/libgweather-locations.mo", G_FILE_TEST_EXISTS)) {
+        g_test_skip ("Translations need to be installed for full testing");
+        return;
+    }
+
     _gweather_location_reset_world ();
 
     world = gweather_location_get_world ();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]