tests: make warnings non fatal for tests on win32.

g_test_init() makes any warning message fatale by default. While it
makes sense for the main OS that we build on (Linux), I believe that
our tests on Windows are more useful when they finish, even with some
warnings, than stopping because some stupid font warning would occur
(case I encountered, did not know the solution of, and is not really
relevant to the rest of the test).
This commit is contained in:
Jehan 2014-08-15 03:32:23 +00:00
parent 2b64efc11d
commit a83ba26f42
1 changed files with 12 additions and 0 deletions

View File

@ -101,6 +101,18 @@ gimp_init_for_gui_testing_internal (gboolean show_gui,
GimpSessionInfoClass *klass;
Gimp *gimp;
#if defined (G_OS_WIN32)
/* g_test_init() sets warnings always fatal, which is a usually a good
testing default. Nevertheless the Windows platform may have a few
quirks generating warnings, yet we want to finish tests. So we
allow some relaxed rules on this platform. */
GLogLevelFlags fatal_mask;
fatal_mask = (GLogLevelFlags) (G_LOG_FATAL_MASK | G_LOG_LEVEL_CRITICAL);
g_log_set_always_fatal (fatal_mask);
#endif
/* from main() */
gimp_log_init ();
gegl_init (NULL, NULL);