From a0cb9d5e75a78918ecbf9b71194d8cf229fd3aa7 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 30 Aug 2021 12:44:00 -0400 Subject: test-layout: Add a --show-fonts option A bit more natural than the environment variable. --- tests/test-layout.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/test-layout.c b/tests/test-layout.c index 3320920b..cd60450e 100644 --- a/tests/test-layout.c +++ b/tests/test-layout.c @@ -617,9 +617,24 @@ main (int argc, char *argv[]) GError *error = NULL; const gchar *name; gchar *path; + GOptionContext *option_context; + GOptionEntry entries[] = { + { "show-fonts", '0', 0, G_OPTION_ARG_NONE, &opt_show_font, "Print font names in dumps", NULL }, + { NULL, 0 }, + }; setlocale (LC_ALL, ""); + option_context = g_option_context_new (""); + g_option_context_add_main_entries (option_context, entries, NULL); + g_option_context_set_ignore_unknown_options (option_context, TRUE); + if (!g_option_context_parse (option_context, &argc, &argv, &error)) + { + g_error ("failed to parse options: %s", error->message); + return 1; + } + g_option_context_free (option_context); + if (g_getenv ("PANGO_TEST_SHOW_FONT")) opt_show_font = TRUE; -- cgit v1.2.1