diff options
author | Matthias Clasen <mclasen@redhat.com> | 2021-07-06 16:15:15 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-07-06 16:15:15 -0400 |
commit | d362db397775d1eb2c5740ed9c84f16d027293e4 (patch) | |
tree | 76cf74dec80d80c3a5e03114093a2fb0ea473472 | |
parent | 4289ac335d05afd72eb8665f9d835382fe3e22e8 (diff) | |
download | pango-d362db397775d1eb2c5740ed9c84f16d027293e4.tar.gz |
tests: Make test-break output more convenient
Avoid g_test_init if we are just generating expected output,
for easier updating.
-rw-r--r-- | tests/test-break.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/tests/test-break.c b/tests/test-break.c index 319805df..b06fb4c0 100644 --- a/tests/test-break.c +++ b/tests/test-break.c @@ -76,7 +76,10 @@ test_file (const gchar *filename, GString *string) if (pango_layout_get_unknown_glyphs_count (layout) > 0) { char *msg = g_strdup_printf ("Missing glyphs - skipping %s. Maybe fonts are missing?", filename); - g_test_skip (msg); + if (g_test_initialized()) + g_test_skip (msg); + else + g_warning ("%s", msg); g_free (msg); g_free (contents); g_object_unref (layout); @@ -328,8 +331,6 @@ main (int argc, char *argv[]) const gchar *name; gchar *path; - g_test_init (&argc, &argv, NULL); - setlocale (LC_ALL, ""); context = pango_font_map_create_context (pango_cairo_font_map_get_default ()); @@ -349,8 +350,9 @@ main (int argc, char *argv[]) " x - expandable space b - sentence boundary\n" " w - whitespace s - sentence start\n" " e - sentence end\n"); + return 0; } - else + else if (argv[1][0] != '-') { GString *string; @@ -359,11 +361,13 @@ main (int argc, char *argv[]) g_print ("%s", string->str); g_string_free (string, TRUE); - } - return 0; + return 0; + } } + g_test_init (&argc, &argv, NULL); + path = g_test_build_filename (G_TEST_DIST, "breaks", NULL); dir = g_dir_open (path, 0, &error); g_free (path); |