From efa56aa9579b2fc5412c11ebe5fe7f0586a0bfc7 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 4 Jan 2019 12:59:35 +0000 Subject: [PATCH] gtestutils: Test the combination of --tap and --GTestSkipCount Signed-off-by: Simon McVittie --- glib/tests/testing.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/glib/tests/testing.c b/glib/tests/testing.c index 225f29941..a2804cdd8 100644 --- a/glib/tests/testing.c +++ b/glib/tests/testing.c @@ -1064,6 +1064,33 @@ test_tap (void) g_ptr_array_unref (argv); + g_test_message ("--GTestSkipCount"); + argv = g_ptr_array_new (); + g_ptr_array_add (argv, (char *) testing_helper); + g_ptr_array_add (argv, "skip-options"); + g_ptr_array_add (argv, "--tap"); + g_ptr_array_add (argv, "--GTestSkipCount"); + g_ptr_array_add (argv, "2"); + g_ptr_array_add (argv, NULL); + + g_spawn_sync (NULL, (char **) argv->pdata, NULL, + G_SPAWN_STDERR_TO_DEV_NULL, + NULL, NULL, &output, NULL, &status, + &error); + g_assert_no_error (error); + g_assert_nonnull (strstr (output, "1..5\n")); + g_assert_nonnull (strstr (output, "\nok 1 /a # SKIP\n")); + g_assert_nonnull (strstr (output, "\nok 2 /b/a # SKIP\n")); + g_assert_nonnull (strstr (output, "\nok 3 /b/b\n")); + g_assert_nonnull (strstr (output, "\nok 4 /c/a\n")); + g_assert_nonnull (strstr (output, "\nok 5 /d/a\n")); + + g_spawn_check_exit_status (status, &error); + g_assert_no_error (error); + + g_free (output); + g_ptr_array_unref (argv); + g_test_message ("-s"); argv = g_ptr_array_new (); g_ptr_array_add (argv, (char *) testing_helper);