SUBDIRS = src test
+valgrind:
+ cd test; make valgrind
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
-AM_INIT_AUTOMAKE([1.11 -Wall nostdinc silent-rules subdir-objects])
+AM_INIT_AUTOMAKE([1.11 nostdinc silent-rules subdir-objects -Wno-portability])
# Checks for programs.
AC_PROG_CC
SUBDIRS=common daemon extensions plugins
+
-SUBDIRS=password ssotest digest
+SUBDIRS=. password ssotest digest
+
+all-local: createlibs
+
+createlibs:
+ $(MKDIR_P) .libs
gsignond-digest-plugin.c \
$(NULL)
-CLEANFILES =
+all-local: slink
+
+slink:
+ ln -sf $(top_builddir)/src/plugins/digest/.libs/libdigest.so ../.libs/libdigest.so
+
gsignond-password-plugin.c \
$(NULL)
-CLEANFILES =
+all-local: slink
+
+slink:
+ ln -sf $(top_builddir)/src/plugins/password/.libs/libpassword.so ../.libs/libpassword.so
gsignond-ssotest-plugin.c \
$(NULL)
-CLEANFILES =
+all-local: slink
+
+slink:
+ ln -sf $(top_builddir)/src/plugins/ssotest/.libs/libssotest.so ../.libs/libssotest.so
+
+
-SUBDIRS = common daemon db plugins
+SUBDIRS=common daemon db plugins
+
+VALGRIND_TESTS_DISABLE=
+valgrind: $(SUBDIRS)
+ for t in $(filter-out $(VALGRIND_TESTS_DISABLE),$(SUBDIRS)); do \
+ cd $$t; $(MAKE) valgrind; \
+ done;
TESTS = commontest
-TESTS_ENVIRONMENT= SSO_PLUGINS_DIR=$(top_builddir)/src/plugins/password/.libs
+TESTS_ENVIRONMENT=
+VALGRIND_TESTS_DISABLE=
+include $(top_srcdir)/test/valgrind_common.mk
check_PROGRAMS = commontest
commontest_SOURCES = commontest.c
commontest_LDADD = \
$(top_builddir)/src/common/libgsignond-common.la \
$(GSIGNOND_LIBS) \
- $(CHECK_LIBS)
\ No newline at end of file
+ $(CHECK_LIBS)
else
TESTS = test-daemon-setup.sh
endif
+TESTS_ENVIRONMENT=
+VALGRIND_TESTS_DISABLE=
+include $(top_srcdir)/test/valgrind_common.mk
+
check_PROGRAMS = daemontest
daemontest_SOURCES = daemon-test.c
$(CHECK_LIBS)
EXTRA_DIST = "$(top_builddir)/test/daemon/services/com.google.code.AccountsSSO.SingleSignOn.service.in"
+
TESTS = dbtest
+TESTS_ENVIRONMENT=
+VALGRIND_TESTS_DISABLE=
+include $(top_srcdir)/test/valgrind_common.mk
+
check_PROGRAMS = dbtest
dbtest_SOURCES = dbtest.c
dbtest_CFLAGS = \
$(top_builddir)/src/common/libgsignond-common.la \
$(top_builddir)/src/daemon/db/libgsignond-db.la \
$(GSIGNOND_LIBS) \
- $(CHECK_LIBS)
\ No newline at end of file
+ $(CHECK_LIBS)
TESTS = digestplugintest passwordplugintest pluginproxytest
-TESTS_ENVIRONMENT= SSO_PLUGINS_DIR=$(top_builddir)/src/plugins/password/.libs
-
+TESTS_ENVIRONMENT= SSO_PLUGINS_DIR=$(top_builddir)/src/plugins/.libs
+VALGRIND_TESTS_DISABLE =
+include $(top_srcdir)/test/valgrind_common.mk
+
check_PROGRAMS = digestplugintest passwordplugintest pluginproxytest
digestplugintest_SOURCES = digestplugintest.c
digestplugintest_CFLAGS = \
$(top_builddir)/src/daemon/plugins/libgsignond-plugins.la \
$(GSIGNOND_LIBS) \
$(CHECK_LIBS)
-
+
+
+
--- /dev/null
+{
+<insert_a_suppression_name_here>
+Memcheck:Leak
+...
+fun:g_type_init_with_debug_flags
+}
+{
+<insert_a_suppression_name_here>
+Memcheck:Leak
+fun:malloc
+fun:getdelim
+fun:init_lib
+fun:call_init
+fun:_dl_init
+obj:/lib64/ld-2.15.so
+}
+{
+<insert_a_suppression_name_here>
+Memcheck:Leak
+fun:malloc
+...
+fun:g_type_add_interface_static
+}
+{
+<insert_a_suppression_name_here>
+Memcheck:Leak
+fun:malloc
+...
+fun:g_type_add_interface_dynamic
+}
+{
+<insert_a_suppression_name_here>
+Memcheck:Leak
+...
+fun:g_type_register_static
+}
+{
+<insert_a_suppression_name_here>
+Memcheck:Leak
+...
+fun:g_type_register_dynamic
+}
+{
+<insert_a_suppression_name_here>
+Memcheck:Leak
+...
+fun:g_type_class_ref
+}
+{
+<insert_a_suppression_name_here>
+Memcheck:Leak
+...
+fun:g_resolver_lookup_by_name_async
+}
+
+
--- /dev/null
+SUPPRESSIONS = $(top_srcdir)/test/valgrind.supp
+
+%.valgrind: %
+ @$(TESTS_ENVIRONMENT) \
+ CK_FORK=no \
+ CK_DEFAULT_TIMEOUT=120 \
+ G_SLICE=always-malloc \
+ $(LIBTOOL) --mode=execute \
+ valgrind -q \
+ $(foreach s,$(SUPPRESSIONS),--suppressions=$(s)) \
+ --tool=memcheck --leak-check=full --trace-children=yes \
+ --leak-resolution=high --num-callers=20 \
+ --error-exitcode=1 \
+ ./$*
+
+valgrind: $(TESTS)
+ for t in $(filter-out $(VALGRIND_TESTS_DISABLE),$(TESTS)); do \
+ $(MAKE) $$t.valgrind; \
+ done;
+
+