[cogl] Set G_DEBUG=fatal-warnings in run-tests.sh



commit 95a6d962f5bc2f21bfcdb2f0bc6b55cfa28792b3
Author: Neil Roberts <neil linux intel com>
Date:   Thu Jun 20 18:24:58 2013 +0100

    Set G_DEBUG=fatal-warnings in run-tests.sh
    
    We want any run-time warnings to cause the conformance tests to fail.
    We are currently setting G_DEBUG in test_utils_init and this would
    previously cause the fatal-warnings debug option to be set. However
    since commit 47444dac of glib this no longer works because the
    environment variable is read in a magic constructor of libglib so it
    is too late to try to set it there. This patch makes it also set it in
    run-tests.sh to avoid the problem.
    
    Reviewed-by: Robert Bragg <robert linux intel com>

 test-fixtures/test-utils.c |    3 +++
 tests/run-tests.sh         |    8 ++++++++
 2 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/test-fixtures/test-utils.c b/test-fixtures/test-utils.c
index fdab99b..6c4291f 100644
--- a/test-fixtures/test-utils.c
+++ b/test-fixtures/test-utils.c
@@ -145,6 +145,9 @@ test_utils_init (TestFlags requirement_flags,
       is_boolean_env_set ("V"))
     cogl_test_is_verbose = TRUE;
 
+  /* NB: This doesn't have any effect since commit 47444dac of glib
+   * because the environment variable is read in a magic constructor
+   * so it is too late to set them here */
   if (g_getenv ("G_DEBUG"))
     {
       char *debug = g_strconcat (g_getenv ("G_DEBUG"), ",fatal-warnings", NULL);
diff --git a/tests/run-tests.sh b/tests/run-tests.sh
index a004943..388fa03 100755
--- a/tests/run-tests.sh
+++ b/tests/run-tests.sh
@@ -1,5 +1,13 @@
 #!/bin/bash
 
+if test -z "$G_DEBUG"; then
+    G_DEBUG=fatal-warnings
+else
+    G_DEBUG="$G_DEBUG,fatal-warnings"
+fi
+
+export G_DEBUG
+
 ENVIRONMENT_CONFIG=$1
 shift
 


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