glib r7442 - in trunk: . glib



Author: cdywan
Date: Mon Sep  8 08:25:29 2008
New Revision: 7442
URL: http://svn.gnome.org/viewvc/glib?rev=7442&view=rev

Log:
Bug 550433 â g_test_init doesn't recognize --help

* glib/gtestutils.c (parse_args): Add detailed --help output

Modified:
   trunk/ChangeLog
   trunk/glib/gtestutils.c

Modified: trunk/glib/gtestutils.c
==============================================================================
--- trunk/glib/gtestutils.c	(original)
+++ trunk/glib/gtestutils.c	Mon Sep  8 08:25:29 2008
@@ -228,6 +228,9 @@
     }
 }
 
+/* We intentionally parse the command line without GOptionContext
+ * because otherwise you would never be able to test it.
+ */
 static void
 parse_args (gint    *argc_p,
             gchar ***argv_p)
@@ -347,6 +350,27 @@
             }
           argv[i] = NULL;
         }
+      else if (strcmp ("-?", argv[i]) == 0 || strcmp ("--help", argv[i]) == 0)
+        {
+          printf ("Usage:\n"
+                  "  %s [OPTION...]\n\n"
+                  "Help Options:\n"
+                  "  -?, --help                     Show help options\n"
+                  "Test Options:\n"
+                  "  -l                             List test cases available in a test executable\n"
+                  "  -seed=RANDOMSEED               Provide a random seed to reproduce test\n"
+                  "                                 runs using random numbers\n"
+                  "  --verbose                      Run tests verbosely\n"
+                  "  -q, --quiet                    Run tests quietly\n"
+                  "  -p TESTPATH                    execute all tests matching TESTPATH\n"
+                  "  -m {perf|slow|thorough|quick}  Execute tests according modes\n"
+                  "  --debug-log                    debug test logging output\n"
+                  "  -k, --keep-going               gtester-specific argument\n"
+                  "  --GTestLogFD=N                 gtester-specific argument\n"
+                  "  --GTestSkipCount=N             gtester-specific argument\n",
+                  argv[0]);
+          exit (0);
+        }
     }
   /* collapse argv */
   e = 1;



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