[glib] Add start/stop suite log messages
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] Add start/stop suite log messages
- Date: Sat, 17 Aug 2013 21:28:02 +0000 (UTC)
commit 8253f98a18043cba76cc7524f752b3586e63b747
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Jan 20 03:23:38 2013 -0500
Add start/stop suite log messages
These will be used in the following commits, when
implementing support for TAP as an alternative
test driver protocol.
https://bugzilla.gnome.org/show_bug.cgi?id=692125
glib/gtester.c | 2 ++
glib/gtestutils.c | 10 ++++++++++
glib/gtestutils.h | 4 +++-
glib/tests/protocol.c | 4 ++++
4 files changed, 19 insertions(+), 1 deletions(-)
---
diff --git a/glib/gtester.c b/glib/gtester.c
index 0a2feb2..12f7f1a 100644
--- a/glib/gtester.c
+++ b/glib/gtester.c
@@ -130,6 +130,8 @@ test_log_msg (GTestLogMsg *msg)
guint i;
gchar **strv;
case G_TEST_LOG_NONE:
+ case G_TEST_LOG_START_SUITE:
+ case G_TEST_LOG_STOP_SUITE:
break;
case G_TEST_LOG_ERROR:
strv = g_strsplit (msg->strings[0], "\n", -1);
diff --git a/glib/gtestutils.c b/glib/gtestutils.c
index 3ab4e16..529cbd3 100644
--- a/glib/gtestutils.c
+++ b/glib/gtestutils.c
@@ -595,6 +595,8 @@ g_test_log_type_name (GTestLogType log_type)
case G_TEST_LOG_MIN_RESULT: return "minperf";
case G_TEST_LOG_MAX_RESULT: return "maxperf";
case G_TEST_LOG_MESSAGE: return "message";
+ case G_TEST_LOG_START_SUITE: return "start suite";
+ case G_TEST_LOG_STOP_SUITE: return "stop suite";
}
return "???";
}
@@ -660,6 +662,10 @@ g_test_log (GTestLogType lbit,
if (g_test_verbose())
g_print ("GTest: random seed: %s\n", string2);
break;
+ case G_TEST_LOG_START_SUITE:
+ break;
+ case G_TEST_LOG_STOP_SUITE:
+ break;
case G_TEST_LOG_STOP_CASE:
if (g_test_verbose())
g_print ("GTest: result: %s\n", fail ? "FAIL" : "OK");
@@ -1911,6 +1917,8 @@ g_test_run_suite_internal (GTestSuite *suite,
g_return_val_if_fail (suite != NULL, -1);
+ g_test_log (G_TEST_LOG_START_SUITE, suite->name, NULL, 0, NULL);
+
while (path[0] == '/')
path++;
l = strlen (path);
@@ -1941,6 +1949,8 @@ g_test_run_suite_internal (GTestSuite *suite,
g_free (test_run_name);
test_run_name = old_name;
+ g_test_log (G_TEST_LOG_STOP_SUITE, suite->name, NULL, 0, NULL);
+
return n_bad;
}
diff --git a/glib/gtestutils.h b/glib/gtestutils.h
index 63e3b74..d579628 100644
--- a/glib/gtestutils.h
+++ b/glib/gtestutils.h
@@ -309,7 +309,9 @@ typedef enum {
G_TEST_LOG_STOP_CASE, /* d:status d:nforks d:elapsed */
G_TEST_LOG_MIN_RESULT, /* s:blurb d:result */
G_TEST_LOG_MAX_RESULT, /* s:blurb d:result */
- G_TEST_LOG_MESSAGE /* s:blurb */
+ G_TEST_LOG_MESSAGE, /* s:blurb */
+ G_TEST_LOG_START_SUITE,
+ G_TEST_LOG_STOP_SUITE
} GTestLogType;
typedef struct {
diff --git a/glib/tests/protocol.c b/glib/tests/protocol.c
index 8e0292d..9aa4879 100644
--- a/glib/tests/protocol.c
+++ b/glib/tests/protocol.c
@@ -193,6 +193,8 @@ test_message (void)
{
case G_TEST_LOG_START_BINARY:
case G_TEST_LOG_START_CASE:
+ case G_TEST_LOG_START_SUITE:
+ case G_TEST_LOG_STOP_SUITE:
/* ignore */
break;
case G_TEST_LOG_STOP_CASE:
@@ -302,6 +304,8 @@ test_error (void)
{
case G_TEST_LOG_START_BINARY:
case G_TEST_LOG_START_CASE:
+ case G_TEST_LOG_START_SUITE:
+ case G_TEST_LOG_STOP_SUITE:
/* ignore */
break;
case G_TEST_LOG_STOP_CASE:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]