Title: [225218] trunk/Tools
Revision
225218
Author
[email protected]
Date
2017-11-28 08:30:52 -0800 (Tue, 28 Nov 2017)

Log Message

REGRESSION(r225166): [GTK] Skipped unit tests are considered failures after glib upgrade
https://bugs.webkit.org/show_bug.cgi?id=180072

Reviewed by Michael Catanzaro.

This is a bug in GLib that has already been fixed. Backport the patch to fix it until there's a new GLib release
we can depend on.

* gtk/jhbuild.modules:
* gtk/patches/glib-gtester-do-not-consider-skipped-tests-as-failures.patch: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/Tools/ChangeLog (225217 => 225218)


--- trunk/Tools/ChangeLog	2017-11-28 15:13:23 UTC (rev 225217)
+++ trunk/Tools/ChangeLog	2017-11-28 16:30:52 UTC (rev 225218)
@@ -1,3 +1,16 @@
+2017-11-28  Carlos Garcia Campos  <[email protected]>
+
+        REGRESSION(r225166): [GTK] Skipped unit tests are considered failures after glib upgrade
+        https://bugs.webkit.org/show_bug.cgi?id=180072
+
+        Reviewed by Michael Catanzaro.
+
+        This is a bug in GLib that has already been fixed. Backport the patch to fix it until there's a new GLib release
+        we can depend on.
+
+        * gtk/jhbuild.modules:
+        * gtk/patches/glib-gtester-do-not-consider-skipped-tests-as-failures.patch: Added.
+
 2017-11-28  Fujii Hironori  <[email protected]>
 
         webkitpy: PlatformInfo raises AssertionError "assert self.os_version is not None" in Cygwin since Bug 179621

Modified: trunk/Tools/gtk/jhbuild.modules (225217 => 225218)


--- trunk/Tools/gtk/jhbuild.modules	2017-11-28 15:13:23 UTC (rev 225217)
+++ trunk/Tools/gtk/jhbuild.modules	2017-11-28 16:30:52 UTC (rev 225218)
@@ -215,7 +215,10 @@
     </dependencies>
     <branch module="/pub/GNOME/sources/glib/2.54/glib-2.54.2.tar.xz" version="2.54.2"
             repo="ftp.gnome.org"
-            hash="sha256:bb89e5c5aad33169a8c7f28b45671c7899c12f74caf707737f784d7102758e6c"/>
+            hash="sha256:bb89e5c5aad33169a8c7f28b45671c7899c12f74caf707737f784d7102758e6c">
+      <!-- This patch landed in glib-2-54 branch and will be available in 2.54.3. -->
+      <patch file="glib-gtester-do-not-consider-skipped-tests-as-failures.patch" strip="1"/>
+    </branch>
   </autotools>
 
   <autotools id="glib-networking"

Added: trunk/Tools/gtk/patches/glib-gtester-do-not-consider-skipped-tests-as-failures.patch (0 => 225218)


--- trunk/Tools/gtk/patches/glib-gtester-do-not-consider-skipped-tests-as-failures.patch	                        (rev 0)
+++ trunk/Tools/gtk/patches/glib-gtester-do-not-consider-skipped-tests-as-failures.patch	2017-11-28 16:30:52 UTC (rev 225218)
@@ -0,0 +1,102 @@
+From 8a8e0a373d3b16cd9b5c72dc82abbdfe794a39b7 Mon Sep 17 00:00:00 2001
+From: Carlos Garcia Campos <[email protected]>
+Date: Tue, 28 Nov 2017 12:31:19 +0100
+Subject: [PATCH] gtester: do not consider skipped tests as failures
+
+This is happening since f591366eee341f2c40516821e8a5a0bc7a9bd288, that
+changed the way tests were skipped to use g_test_skip() instead of just
+ignoring them. They are now reported to the log with G_TEST_RUN_SKIPPED
+as result.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=790934
+---
+ glib/gtester.c    | 26 +++++++++++++++++++++-----
+ glib/gtestutils.c |  6 ------
+ glib/gtestutils.h |  7 +++++++
+ 3 files changed, 28 insertions(+), 11 deletions(-)
+
+diff --git a/glib/gtester.c b/glib/gtester.c
+index 38a7f9610..9451aea56 100644
+--- a/glib/gtester.c
++++ b/glib/gtester.c
+@@ -102,21 +102,37 @@ testcase_close (long double duration,
+                 gint        exit_status,
+                 guint       n_forks)
+ {
++  gboolean success;
++
+   g_return_if_fail (testcase_open > 0);
+   test_log_printfe ("%s<duration>%.6Lf</duration>\n", sindent (log_indent), duration);
++  success = exit_status == G_TEST_RUN_SUCCESS || exit_status == G_TEST_RUN_SKIPPED;
+   test_log_printfe ("%s<status exit-status=\"%d\" n-forks=\"%d\" result=\"%s\"/>\n",
+                     sindent (log_indent), exit_status, n_forks,
+-                    exit_status ? "failed" : "success");
++                    success ? "failed" : "success");
+   log_indent -= 2;
+   test_log_printfe ("%s</testcase>\n", sindent (log_indent));
+   testcase_open--;
+   if (gtester_verbose)
+-    g_print ("%s\n", exit_status ? "FAIL" : "OK");
+-  if (exit_status && subtest_last_seed)
++    {
++      switch (exit_status)
++        {
++        case G_TEST_RUN_SUCCESS:
++          g_print ("OK\n");
++          break;
++        case G_TEST_RUN_SKIPPED:
++          g_print ("SKIP\n");
++          break;
++        default:
++          g_print ("FAIL\n");
++          break;
++        }
++    }
++  if (!success && subtest_last_seed)
+     g_print ("GTester: last random seed: %s\n", subtest_last_seed);
+-  if (exit_status)
++  if (!success)
+     testcase_fail_count += 1;
+-  if (subtest_mode_fatal && exit_status)
++  if (subtest_mode_fatal && !success)
+     terminate();
+ }
+ 
+diff --git a/glib/gtestutils.c b/glib/gtestutils.c
+index dd8513a5b..4e598e44a 100644
+--- a/glib/gtestutils.c
++++ b/glib/gtestutils.c
+@@ -731,12 +731,6 @@ static void     gtest_default_log_handler       (const gchar    *log_domain,
+                                                  gpointer        unused_data);
+ 
+ 
+-typedef enum {
+-  G_TEST_RUN_SUCCESS,
+-  G_TEST_RUN_SKIPPED,
+-  G_TEST_RUN_FAILURE,
+-  G_TEST_RUN_INCOMPLETE
+-} GTestResult;
+ static const char * const g_test_result_names[] = {
+   "OK",
+   "SKIP",
+diff --git a/glib/gtestutils.h b/glib/gtestutils.h
+index e120562c0..226a2e80b 100644
+--- a/glib/gtestutils.h
++++ b/glib/gtestutils.h
+@@ -354,6 +354,13 @@ typedef struct {
+ GLIB_VAR const GTestConfig * const g_test_config_vars;
+ 
+ /* internal logging API */
++typedef enum {
++  G_TEST_RUN_SUCCESS,
++  G_TEST_RUN_SKIPPED,
++  G_TEST_RUN_FAILURE,
++  G_TEST_RUN_INCOMPLETE
++} GTestResult;
++
+ typedef enum {
+   G_TEST_LOG_NONE,
+   G_TEST_LOG_ERROR,             /* s:msg */
+-- 
+2.15.0
+
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to