summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-08-28 11:21:49 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-08-28 12:53:13 -0400
commit98891da9fa7475f71f4f86146fac703634a4600d (patch)
tree29c7e4fdcabd4c4e9f27303da322ed001a1a3279
parenta03bf5bc6b07ba6e2442c02d6777978c5cecbd9a (diff)
downloadpango-98891da9fa7475f71f4f86146fac703634a4600d.tar.gz
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.
-rw-r--r--tests/test-itemize.c6
1 files 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);