7 #include "../eventloop.h"
11 /******************************************************************************
13 *****************************************************************************/
15 purple_check_input_add(gint fd
, PurpleInputCondition condition
,
16 PurpleInputFunction function
, gpointer data
)
18 /* this is a no-op for now, feel free to implement it */
22 static PurpleEventLoopUiOps eventloop_ui_ops
= {
25 purple_check_input_add
,
27 NULL
, /* input_get_error */
28 #if GLIB_CHECK_VERSION(2,14,0)
29 g_timeout_add_seconds
,
39 purple_check_init(void) {
40 #if !GLIB_CHECK_VERSION(2, 36, 0)
41 /* GLib type system is automaticaly initialized since 2.36. */
45 purple_eventloop_set_ui_ops(&eventloop_ui_ops
);
48 /* build our fake home directory */
52 home_dir
= g_build_path(G_DIR_SEPARATOR_S
, BUILDDIR
, "libpurple", "tests", "home", NULL
);
53 purple_util_set_user_dir(home_dir
);
57 purple_util_set_user_dir("/dev/null");
60 purple_core_init("check");
63 /******************************************************************************
64 * Check meat and potatoes
65 *****************************************************************************/
69 Suite
*s
= suite_create("Master Suite");
79 if (g_getenv("PURPLE_CHECK_DEBUG"))
80 purple_debug_set_enabled(TRUE
);
82 /* Make g_return_... functions fatal, ALWAYS.
83 * As this is the test code, this is NOT controlled
84 * by PURPLE_FATAL_ASSERTS. */
85 g_log_set_always_fatal(G_LOG_LEVEL_CRITICAL
);
87 sr
= srunner_create (master_suite());
89 srunner_add_suite(sr
, cipher_suite());
90 srunner_add_suite(sr
, jabber_caps_suite());
91 srunner_add_suite(sr
, jabber_digest_md5_suite());
92 srunner_add_suite(sr
, jabber_jutil_suite());
93 srunner_add_suite(sr
, jabber_scram_suite());
94 srunner_add_suite(sr
, oscar_util_suite());
95 srunner_add_suite(sr
, util_suite());
96 srunner_add_suite(sr
, xmlnode_suite());
98 /* make this a libpurple "ui" */
101 srunner_run_all (sr
, CK_NORMAL
);
102 number_failed
= srunner_ntests_failed (sr
);
107 return (number_failed
== 0) ? EXIT_SUCCESS
: EXIT_FAILURE
;