From 98891da9fa7475f71f4f86146fac703634a4600d Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 28 Aug 2021 11:21:49 -0400 Subject: test-itemize: Improve generation It is very annoying that gtest will dump its random seed into the output as soon as one calls g_test_init(). This pollutes our generated output. Work around that by deferring the g_test_init() call until after we've dealt with generating output. --- tests/test-itemize.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test-itemize.c b/tests/test-itemize.c index 105b453d..921a1fdc 100644 --- a/tests/test-itemize.c +++ b/tests/test-itemize.c @@ -313,13 +313,11 @@ main (int argc, char *argv[]) const gchar *name; gchar *path; - g_test_init (&argc, &argv, NULL); - context = pango_font_map_create_context (pango_cairo_font_map_get_default ()); pango_context_set_language (context, pango_language_from_string ("en-us")); /* allow to easily generate expected output for new test cases */ - if (argc > 1) + if (argc > 1 && argv[1][0] != '-') { GString *string; @@ -330,6 +328,8 @@ main (int argc, char *argv[]) return 0; } + g_test_init (&argc, &argv, NULL); + path = g_test_build_filename (G_TEST_DIST, "itemize", NULL); dir = g_dir_open (path, 0, &error); g_free (path); -- cgit v1.2.1