[gtk+/quartz-integration: 317/563] Add a more convenient way to dump



commit 6d62ee6bb8528eb391bbcea3f660c19ac7e948ea
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Jun 19 13:20:32 2011 -0400

    Add a more convenient way to dump
    
    For initial creation of the results, allow to run
    accessibility-dump --generate file.ui,
    which will dump just the expected output to stdout,
    without any extra decorations.

 tests/a11y/accessibility-dump.c |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)
---
diff --git a/tests/a11y/accessibility-dump.c b/tests/a11y/accessibility-dump.c
index 0d97f1a..c3054d9 100644
--- a/tests/a11y/accessibility-dump.c
+++ b/tests/a11y/accessibility-dump.c
@@ -296,6 +296,22 @@ dump_ui_file (const char *ui_file,
 }
 
 static void
+dump_to_stdout (GFile *file)
+{
+  char *ui_file;
+  GString *dump;
+
+  ui_file = g_file_get_path (file);
+  dump = g_string_new ("");
+
+  dump_ui_file (ui_file, dump);
+  g_print ("%s", dump->str);
+
+  g_string_free (dump, TRUE);
+  g_free (ui_file);
+}
+
+static void
 test_ui_file (GFile *file)
 {
   char *diff;
@@ -420,6 +436,16 @@ 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;



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