mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-14 05:16:18 +01:00
gtester: do not consider skipped tests as failures
This is happening since f591366eee
, that
changed the way tests were skipped to use g_test_skip() instead of just
ignoring them. They are now reported to the log with G_TEST_RUN_SKIPPED
as result.
https://bugzilla.gnome.org/show_bug.cgi?id=790934
This commit is contained in:
parent
3246f1df99
commit
9b8f4faa4b
@ -102,21 +102,37 @@ testcase_close (long double duration,
|
||||
gint exit_status,
|
||||
guint n_forks)
|
||||
{
|
||||
gboolean success;
|
||||
|
||||
g_return_if_fail (testcase_open > 0);
|
||||
test_log_printfe ("%s<duration>%.6Lf</duration>\n", sindent (log_indent), duration);
|
||||
success = exit_status == G_TEST_RUN_SUCCESS || exit_status == G_TEST_RUN_SKIPPED;
|
||||
test_log_printfe ("%s<status exit-status=\"%d\" n-forks=\"%d\" result=\"%s\"/>\n",
|
||||
sindent (log_indent), exit_status, n_forks,
|
||||
exit_status ? "failed" : "success");
|
||||
success ? "failed" : "success");
|
||||
log_indent -= 2;
|
||||
test_log_printfe ("%s</testcase>\n", sindent (log_indent));
|
||||
testcase_open--;
|
||||
if (gtester_verbose)
|
||||
g_print ("%s\n", exit_status ? "FAIL" : "OK");
|
||||
if (exit_status && subtest_last_seed)
|
||||
{
|
||||
switch (exit_status)
|
||||
{
|
||||
case G_TEST_RUN_SUCCESS:
|
||||
g_print ("OK\n");
|
||||
break;
|
||||
case G_TEST_RUN_SKIPPED:
|
||||
g_print ("SKIP\n");
|
||||
break;
|
||||
default:
|
||||
g_print ("FAIL\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!success && subtest_last_seed)
|
||||
g_print ("GTester: last random seed: %s\n", subtest_last_seed);
|
||||
if (exit_status)
|
||||
if (!success)
|
||||
testcase_fail_count += 1;
|
||||
if (subtest_mode_fatal && exit_status)
|
||||
if (subtest_mode_fatal && !success)
|
||||
terminate();
|
||||
}
|
||||
|
||||
|
@ -663,12 +663,6 @@ static void gtest_default_log_handler (const gchar *log_domain,
|
||||
gpointer unused_data);
|
||||
|
||||
|
||||
typedef enum {
|
||||
G_TEST_RUN_SUCCESS,
|
||||
G_TEST_RUN_SKIPPED,
|
||||
G_TEST_RUN_FAILURE,
|
||||
G_TEST_RUN_INCOMPLETE
|
||||
} GTestResult;
|
||||
static const char * const g_test_result_names[] = {
|
||||
"OK",
|
||||
"SKIP",
|
||||
|
@ -353,6 +353,13 @@ typedef struct {
|
||||
GLIB_VAR const GTestConfig * const g_test_config_vars;
|
||||
|
||||
/* internal logging API */
|
||||
typedef enum {
|
||||
G_TEST_RUN_SUCCESS,
|
||||
G_TEST_RUN_SKIPPED,
|
||||
G_TEST_RUN_FAILURE,
|
||||
G_TEST_RUN_INCOMPLETE
|
||||
} GTestResult;
|
||||
|
||||
typedef enum {
|
||||
G_TEST_LOG_NONE,
|
||||
G_TEST_LOG_ERROR, /* s:msg */
|
||||
|
Loading…
Reference in New Issue
Block a user