[gtk/a11y-fixes: 9/12] testsuite: Improve --generate support



commit b916723baf26225911c4fe34b5619352b205aad8
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Feb 6 16:50:09 2020 -0500

    testsuite: Improve --generate support
    
    When using the test binary to generate expected
    output, don't initialize the test machinery, since
    that pollutes the output with noise.

 testsuite/a11y/accessibility-dump.c | 38 +++++++++++++++++++------------------
 testsuite/a11y/colorchooser.txt     |  3 ---
 2 files changed, 20 insertions(+), 21 deletions(-)
---
diff --git a/testsuite/a11y/accessibility-dump.c b/testsuite/a11y/accessibility-dump.c
index 70d31d5f04..ff2afff5c5 100644
--- a/testsuite/a11y/accessibility-dump.c
+++ b/testsuite/a11y/accessibility-dump.c
@@ -929,14 +929,6 @@ parse_command_line (int *argc, char ***argv)
       return FALSE;
     }
 
-  gtk_test_init (argc, argv);
-
-  /* gtk_test_init does not call setlocale(), so do it ourselves,
-   * since running in the C locale breaks some our fancy
-   * utf8 output.
-   */
-  setlocale (LC_ALL, "en_US.utf8");
-
   return TRUE;
 }
 
@@ -960,6 +952,26 @@ main (int argc, char **argv)
 
   fix_settings ();
 
+  if (argc == 3 && strcmp (argv[1], "--generate") == 0)
+    {
+      GFile *file = g_file_new_for_commandline_arg (argv[2]);
+
+      gtk_init ();
+
+      dump_to_stdout (file);
+      g_object_unref (file);
+
+      return 0;
+    }
+
+  gtk_test_init (&argc, &argv);
+
+  /* gtk_test_init does not call setlocale(), so do it ourselves,
+   * since running in the C locale breaks some our fancy
+   * utf8 output.
+   */
+  setlocale (LC_ALL, "en_US.utf8");
+
   if (argc < 2)
     {
       const char *basedir;
@@ -974,16 +986,6 @@ main (int argc, char **argv)
 
       g_object_unref (dir);
     }
-  else if (argc == 3 && strcmp (argv[1], "--generate") == 0)
-    {
-      GFile *file = g_file_new_for_commandline_arg (argv[2]);
-
-      dump_to_stdout (file);
-
-      g_object_unref (file);
-
-      return 0;
-    }
   else
     {
       guint i;
diff --git a/testsuite/a11y/colorchooser.txt b/testsuite/a11y/colorchooser.txt
index 026114b46b..db434621ce 100644
--- a/testsuite/a11y/colorchooser.txt
+++ b/testsuite/a11y/colorchooser.txt
@@ -1,6 +1,3 @@
-# random seed: R02Sf794a68049c2fd91c6e2c6cd2c801ffb
-# GLib-GIO-DEBUG: _g_io_module_get_default: Found default implementation memory (GMemorySettingsBackend) for 
‘gsettings-backend’
-# GLib-GIO-DEBUG: _g_io_module_get_default: Found default implementation gvfs (GDaemonVfs) for ‘gio-vfs’
 window1
   "dialog"
   index: 0


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