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
This commit is contained in:
Mathias Hasselmann 2008-07-21 23:34:44 +00:00
parent 9343e4faeb
commit 981fbaa21e
2 changed files with 16 additions and 2 deletions

View File

@ -1,3 +1,12 @@
2008-07-22 Mathias Hasselmann <mathias@openismus.com>
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 <mclasen2redhat.com> 2008-07-21 Matthias Clasen <mclasen2redhat.com>
* configure.in: Fix detection of struct statfs fields. * configure.in: Fix detection of struct statfs fields.

View File

@ -75,22 +75,27 @@ group_captions (void)
for (j = 0; j < G_N_ELEMENTS (help_variants); ++j) for (j = 0; j < G_N_ELEMENTS (help_variants); ++j)
{ {
GTestTrapFlags trap_flags = 0;
gchar *args[3]; gchar *args[3];
args[0] = __FILE__; args[0] = __FILE__;
args[1] = help_variants[j]; args[1] = help_variants[j];
args[2] = NULL; 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", g_test_message ("test setup: args='%s', main-entries=%d, test-entries=%d",
args[1], have_main_entries, have_test_entries); args[1], have_main_entries, have_test_entries);
if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDOUT | if (g_test_trap_fork (0, trap_flags))
G_TEST_TRAP_SILENCE_STDERR))
{ {
gchar **argv = args; gchar **argv = args;
gint argc = 2; gint argc = 2;
GError *error = NULL; GError *error = NULL;
g_setenv ("LANG", "C", TRUE);
g_option_context_parse (options, &argc, &argv, &error); g_option_context_parse (options, &argc, &argv, &error);
exit(0); exit(0);
} }