From 981fbaa21e94049b447dbdcf8061d02c0e71b513 Mon Sep 17 00:00:00 2001 From: Mathias Hasselmann Date: Mon, 21 Jul 2008 23:34:44 +0000 Subject: [PATCH] Set LANG variable for group caption tests to get reproducable results. * glib/tests/option-context.c (group_captions()): Set LANG variable to C in the forked process to get reproducable. Don't silence the forked process in --verbose mode to support debugging. svn path=/trunk/; revision=7238 --- ChangeLog | 9 +++++++++ glib/tests/option-context.c | 9 +++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f2d2878..12e181e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-07-22 Mathias Hasselmann + + Set LANG variable for group caption tests to get reproducable results. + + * glib/tests/option-context.c (group_captions()): + Set LANG variable to C in the forked process to get reproducable. + Don't silence the forked process in --verbose mode to support + debugging. + 2008-07-21 Matthias Clasen * configure.in: Fix detection of struct statfs fields. diff --git a/glib/tests/option-context.c b/glib/tests/option-context.c index f78f8cf..f7ec209 100644 --- a/glib/tests/option-context.c +++ b/glib/tests/option-context.c @@ -75,22 +75,27 @@ group_captions (void) for (j = 0; j < G_N_ELEMENTS (help_variants); ++j) { + GTestTrapFlags trap_flags = 0; gchar *args[3]; args[0] = __FILE__; args[1] = help_variants[j]; args[2] = NULL; + if (!g_test_verbose ()) + trap_flags |= G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR; + g_test_message ("test setup: args='%s', main-entries=%d, test-entries=%d", args[1], have_main_entries, have_test_entries); - if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDOUT | - G_TEST_TRAP_SILENCE_STDERR)) + if (g_test_trap_fork (0, trap_flags)) { gchar **argv = args; gint argc = 2; GError *error = NULL; + g_setenv ("LANG", "C", TRUE); + g_option_context_parse (options, &argc, &argv, &error); exit(0); } -- 2.7.4