check-main
*.log
+empathy-utils-test
+test-report.xml
$(top_builddir)/libempathy/libempathy.la \
$(EMPATHY_LIBS)
-check_PROGRAMS = check-main
+TEST_PROGS = \
+ empathy-utils-test
+
+empathy_utils_test_SOURCES = empathy-utils-test.c
+
+check_PROGRAMS = check-main $(TEST_PROGS)
+
TESTS = check-main
check_main_SOURCES = \
check-main.c \
check-helpers.c \
check-helpers.h \
check-libempathy.h \
- check-empathy-utils.c \
check-empathy-helpers.h \
check-empathy-helpers.c \
check-irc-helper.h \
check_c_sources = \
$(check_main_SOURCES)
include $(top_srcdir)/tools/check-coding-style.mk
-check-local: check-coding-style
+check-local: test check-coding-style
check_main_LDADD = \
@CHECK_LIBS@ \
TESTS_ENVIRONMENT = EMPATHY_SRCDIR=@abs_top_srcdir@ \
MC_PROFILE_DIR=@abs_top_srcdir@/tests \
MC_MANAGER_DIR=@abs_top_srcdir@/tests
+
+test-report: test-report.xml
+ gtester-report $(top_builddir)/tests/$@.xml > \
+ $(top_builddir)/tests/$@.html
+
+test-report.xml: ${TEST_PROGS} test
+
+test: ${TEST_PROGS}
+ gtester -o test-report.xml -k --verbose ${TEST_PROGS}
+
+test-%: empathy-%-test
+ gtester -o $@-report.xml -k --verbose $<
+
+.PHONY: test test-report
+++ /dev/null
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include <check.h>
-#include "check-helpers.h"
-#include "check-libempathy.h"
-
-#include <libempathy/empathy-utils.h>
-
-START_TEST (test_empathy_substring)
-{
- gchar *tmp;
-
- tmp = empathy_substring ("empathy", 2, 6);
- fail_if (tmp == NULL);
- fail_if (strcmp (tmp, "path") != 0);
-
- g_free (tmp);
-}
-END_TEST
-
-TCase *
-make_empathy_utils_tcase (void)
-{
- TCase *tc = tcase_create ("empathy-utils");
- tcase_add_test (tc, test_empathy_substring);
- return tc;
-}
#ifndef __CHECK_LIBEMPATHY__
#define __CHECK_LIBEMPATHY__
-TCase * make_empathy_utils_tcase (void);
TCase * make_empathy_irc_server_tcase (void);
TCase * make_empathy_irc_network_tcase (void);
TCase * make_empathy_irc_network_manager_tcase (void);
{
Suite *s = suite_create ("libempathy");
- suite_add_tcase (s, make_empathy_utils_tcase ());
suite_add_tcase (s, make_empathy_irc_server_tcase ());
suite_add_tcase (s, make_empathy_irc_network_tcase ());
suite_add_tcase (s, make_empathy_irc_network_manager_tcase ());
--- /dev/null
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <glib.h>
+
+#include <libempathy/empathy-utils.h>
+
+static void
+test_init (int argc,
+ char **argv)
+{
+ g_test_init (&argc, &argv, NULL);
+ g_type_init ();
+}
+
+static void
+test_deinit (void)
+{
+ ;
+}
+
+static void
+test_substring (void)
+{
+ gchar *tmp;
+
+ tmp = empathy_substring ("empathy", 2, 6);
+ g_assert (tmp != NULL);
+ g_assert (strcmp (tmp, "path") == 0);
+
+ g_free (tmp);
+}
+
+int
+main (int argc,
+ char **argv)
+{
+ int result;
+
+ test_init (argc, argv);
+
+ g_test_add_func ("/utils/substring", test_substring);
+
+ result = g_test_run ();
+ test_deinit ();
+ return result;
+}