diff options
Diffstat (limited to 'tests/test-layout.c')
-rw-r--r-- | tests/test-layout.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/tests/test-layout.c b/tests/test-layout.c index 52617ce6..a5b6d279 100644 --- a/tests/test-layout.c +++ b/tests/test-layout.c @@ -238,6 +238,9 @@ test_file (const gchar *filename, GString *string) PangoWrapMode wrap = PANGO_WRAP_WORD; PangoFontDescription *desc; + if (context == NULL) + context = pango_font_map_create_context (pango_cairo_font_map_get_default ()); + g_file_get_contents (filename, &contents, &length, &error); g_assert_no_error (error); @@ -308,9 +311,12 @@ test_layout (gconstpointer d) setlocale (LC_ALL, "en_US.utf8"); if (strstr (setlocale (LC_ALL, NULL), "en_US") == NULL) { +#if 0 + // See https://github.com/mesonbuild/meson/issues/7515 char *msg = g_strdup_printf ("Locale en_US.UTF-8 not available, skipping layout %s", filename); g_test_skip (msg); g_free (msg); +#endif return; } @@ -341,9 +347,9 @@ test_layout (gconstpointer d) g_test_fail (); g_strfreev (lines); - g_free (diff); } + g_free (diff); g_string_free (dump, TRUE); g_free (expected_file); } @@ -356,13 +362,13 @@ main (int argc, char *argv[]) const gchar *name; gchar *path; - g_test_init (&argc, &argv, NULL); - /* allow to easily generate expected output for new test cases */ - if (argc > 1) + if (argc > 1 && argv[1][0] != '-') { GString *string; + setlocale (LC_ALL, "en_US.utf8"); + string = g_string_sized_new (0); test_file (argv[1], string); g_test_message ("%s", string->str); @@ -370,6 +376,8 @@ main (int argc, char *argv[]) return 0; } + g_test_init (&argc, &argv, NULL); + path = g_test_build_filename (G_TEST_DIST, "layouts", NULL); dir = g_dir_open (path, 0, &error); g_free (path); |