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>
This commit is contained in:
Simon McVittie 2019-01-04 12:29:06 +00:00
parent 88bac46287
commit 14082191e8

View File

@ -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);
}