gtestutils: Do not make a subtest to Bail out! the root one

This is something that a base test should decide, so if a subtest fails it's
up to the caller to decide whether to bail out the whole suite or just the
subtest.
This commit is contained in:
Marco Trevisan (Treviño) 2023-01-20 15:27:27 +01:00
parent f5f09445b8
commit d8e4c1a8f8
2 changed files with 3 additions and 14 deletions

View File

@ -1219,16 +1219,7 @@ g_test_log (GTestLogType lbit,
while ((line = strchr (line, '\n')))
*(line++) = ' ';
if (is_subtest ())
{
g_test_tap_print (subtest_level, FALSE, "Bail out! %s\n", message);
g_test_tap_print (0, FALSE, "Bail out!\n");
}
else
{
g_test_tap_print (0, FALSE, "Bail out! %s\n", message);
}
g_test_tap_print (subtest_level, FALSE, "Bail out! %s\n", message);
g_free (message);
}
else if (g_test_verbose ())

View File

@ -2722,8 +2722,7 @@ test_tap_subtest_error (void)
g_assert_cmpstr (interesting_lines, ==,
TAP_SUBTEST_PREFIX "Bail out! GLib-FATAL-ERROR: This should error out "
"Because it's just wrong!\n"
"Bail out!\n");
"Because it's just wrong!\n");
g_free (output);
g_ptr_array_unref (argv);
@ -2815,8 +2814,7 @@ test_tap_subtest_error_and_pass (void)
g_assert_cmpstr (interesting_lines, ==,
TAP_SUBTEST_PREFIX "Bail out! GLib-FATAL-ERROR: This should error out "
"Because it's just wrong!\n"
"Bail out!\n");
"Because it's just wrong!\n");
g_free (output);
g_ptr_array_unref (argv);