diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2014-03-18 17:27:21 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2014-03-19 17:30:36 +0000 |
commit | 8f97a840f1d9c303e60d416c385f7a4419423aba (patch) | |
tree | 0c845dba70c33781ac4b799ea8dd58d17a678b97 | |
parent | cb955db4e0affefd427280b5d18bb3b2914eeff3 (diff) | |
download | telepathy-glib-8f97a840f1d9c303e60d416c385f7a4419423aba.tar.gz |
Logger tests: enable all debug with tpl_debug_set_flags(), tp_debug_set_flags()
Stop using tp_debug_divert_messages(), which is redundant with
recent Automake's logging support, and
_tpl_debug_set_flags_from_env(), which requires setting special
environment variables.
Reviewed-by: Xavier Claessens
-rw-r--r-- | tests/logger/dbus/test-entity.c | 6 | ||||
-rw-r--r-- | tests/logger/dbus/test-log-manager.c | 8 | ||||
-rw-r--r-- | tests/logger/dbus/test-tpl-log-iter-pidgin.c | 8 | ||||
-rw-r--r-- | tests/logger/dbus/test-tpl-log-iter-xml.c | 8 | ||||
-rw-r--r-- | tests/logger/dbus/test-tpl-log-store-pidgin.c | 8 | ||||
-rw-r--r-- | tests/logger/dbus/test-tpl-log-store-sqlite.c | 7 | ||||
-rw-r--r-- | tests/logger/dbus/test-tpl-log-store-xml.c | 8 | ||||
-rw-r--r-- | tests/logger/dbus/test-tpl-log-walker.c | 8 | ||||
-rw-r--r-- | tests/logger/dbus/test-tpl-observer.c | 5 | ||||
-rw-r--r-- | tests/logger/test-tpl-conf.c | 6 |
10 files changed, 46 insertions, 26 deletions
diff --git a/tests/logger/dbus/test-entity.c b/tests/logger/dbus/test-entity.c index ab9c9a2fa..7df50b5fc 100644 --- a/tests/logger/dbus/test-entity.c +++ b/tests/logger/dbus/test-entity.c @@ -2,6 +2,9 @@ #include <glib.h> #include <glib/gprintf.h> +#include <telepathy-glib/telepathy-glib.h> + +#include <telepathy-logger/debug.h> #include <telepathy-logger/entity.h> #include <telepathy-logger/entity-internal.h> @@ -154,6 +157,9 @@ test_entity_instantiation_from_tp_contact (void) int main (int argc, char **argv) { + tpl_debug_set_flags ("all"); + tp_debug_set_flags ("all"); + tp_tests_init (&argc, &argv); g_test_add_func ("/entity/instantiation", diff --git a/tests/logger/dbus/test-log-manager.c b/tests/logger/dbus/test-log-manager.c index 5986e9e74..0534e69dc 100644 --- a/tests/logger/dbus/test-log-manager.c +++ b/tests/logger/dbus/test-log-manager.c @@ -7,6 +7,7 @@ #include "lib/simple-account-manager.h" #include "lib/logger-test-helper.h" +#include <telepathy-logger/debug.h> #include "telepathy-logger/debug-internal.h" #include "telepathy-logger/log-manager-internal.h" #include "telepathy-logger/log-store-internal.h" @@ -260,10 +261,6 @@ setup_for_writing (TestCaseFixture *fixture, static void setup_debug (void) { - tp_debug_divert_messages (g_getenv ("TPL_LOGFILE")); - - _tpl_debug_set_flags_from_env (); - stamp_logs = (g_getenv ("TPL_TIMING") != NULL); debug_sender = tp_debug_sender_dup (); @@ -748,6 +745,9 @@ main (int argc, char **argv) int retval; GTestDBus *test_dbus; + tpl_debug_set_flags ("all"); + tp_debug_set_flags ("all"); + /* FIXME: this stuff should be part of the fixture, but setup_debug() * uses tp_dbus_daemon_dup() */ g_test_dbus_unset (); diff --git a/tests/logger/dbus/test-tpl-log-iter-pidgin.c b/tests/logger/dbus/test-tpl-log-iter-pidgin.c index 9d8cf72b3..358da08a2 100644 --- a/tests/logger/dbus/test-tpl-log-iter-pidgin.c +++ b/tests/logger/dbus/test-tpl-log-iter-pidgin.c @@ -3,6 +3,7 @@ #include "lib/simple-account.h" #include "lib/util.h" +#include <telepathy-logger/debug.h> #include "telepathy-logger/debug-internal.h" #include "telepathy-logger/log-iter-internal.h" #include "telepathy-logger/log-iter-pidgin-internal.h" @@ -52,6 +53,9 @@ setup (PidginTestCaseFixture* fixture, GHashTable *asv; const gchar *account_path = NULL; + tpl_debug_set_flags ("all"); + tp_debug_set_flags ("all"); + fixture->main_loop = g_main_loop_new (NULL, FALSE); g_assert (fixture->main_loop != NULL); @@ -106,10 +110,6 @@ setup (PidginTestCaseFixture* fixture, g_array_free (features, FALSE); g_main_loop_run (fixture->main_loop); - - tp_debug_divert_messages (g_getenv ("TPL_LOGFILE")); - - _tpl_debug_set_flags_from_env (); } diff --git a/tests/logger/dbus/test-tpl-log-iter-xml.c b/tests/logger/dbus/test-tpl-log-iter-xml.c index 1204fc1ed..88a3edbeb 100644 --- a/tests/logger/dbus/test-tpl-log-iter-xml.c +++ b/tests/logger/dbus/test-tpl-log-iter-xml.c @@ -4,6 +4,7 @@ #include "lib/util.h" #include "telepathy-logger/call-event.h" +#include <telepathy-logger/debug.h> #include "telepathy-logger/debug-internal.h" #include "telepathy-logger/log-iter-internal.h" #include "telepathy-logger/log-iter-xml-internal.h" @@ -34,6 +35,9 @@ setup (XmlTestCaseFixture* fixture, { GError *error = NULL; + tpl_debug_set_flags ("all"); + tp_debug_set_flags ("all"); + fixture->main_loop = g_main_loop_new (NULL, FALSE); fixture->store = g_object_new (TPL_TYPE_LOG_STORE_XML, @@ -55,10 +59,6 @@ setup (XmlTestCaseFixture* fixture, tpl_test_create_and_prepare_account (fixture->bus, fixture->factory, TP_ACCOUNT_OBJECT_PATH_BASE "gabble/jabber/user_40collabora_2eco_2euk", &fixture->account, &fixture->account_service); - - tp_debug_divert_messages (g_getenv ("TPL_LOGFILE")); - - _tpl_debug_set_flags_from_env (); } diff --git a/tests/logger/dbus/test-tpl-log-store-pidgin.c b/tests/logger/dbus/test-tpl-log-store-pidgin.c index 147ecb2b6..be7a52397 100644 --- a/tests/logger/dbus/test-tpl-log-store-pidgin.c +++ b/tests/logger/dbus/test-tpl-log-store-pidgin.c @@ -9,6 +9,7 @@ #include "lib/simple-account.h" #include "lib/simple-account-manager.h" +#include <telepathy-logger/debug.h> #include <telepathy-logger/log-store-pidgin-internal.h> #include <telepathy-logger/text-event-internal.h> #include <telepathy-logger/client-factory-internal.h> @@ -169,6 +170,9 @@ static void setup (PidginTestCaseFixture* fixture, gconstpointer user_data) { + tpl_debug_set_flags ("all"); + tp_debug_set_flags ("all"); + DEBUG ("setting up"); fixture->main_loop = g_main_loop_new (NULL, FALSE); @@ -521,10 +525,6 @@ test_get_events_for_empty_file (PidginTestCaseFixture *fixture, static void setup_debug (void) { - tp_debug_divert_messages (g_getenv ("TPL_LOGFILE")); - - _tpl_debug_set_flags_from_env (); - stamp_logs = (g_getenv ("TPL_TIMING") != NULL); debug_sender = tp_debug_sender_dup (); diff --git a/tests/logger/dbus/test-tpl-log-store-sqlite.c b/tests/logger/dbus/test-tpl-log-store-sqlite.c index 5d261688e..5d8a4bf0f 100644 --- a/tests/logger/dbus/test-tpl-log-store-sqlite.c +++ b/tests/logger/dbus/test-tpl-log-store-sqlite.c @@ -1,5 +1,8 @@ #include "config.h" +#include <telepathy-glib/telepathy-glib.h> + +#include <telepathy-logger/debug.h> #include <telepathy-logger/log-store-sqlite-internal.h> #include <telepathy-logger/debug-internal.h> #include <telepathy-logger/client-factory-internal.h> @@ -14,6 +17,8 @@ static void setup (Fixture *fixture, gconstpointer data) { + tpl_debug_set_flags ("all"); + tp_debug_set_flags ("all"); } static void @@ -26,8 +31,6 @@ test (Fixture *fixture, GError *error = NULL; TpClientFactory* factory; - _tpl_debug_set_flags_from_env (); - bus = tp_dbus_daemon_dup (&error); g_assert_no_error (error); diff --git a/tests/logger/dbus/test-tpl-log-store-xml.c b/tests/logger/dbus/test-tpl-log-store-xml.c index 3dcd89e1c..1bd1e95de 100644 --- a/tests/logger/dbus/test-tpl-log-store-xml.c +++ b/tests/logger/dbus/test-tpl-log-store-xml.c @@ -5,6 +5,7 @@ #include "lib/logger-test-helper.h" #include "lib/util.h" +#include <telepathy-logger/debug.h> #include "telepathy-logger/debug-internal.h" #include "telepathy-logger/log-manager-internal.h" #include "telepathy-logger/log-store-internal.h" @@ -35,6 +36,9 @@ setup (XmlTestCaseFixture* fixture, { GError *error = NULL; + tpl_debug_set_flags ("all"); + tp_debug_set_flags ("all"); + fixture->main_loop = g_main_loop_new (NULL, FALSE); fixture->store = g_object_new (TPL_TYPE_LOG_STORE_XML, @@ -57,10 +61,6 @@ setup (XmlTestCaseFixture* fixture, fixture->factory = _tpl_client_factory_dup (fixture->bus); fixture->account_manager = tp_account_manager_dup (); - - tp_debug_divert_messages (g_getenv ("TPL_LOGFILE")); - - _tpl_debug_set_flags_from_env (); } diff --git a/tests/logger/dbus/test-tpl-log-walker.c b/tests/logger/dbus/test-tpl-log-walker.c index 6035ff72f..cba3f03b9 100644 --- a/tests/logger/dbus/test-tpl-log-walker.c +++ b/tests/logger/dbus/test-tpl-log-walker.c @@ -6,6 +6,7 @@ #include "lib/util.h" #include "telepathy-logger/call-event.h" +#include <telepathy-logger/debug.h> #include "telepathy-logger/debug-internal.h" #include "telepathy-logger/log-manager.h" #include "telepathy-logger/text-event.h" @@ -54,6 +55,9 @@ setup (WalkerTestCaseFixture* fixture, GHashTable *asv; const gchar *account_path = NULL; + tpl_debug_set_flags ("all"); + tp_debug_set_flags ("all"); + fixture->main_loop = g_main_loop_new (NULL, FALSE); g_assert (fixture->main_loop != NULL); @@ -106,10 +110,6 @@ setup (WalkerTestCaseFixture* fixture, g_array_free (features, FALSE); g_main_loop_run (fixture->main_loop); - - tp_debug_divert_messages (g_getenv ("TPL_LOGFILE")); - - _tpl_debug_set_flags_from_env (); } diff --git a/tests/logger/dbus/test-tpl-observer.c b/tests/logger/dbus/test-tpl-observer.c index 0ecf052ad..0e55c8dff 100644 --- a/tests/logger/dbus/test-tpl-observer.c +++ b/tests/logger/dbus/test-tpl-observer.c @@ -1,5 +1,8 @@ #include "config.h" +#include <telepathy-glib/telepathy-glib.h> + +#include <telepathy-logger/debug.h> #include <telepathy-logger/observer-internal.h> #include "tests/lib/util.h" @@ -12,6 +15,8 @@ static void setup (Fixture *fixture, gconstpointer data) { + tpl_debug_set_flags ("all"); + tp_debug_set_flags ("all"); } static void diff --git a/tests/logger/test-tpl-conf.c b/tests/logger/test-tpl-conf.c index 371de4d95..cd7c8d33f 100644 --- a/tests/logger/test-tpl-conf.c +++ b/tests/logger/test-tpl-conf.c @@ -1,12 +1,18 @@ #include "config.h" +#include <telepathy-glib/telepathy-glib.h> + #include <telepathy-logger/conf-internal.h> +#include <telepathy-logger/debug.h> int main (int argc, char **argv) { TplConf *conf, *conf2; + tpl_debug_set_flags ("all"); + tp_debug_set_flags ("all"); + conf = _tpl_conf_dup (); /* TplConf is a singleton, be sure both point to the same memory */ |