[gtk/matthiasc/css-change-tracking-4: 2/12] csstests: Clean up --generate support



commit 4f23d0fb9c3e25370c12d8658a1457b388768c9c
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Jan 17 17:02:43 2020 -0500

    csstests: Clean up --generate support
    
    Reshuffle things so we don't call gtk_test_init() when
    --generate is passed, to avoid polluting the output with
    test spew.

 testsuite/css/nodes/test-css-nodes.c | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)
---
diff --git a/testsuite/css/nodes/test-css-nodes.c b/testsuite/css/nodes/test-css-nodes.c
index 334b60a11c..54664c7d45 100644
--- a/testsuite/css/nodes/test-css-nodes.c
+++ b/testsuite/css/nodes/test-css-nodes.c
@@ -231,6 +231,19 @@ main (int argc, char **argv)
 {
   g_setenv ("GTK_CSS_DEBUG", "1", TRUE);
 
+  if (argc >=3 && strcmp (argv[1], "--generate") == 0)
+    {
+      GFile *file = g_file_new_for_commandline_arg (argv[2]);
+
+      gtk_init ();
+
+      load_ui_file (file, TRUE);
+
+      g_object_unref (file);
+
+      return 0;
+    }
+
   gtk_test_init (&argc, &argv);
 
   if (argc < 2)
@@ -244,17 +257,6 @@ main (int argc, char **argv)
 
       g_object_unref (dir);
     }
-  else if (strcmp (argv[1], "--generate") == 0)
-    {
-      if (argc >= 3)
-        {
-          GFile *file = g_file_new_for_commandline_arg (argv[2]);
-
-          load_ui_file (file, TRUE);
-
-          g_object_unref (file);
-        }
-    }
   else
     {
       guint i;


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