[glib: 2/8] gtestutils: Make --tap compatible with --GTestSkipCount



commit 14082191e8e85ad0209a76febf662bf3a7e6825a
Author: Simon McVittie <smcv collabora com>
Date:   Fri Jan 4 12:29:06 2019 +0000

    gtestutils: Make --tap compatible with --GTestSkipCount
    
    The undocumented --GTestSkipCount option is internal to the deprecated
    gtester tool and rather obscure, but it's straightforward to support
    by making G_TEST_LOG_SKIP_CASE produce TAP output similar to what already
    happened when we emitted G_TEST_LOG_STOP_CASE with result
    G_TEST_RUN_SKIPPED. I might as well do that while I'm looking at the
    interaction between the --tap, -p and -s options.
    
    Signed-off-by: Simon McVittie <smcv collabora com>

 glib/gtestutils.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/glib/gtestutils.c b/glib/gtestutils.c
index edf5ba1b5..2418ac6da 100644
--- a/glib/gtestutils.c
+++ b/glib/gtestutils.c
@@ -994,6 +994,10 @@ g_test_log (GTestLogType lbit,
       if (result == G_TEST_RUN_SKIPPED || result == G_TEST_RUN_INCOMPLETE)
         test_skipped_count++;
       break;
+    case G_TEST_LOG_SKIP_CASE:
+      if (test_tap_log)
+          g_print ("ok %d %s # SKIP\n", test_run_count, string1);
+      break;
     case G_TEST_LOG_MIN_RESULT:
       if (test_tap_log)
         g_print ("# min perf: %s\n", string1);
@@ -1538,10 +1542,10 @@ void
   /* sanity check */
   if (test_tap_log)
     {
-      if (test_paths || test_startup_skip_count)
+      if (test_paths)
         {
           /* Not invoking every test (even if SKIPped) breaks the "1..XX" plan */
-          g_printerr ("%s: -p and --GTestSkipCount options are incompatible with --tap\n",
+          g_printerr ("%s: -p option is incompatible with --tap\n",
                       (*argv)[0]);
           exit (1);
         }


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