[gimp] tests: make warnings non fatal for tests on win32.



commit a83ba26f42410ded5626ea2e7a6ca6f606930d90
Author: Jehan <jehan girinstud io>
Date:   Fri Aug 15 03:32:23 2014 +0000

    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).

 app/tests.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/app/tests.c b/app/tests.c
index bfb5b4b..61df099 100644
--- a/app/tests.c
+++ b/app/tests.c
@@ -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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]