testsuite: Improve --generate support
authorMatthias Clasen <mclasen@redhat.com>
Thu, 6 Feb 2020 21:50:09 +0000 (16:50 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 6 Feb 2020 21:54:59 +0000 (16:54 -0500)
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
testsuite/a11y/colorchooser.txt

index 70d31d5f0445faf47ab6f2131975f0b129f9349e..ff2afff5c5ddef0c685a1dd61da65d4670463937 100644 (file)
@@ -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;
index 026114b46bd5254d63b8f3ce03b1284c4232337d..db434621ce3932564000396bbb295ec55e838101 100644 (file)
@@ -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