[gtk/test-protocol: 1/3] testsuite: Don't exit unsuccessfully when using TAP



commit dc4b7131f17abab964b6c9e3ac3712638c4fb06e
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Mar 20 11:43:51 2020 -0400

    testsuite: Don't exit unsuccessfully when using TAP
    
    The meson TAP parser doesn't take this lightly and
    forgets all about xfails when we exit(1), so don't.

 testsuite/reftests/gtk-reftest.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
---
diff --git a/testsuite/reftests/gtk-reftest.c b/testsuite/reftests/gtk-reftest.c
index 9ddd0dab1e..c09147a6cc 100644
--- a/testsuite/reftests/gtk-reftest.c
+++ b/testsuite/reftests/gtk-reftest.c
@@ -57,11 +57,14 @@ static const GOptionEntry test_args[] = {
   { NULL }
 };
 
+static gboolean using_tap;
+
 static gboolean
 parse_command_line (int *argc, char ***argv)
 {
   GError *error = NULL;
   GOptionContext *context;
+  int i;
 
   context = g_option_context_new ("- run GTK reftests");
   g_option_context_add_main_entries (context, test_args, NULL);
@@ -73,6 +76,12 @@ parse_command_line (int *argc, char ***argv)
       return FALSE;
     }
 
+  for (i = 0; i < *argc; i++)
+    {
+      if (strcmp ((*argv)[i], "--tap") == 0)
+        using_tap = TRUE;
+    }
+
   gtk_test_init (argc, argv);
 
   if (g_strcmp0 (arg_direction, "rtl") == 0)
@@ -379,6 +388,7 @@ int
 main (int argc, char **argv)
 {
   const char *basedir;
+  int result;
   
   /* I don't want to fight fuzzy scaling algorithms in GPUs,
    * so unless you explicitly set it to something else, we
@@ -424,6 +434,11 @@ main (int argc, char **argv)
    */
   chdir (basedir);
 
-  return g_test_run ();
+  result = g_test_run ();
+
+  if (using_tap)
+    return 0;
+
+  return result;
 }
 


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