diff options
author | Dafydd Harries <daf@rhydd.org> | 2009-02-08 13:15:12 +0100 |
---|---|---|
committer | Dafydd Harries <daf@rhydd.org> | 2009-02-08 13:15:12 +0100 |
commit | 2359ca653f36ca45e9486a184e0c16955deffc9e (patch) | |
tree | 4344558043f589facead05578a8464ee3bfaf399 | |
parent | 14056e1c24553ac0510c29810371827ffcc1e008 (diff) |
move Gibber tests into lib/gibber
-rw-r--r-- | .gitignore | 9 | ||||
-rw-r--r-- | configure.ac | 3 | ||||
-rw-r--r-- | lib/gibber/Makefile.am | 2 | ||||
-rw-r--r-- | lib/gibber/tests/Makefile.am | 122 | ||||
-rw-r--r-- | lib/gibber/tests/check-gibber-iq-helper.c (renamed from tests/check-gibber-iq-helper.c) | 0 | ||||
-rw-r--r-- | lib/gibber/tests/check-gibber-listener.c (renamed from tests/check-gibber-listener.c) | 0 | ||||
-rw-r--r-- | lib/gibber/tests/check-gibber-r-multicast-causal-transport.c (renamed from tests/check-gibber-r-multicast-causal-transport.c) | 0 | ||||
-rw-r--r-- | lib/gibber/tests/check-gibber-r-multicast-packet.c (renamed from tests/check-gibber-r-multicast-packet.c) | 0 | ||||
-rw-r--r-- | lib/gibber/tests/check-gibber-r-multicast-sender.c (renamed from tests/check-gibber-r-multicast-sender.c) | 0 | ||||
-rw-r--r-- | lib/gibber/tests/check-gibber-resolver.c (renamed from tests/check-gibber-resolver.c) | 0 | ||||
-rw-r--r-- | lib/gibber/tests/check-gibber-sasl-auth.c (renamed from tests/check-gibber-sasl-auth.c) | 0 | ||||
-rw-r--r-- | lib/gibber/tests/check-gibber-xmpp-connection-listener.c (renamed from tests/check-gibber-xmpp-connection-listener.c) | 0 | ||||
-rw-r--r-- | lib/gibber/tests/check-gibber-xmpp-connection.c (renamed from tests/check-gibber-xmpp-connection.c) | 0 | ||||
-rw-r--r-- | lib/gibber/tests/check-gibber-xmpp-error.c (renamed from tests/check-gibber-xmpp-error.c) | 0 | ||||
-rw-r--r-- | lib/gibber/tests/check-gibber-xmpp-node.c (renamed from tests/check-gibber-xmpp-node.c) | 0 | ||||
-rw-r--r-- | lib/gibber/tests/check-gibber-xmpp-reader.c (renamed from tests/check-gibber-xmpp-reader.c) | 0 | ||||
-rw-r--r-- | lib/gibber/tests/check-gibber-xmpp-stanza.c (renamed from tests/check-gibber-xmpp-stanza.c) | 0 | ||||
-rw-r--r-- | lib/gibber/tests/check-gibber.h (renamed from tests/check-gibber.h) | 0 | ||||
-rw-r--r-- | lib/gibber/tests/check-helpers.c | 63 | ||||
-rw-r--r-- | lib/gibber/tests/check-helpers.h | 43 | ||||
-rw-r--r-- | lib/gibber/tests/check-main.c | 54 | ||||
-rw-r--r-- | lib/gibber/tests/inputs/Makefile.am (renamed from tests/inputs/Makefile.am) | 0 | ||||
-rw-r--r-- | lib/gibber/tests/inputs/groupchat-invite.input (renamed from tests/inputs/groupchat-invite.input) | 0 | ||||
-rw-r--r-- | lib/gibber/tests/inputs/simple-message-attrnamespace.input (renamed from tests/inputs/simple-message-attrnamespace.input) | 0 | ||||
-rw-r--r-- | lib/gibber/tests/inputs/simple-message.input (renamed from tests/inputs/simple-message.input) | 0 | ||||
-rw-r--r-- | lib/gibber/tests/inputs/strange-streamopening.input (renamed from tests/inputs/strange-streamopening.input) | 0 | ||||
-rw-r--r-- | lib/gibber/tests/inputs/tls-stream-start.input (renamed from tests/inputs/tls-stream-start.input) | 0 | ||||
-rwxr-xr-x | lib/gibber/tests/run-xmpp-connection-test.sh (renamed from tests/run-xmpp-connection-test.sh) | 0 | ||||
-rw-r--r-- | lib/gibber/tests/test-r-multicast-transport-io.c (renamed from tests/test-r-multicast-transport-io.c) | 0 | ||||
-rw-r--r-- | lib/gibber/tests/test-resolver.c (renamed from tests/test-resolver.c) | 0 | ||||
-rw-r--r-- | lib/gibber/tests/test-resolver.h (renamed from tests/test-resolver.h) | 0 | ||||
-rw-r--r-- | lib/gibber/tests/test-sasl-auth-server-signals-marshal.list (renamed from tests/test-sasl-auth-server-signals-marshal.list) | 0 | ||||
-rw-r--r-- | lib/gibber/tests/test-sasl-auth-server.c (renamed from tests/test-sasl-auth-server.c) | 0 | ||||
-rw-r--r-- | lib/gibber/tests/test-sasl-auth-server.h (renamed from tests/test-sasl-auth-server.h) | 0 | ||||
-rw-r--r-- | lib/gibber/tests/test-transport.c (renamed from tests/test-transport.c) | 0 | ||||
-rw-r--r-- | lib/gibber/tests/test-transport.h (renamed from tests/test-transport.h) | 0 | ||||
-rw-r--r-- | lib/gibber/tests/test-xmpp-connection.c (renamed from tests/test-xmpp-connection.c) | 0 | ||||
-rw-r--r-- | tests/Makefile.am | 73 | ||||
-rw-r--r-- | tests/check-main.c | 31 |
39 files changed, 295 insertions, 105 deletions
@@ -109,11 +109,8 @@ src/write-mgr-file stamp-h1 telepathy-salut-*.tar.gz tests/check-main -tests/outputs tests/sasl-test.db -tests/test-xmpp-connection tests/test-r-multicast-{packet,sender,transport-io} -tests/test-r-multicast-transport-io tests/twisted/tools/core tests/twisted/tools/exec-with-log.sh tests/twisted/tools/salut-testing.log @@ -132,3 +129,9 @@ tests/test-r-multicast-packet tests/test-r-sender tests/test-r-transport-io tests/telepathy-salut-debug + +lib/gibber/tests/check-main +lib/gibber/tests/outputs +lib/gibber/tests/test-xmpp-connection +lib/gibber/tests/test-r-multicast-transport-io + diff --git a/configure.ac b/configure.ac index d61cbdf5..bcea22e1 100644 --- a/configure.ac +++ b/configure.ac @@ -274,13 +274,14 @@ AC_OUTPUT( Makefile \ lib/Makefile \ lib/gibber/Makefile \ lib/gibber/examples/Makefile \ + lib/gibber/tests/Makefile \ + lib/gibber/tests/inputs/Makefile \ src/Makefile \ m4/Makefile \ data/Makefile \ extensions/Makefile \ tools/Makefile \ tests/Makefile \ - tests/inputs/Makefile \ tests/twisted/Makefile \ tests/twisted/tools/Makefile \ ) diff --git a/lib/gibber/Makefile.am b/lib/gibber/Makefile.am index 975e8d33..f324db10 100644 --- a/lib/gibber/Makefile.am +++ b/lib/gibber/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS=examples +SUBDIRS = examples tests noinst_LTLIBRARIES = libgibber.la diff --git a/lib/gibber/tests/Makefile.am b/lib/gibber/tests/Makefile.am new file mode 100644 index 00000000..cc137228 --- /dev/null +++ b/lib/gibber/tests/Makefile.am @@ -0,0 +1,122 @@ +CLEANFILES= + +include $(top_srcdir)/rules/check.mak + +SUPPRESSIONS=valgrind.supp dlopen.supp + +# Teach it how to make libgibber.la +$(top_builddir)/lib/gibber/libgibber.la: + ${MAKE} -C $(top_builddir)/lib/gibber libgibber.la + +.PHONY: $(top_builddir)/lib/gibber/libgibber.la + +TESTS = \ + run-xmpp-connection-test.sh + +check_PROGRAMS = \ + test-xmpp-connection \ + test-r-multicast-transport-io + +check_SCRIPTS = run-xmpp-connection-test.sh + +EXTRA_DIST = simplemeshtest.py mesh.py $(check_SCRIPTS) + +test_xmpp_connection_SOURCES = \ + test-xmpp-connection.c \ + test-transport.c \ + test-transport.h + +test_xmpp_connection_LDADD = \ + $(top_builddir)/lib/gibber/libgibber.la \ + $(AM_LDFLAGS) + +test_xmpp_connection_CFLAGS = \ + $(AM_CFLAGS) + +test_r_multicast_transport_io_SOURCES = \ + test-r-multicast-transport-io.c \ + test-transport.c \ + test-transport.h + +test_r_multicast_transport_io_LDADD = \ + $(top_builddir)/lib/gibber/libgibber.la \ + $(AM_LDFLAGS) + +test_r_multicast_transport_io_CFLAGS = \ + $(AM_CFLAGS) + + +if HAVE_CHECK +check_PROGRAMS += check-main +TESTS += check-main +check_main_SOURCES = \ + check-main.c \ + check-helpers.c \ + check-helpers.h \ + check-gibber.h \ + check-gibber-xmpp-node.c \ + check-gibber-xmpp-reader.c \ + check-gibber-r-multicast-causal-transport.c \ + check-gibber-resolver.c \ + test-resolver.c \ + test-resolver.h \ + test-transport.c \ + test-transport.h \ + check-gibber-xmpp-connection.c \ + check-gibber-r-multicast-packet.c \ + check-gibber-r-multicast-sender.c \ + check-gibber-xmpp-stanza.c \ + check-gibber-iq-helper.c \ + check-gibber-listener.c \ + check-gibber-xmpp-connection-listener.c \ + check-gibber-xmpp-error.c + +check_main_LDADD = \ + @CHECK_LIBS@ \ + $(top_builddir)/lib/gibber/libgibber.la \ + $(AM_LDFLAGS) + +check_main_CFLAGS = \ + @CHECK_CFLAGS@ \ + $(AM_CFLAGS) + +if HAVE_LIBSASL2 + check_main_SOURCES += \ + check-gibber-sasl-auth.c \ + test-sasl-auth-server.c \ + test-sasl-auth-server.h + + check_main_LDADD += @LIBSASL2_LIBS@ + check_main_CFLAGS += @LIBSASL2_CFLAGS@ +endif + +endif + +AM_CFLAGS = $(ERROR_CFLAGS) @GLIB_CFLAGS@ @LIBXML2_CFLAGS@ @DBUS_CFLAGS@ \ + -I $(top_srcdir) -I $(top_builddir) \ + -I $(top_srcdir)/lib -I $(top_builddir)/lib + +AM_LDFLAGS = @GLIB_LIBS@ + +# Coding style checks +check_c_sources = \ + $(test_xmpp_connection_SOURCES) \ + $(test_r_multicast_transport_io_SOURCES) + +if HAVE_CHECK + check_c_sources += $(check_main_SOURCES) +endif + +include $(top_srcdir)/tools/check-coding-style.mk +check-local: check-coding-style + +clean-local: + -rm -rf outputs + -rm -f sasl-test.db + +SUBDIRS = inputs + +$(check_SCRIPTS): always-run + chmod +x $(srcdir)/$@ + +.PHONY: always-run diff --git a/tests/check-gibber-iq-helper.c b/lib/gibber/tests/check-gibber-iq-helper.c index 5a79c452..5a79c452 100644 --- a/tests/check-gibber-iq-helper.c +++ b/lib/gibber/tests/check-gibber-iq-helper.c diff --git a/tests/check-gibber-listener.c b/lib/gibber/tests/check-gibber-listener.c index 4a1bce06..4a1bce06 100644 --- a/tests/check-gibber-listener.c +++ b/lib/gibber/tests/check-gibber-listener.c diff --git a/tests/check-gibber-r-multicast-causal-transport.c b/lib/gibber/tests/check-gibber-r-multicast-causal-transport.c index 8dc92782..8dc92782 100644 --- a/tests/check-gibber-r-multicast-causal-transport.c +++ b/lib/gibber/tests/check-gibber-r-multicast-causal-transport.c diff --git a/tests/check-gibber-r-multicast-packet.c b/lib/gibber/tests/check-gibber-r-multicast-packet.c index 52bfef41..52bfef41 100644 --- a/tests/check-gibber-r-multicast-packet.c +++ b/lib/gibber/tests/check-gibber-r-multicast-packet.c diff --git a/tests/check-gibber-r-multicast-sender.c b/lib/gibber/tests/check-gibber-r-multicast-sender.c index b0a4c903..b0a4c903 100644 --- a/tests/check-gibber-r-multicast-sender.c +++ b/lib/gibber/tests/check-gibber-r-multicast-sender.c diff --git a/tests/check-gibber-resolver.c b/lib/gibber/tests/check-gibber-resolver.c index ba6effa0..ba6effa0 100644 --- a/tests/check-gibber-resolver.c +++ b/lib/gibber/tests/check-gibber-resolver.c diff --git a/tests/check-gibber-sasl-auth.c b/lib/gibber/tests/check-gibber-sasl-auth.c index 4ce68ff3..4ce68ff3 100644 --- a/tests/check-gibber-sasl-auth.c +++ b/lib/gibber/tests/check-gibber-sasl-auth.c diff --git a/tests/check-gibber-xmpp-connection-listener.c b/lib/gibber/tests/check-gibber-xmpp-connection-listener.c index 8dd19314..8dd19314 100644 --- a/tests/check-gibber-xmpp-connection-listener.c +++ b/lib/gibber/tests/check-gibber-xmpp-connection-listener.c diff --git a/tests/check-gibber-xmpp-connection.c b/lib/gibber/tests/check-gibber-xmpp-connection.c index de9dd1da..de9dd1da 100644 --- a/tests/check-gibber-xmpp-connection.c +++ b/lib/gibber/tests/check-gibber-xmpp-connection.c diff --git a/tests/check-gibber-xmpp-error.c b/lib/gibber/tests/check-gibber-xmpp-error.c index 3acc61c7..3acc61c7 100644 --- a/tests/check-gibber-xmpp-error.c +++ b/lib/gibber/tests/check-gibber-xmpp-error.c diff --git a/tests/check-gibber-xmpp-node.c b/lib/gibber/tests/check-gibber-xmpp-node.c index 3f5ea32c..3f5ea32c 100644 --- a/tests/check-gibber-xmpp-node.c +++ b/lib/gibber/tests/check-gibber-xmpp-node.c diff --git a/tests/check-gibber-xmpp-reader.c b/lib/gibber/tests/check-gibber-xmpp-reader.c index d6bb8b04..d6bb8b04 100644 --- a/tests/check-gibber-xmpp-reader.c +++ b/lib/gibber/tests/check-gibber-xmpp-reader.c diff --git a/tests/check-gibber-xmpp-stanza.c b/lib/gibber/tests/check-gibber-xmpp-stanza.c index ab0e62d4..ab0e62d4 100644 --- a/tests/check-gibber-xmpp-stanza.c +++ b/lib/gibber/tests/check-gibber-xmpp-stanza.c diff --git a/tests/check-gibber.h b/lib/gibber/tests/check-gibber.h index edd747ff..edd747ff 100644 --- a/tests/check-gibber.h +++ b/lib/gibber/tests/check-gibber.h diff --git a/lib/gibber/tests/check-helpers.c b/lib/gibber/tests/check-helpers.c new file mode 100644 index 00000000..86ef1154 --- /dev/null +++ b/lib/gibber/tests/check-helpers.c @@ -0,0 +1,63 @@ +/* + * check-helpers.c - Source for some check helpers + * Copyright (C) 2007 Collabora Ltd. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <stdio.h> +#include <stdlib.h> + +#include "check-helpers.h" + +static gboolean expecting_critical = FALSE; +static gboolean received_critical = FALSE; + +static void +check_helper_log_critical_func (const gchar *log_damain, + GLogLevelFlags log_level, + const gchar *message, + gpointer user_data) +{ + + if (!expecting_critical) + { + fail ("Unexpected critical message: %s\n", message); + } + + g_assert (log_level & G_LOG_LEVEL_CRITICAL); + + received_critical = TRUE; +} + +gboolean +got_critical (void) +{ + return received_critical; +} + +void +expect_critical (gboolean expected) +{ + expecting_critical = expected; + received_critical = FALSE; +} + +void +check_helpers_init (void) +{ + g_log_set_handler (NULL, G_LOG_LEVEL_CRITICAL, + check_helper_log_critical_func, NULL); +} diff --git a/lib/gibber/tests/check-helpers.h b/lib/gibber/tests/check-helpers.h new file mode 100644 index 00000000..b71b3b65 --- /dev/null +++ b/lib/gibber/tests/check-helpers.h @@ -0,0 +1,43 @@ +/* + * check-helpers.c - Source for some check helpers + * Copyright (C) 2007 Collabora Ltd. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ +#ifndef __CHECK_HELPERS_H__ +#define __CHECK_HELPERS_H__ + +#include <glib.h> +#include <check.h> + +void +check_helpers_init (void); + +void +expect_critical (gboolean expected); + +gboolean +got_critical (void); + +#define fail_unless_critical(expr, ...) \ +G_STMT_START { \ + expect_critical (TRUE); \ + expr; \ + _fail_unless (got_critical (), __FILE__, __LINE__, \ + "Expected g_critical, got none", ## __VA_ARGS__, NULL); \ + expect_critical (FALSE); \ +} G_STMT_END; + +#endif /* #ifndef __CHECK_HELPERS_H__ */ diff --git a/lib/gibber/tests/check-main.c b/lib/gibber/tests/check-main.c new file mode 100644 index 00000000..cf01cfe4 --- /dev/null +++ b/lib/gibber/tests/check-main.c @@ -0,0 +1,54 @@ +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <glib-object.h> + +#include <check.h> + +#include "check-gibber.h" +#include "check-helpers.h" + +#include "config.h" + +static Suite * +make_gibber_suite (void) +{ + Suite *s = suite_create ("Gibber"); + + suite_add_tcase (s, make_gibber_xmpp_node_tcase ()); + suite_add_tcase (s, make_gibber_xmpp_reader_tcase ()); + suite_add_tcase (s, make_gibber_xmpp_connection_tcase ()); +#ifdef HAVE_LIBSASL2 + suite_add_tcase (s, make_gibber_sasl_auth_tcase ()); +#endif + suite_add_tcase (s, make_gibber_resolver_tcase ()); + suite_add_tcase (s, make_gibber_r_multicast_packet_tcase ()); + suite_add_tcase (s, make_gibber_r_multicast_sender_tcase ()); + suite_add_tcase (s, make_gibber_r_multicast_causal_transport_tcase ()); + suite_add_tcase (s, make_gibber_xmpp_stanza_tcase ()); + suite_add_tcase (s, make_gibber_iq_helper_tcase ()); + suite_add_tcase (s, make_gibber_listener_tcase ()); + suite_add_tcase (s, make_gibber_xmpp_connection_listener_tcase ()); + suite_add_tcase (s, make_gibber_xmpp_error_tcase ()); + + return s; +} + +int +main (void) +{ + int number_failed = 0; + Suite *s; + SRunner *sr; + + check_helpers_init (); + g_type_init (); + + s = make_gibber_suite (); + sr = srunner_create (s); + srunner_run_all (sr, CK_NORMAL); + number_failed += srunner_ntests_failed (sr); + srunner_free (sr); + + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; +} diff --git a/tests/inputs/Makefile.am b/lib/gibber/tests/inputs/Makefile.am index 0b8b19f3..0b8b19f3 100644 --- a/tests/inputs/Makefile.am +++ b/lib/gibber/tests/inputs/Makefile.am diff --git a/tests/inputs/groupchat-invite.input b/lib/gibber/tests/inputs/groupchat-invite.input index 3c7954f4..3c7954f4 100644 --- a/tests/inputs/groupchat-invite.input +++ b/lib/gibber/tests/inputs/groupchat-invite.input diff --git a/tests/inputs/simple-message-attrnamespace.input b/lib/gibber/tests/inputs/simple-message-attrnamespace.input index b85d92f6..b85d92f6 100644 --- a/tests/inputs/simple-message-attrnamespace.input +++ b/lib/gibber/tests/inputs/simple-message-attrnamespace.input diff --git a/tests/inputs/simple-message.input b/lib/gibber/tests/inputs/simple-message.input index a3989ae5..a3989ae5 100644 --- a/tests/inputs/simple-message.input +++ b/lib/gibber/tests/inputs/simple-message.input diff --git a/tests/inputs/strange-streamopening.input b/lib/gibber/tests/inputs/strange-streamopening.input index 4685541a..4685541a 100644 --- a/tests/inputs/strange-streamopening.input +++ b/lib/gibber/tests/inputs/strange-streamopening.input diff --git a/tests/inputs/tls-stream-start.input b/lib/gibber/tests/inputs/tls-stream-start.input index d30bcf88..d30bcf88 100644 --- a/tests/inputs/tls-stream-start.input +++ b/lib/gibber/tests/inputs/tls-stream-start.input diff --git a/tests/run-xmpp-connection-test.sh b/lib/gibber/tests/run-xmpp-connection-test.sh index e2337abc..e2337abc 100755 --- a/tests/run-xmpp-connection-test.sh +++ b/lib/gibber/tests/run-xmpp-connection-test.sh diff --git a/tests/test-r-multicast-transport-io.c b/lib/gibber/tests/test-r-multicast-transport-io.c index 62a4e96d..62a4e96d 100644 --- a/tests/test-r-multicast-transport-io.c +++ b/lib/gibber/tests/test-r-multicast-transport-io.c diff --git a/tests/test-resolver.c b/lib/gibber/tests/test-resolver.c index bb6ab8d7..bb6ab8d7 100644 --- a/tests/test-resolver.c +++ b/lib/gibber/tests/test-resolver.c diff --git a/tests/test-resolver.h b/lib/gibber/tests/test-resolver.h index 1d39e4e6..1d39e4e6 100644 --- a/tests/test-resolver.h +++ b/lib/gibber/tests/test-resolver.h diff --git a/tests/test-sasl-auth-server-signals-marshal.list b/lib/gibber/tests/test-sasl-auth-server-signals-marshal.list index e69de29b..e69de29b 100644 --- a/tests/test-sasl-auth-server-signals-marshal.list +++ b/lib/gibber/tests/test-sasl-auth-server-signals-marshal.list diff --git a/tests/test-sasl-auth-server.c b/lib/gibber/tests/test-sasl-auth-server.c index 7132122e..7132122e 100644 --- a/tests/test-sasl-auth-server.c +++ b/lib/gibber/tests/test-sasl-auth-server.c diff --git a/tests/test-sasl-auth-server.h b/lib/gibber/tests/test-sasl-auth-server.h index cbfe95ea..cbfe95ea 100644 --- a/tests/test-sasl-auth-server.h +++ b/lib/gibber/tests/test-sasl-auth-server.h diff --git a/tests/test-transport.c b/lib/gibber/tests/test-transport.c index 78bd5660..78bd5660 100644 --- a/tests/test-transport.c +++ b/lib/gibber/tests/test-transport.c diff --git a/tests/test-transport.h b/lib/gibber/tests/test-transport.h index 1e76d133..1e76d133 100644 --- a/tests/test-transport.h +++ b/lib/gibber/tests/test-transport.h diff --git a/tests/test-xmpp-connection.c b/lib/gibber/tests/test-xmpp-connection.c index 71e5e2b1..71e5e2b1 100644 --- a/tests/test-xmpp-connection.c +++ b/lib/gibber/tests/test-xmpp-connection.c diff --git a/tests/Makefile.am b/tests/Makefile.am index 93cda48e..405e3b7a 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -10,15 +10,6 @@ $(top_builddir)/lib/gibber/libgibber.la: .PHONY: $(top_builddir)/lib/gibber/libgibber.la -TESTS = \ - run-xmpp-connection-test.sh - -check_PROGRAMS = \ - test-xmpp-connection \ - test-r-multicast-transport-io - -check_SCRIPTS = run-xmpp-connection-test.sh - EXTRA_DIST = simplemeshtest.py mesh.py $(check_SCRIPTS) noinst_PROGRAMS = \ @@ -34,57 +25,15 @@ telepathy_salut_debug_LDADD = \ $(top_builddir)/extensions/libsalut-extensions.la \ -ltelepathy-glib -test_xmpp_connection_SOURCES = \ - test-xmpp-connection.c \ - test-transport.c \ - test-transport.h - -test_xmpp_connection_LDADD = \ - $(top_builddir)/lib/gibber/libgibber.la \ - $(AM_LDFLAGS) - -test_xmpp_connection_CFLAGS = \ - $(AM_CFLAGS) - -test_r_multicast_transport_io_SOURCES = \ - test-r-multicast-transport-io.c \ - test-transport.c \ - test-transport.h - -test_r_multicast_transport_io_LDADD = \ - $(top_builddir)/lib/gibber/libgibber.la \ - $(AM_LDFLAGS) - -test_r_multicast_transport_io_CFLAGS = \ - $(AM_CFLAGS) - - if HAVE_CHECK -check_PROGRAMS += check-main -TESTS += check-main +check_PROGRAMS = check-main +TESTS = check-main check_main_SOURCES = \ check-main.c \ check-helpers.c \ check-helpers.h \ - check-gibber.h \ - check-salut.h \ - check-gibber-xmpp-node.c \ - check-gibber-xmpp-reader.c \ check-node-properties.c \ - check-gibber-r-multicast-causal-transport.c \ - check-gibber-resolver.c \ - test-resolver.c \ - test-resolver.h \ - test-transport.c \ - test-transport.h \ - check-gibber-xmpp-connection.c \ - check-gibber-r-multicast-packet.c \ - check-gibber-r-multicast-sender.c \ - check-gibber-xmpp-stanza.c \ - check-gibber-iq-helper.c \ - check-gibber-listener.c \ - check-gibber-xmpp-connection-listener.c \ - check-gibber-xmpp-error.c + check-salut.h check_main_LDADD = \ @CHECK_LIBS@ \ @@ -97,16 +46,6 @@ check_main_CFLAGS = \ @CHECK_CFLAGS@ \ $(AM_CFLAGS) -if HAVE_LIBSASL2 - check_main_SOURCES += \ - check-gibber-sasl-auth.c \ - test-sasl-auth-server.c \ - test-sasl-auth-server.h - - check_main_LDADD += @LIBSASL2_LIBS@ - check_main_CFLAGS += @LIBSASL2_CFLAGS@ -endif - endif AM_CFLAGS = $(ERROR_CFLAGS) @GLIB_CFLAGS@ @LIBXML2_CFLAGS@ @DBUS_CFLAGS@ \ @@ -130,11 +69,7 @@ endif include $(top_srcdir)/tools/check-coding-style.mk check-local: check-coding-style -clean-local: - -rm -rf outputs - -rm -f sasl-test.db - -SUBDIRS = inputs twisted +SUBDIRS = twisted $(check_SCRIPTS): always-run chmod +x $(srcdir)/$@ diff --git a/tests/check-main.c b/tests/check-main.c index 7df4f389..7d1a85f5 100644 --- a/tests/check-main.c +++ b/tests/check-main.c @@ -5,37 +5,12 @@ #include <check.h> -#include "check-gibber.h" #include "check-salut.h" #include "check-helpers.h" #include "config.h" static Suite * -make_gibber_suite (void) -{ - Suite *s = suite_create ("Gibber"); - - suite_add_tcase (s, make_gibber_xmpp_node_tcase ()); - suite_add_tcase (s, make_gibber_xmpp_reader_tcase ()); - suite_add_tcase (s, make_gibber_xmpp_connection_tcase ()); -#ifdef HAVE_LIBSASL2 - suite_add_tcase (s, make_gibber_sasl_auth_tcase ()); -#endif - suite_add_tcase (s, make_gibber_resolver_tcase ()); - suite_add_tcase (s, make_gibber_r_multicast_packet_tcase ()); - suite_add_tcase (s, make_gibber_r_multicast_sender_tcase ()); - suite_add_tcase (s, make_gibber_r_multicast_causal_transport_tcase ()); - suite_add_tcase (s, make_gibber_xmpp_stanza_tcase ()); - suite_add_tcase (s, make_gibber_iq_helper_tcase ()); - suite_add_tcase (s, make_gibber_listener_tcase ()); - suite_add_tcase (s, make_gibber_xmpp_connection_listener_tcase ()); - suite_add_tcase (s, make_gibber_xmpp_error_tcase ()); - - return s; -} - -static Suite * make_salut_suite (void) { Suite *s = suite_create ("Salut"); @@ -55,12 +30,6 @@ main (void) check_helpers_init (); g_type_init (); - s = make_gibber_suite (); - sr = srunner_create (s); - srunner_run_all (sr, CK_NORMAL); - number_failed += srunner_ntests_failed (sr); - srunner_free (sr); - s = make_salut_suite (); sr = srunner_create (s); srunner_run_all (sr, CK_NORMAL); |