summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2009-07-23 15:16:11 -0400
committerStephen Gallagher <sgallagh@redhat.com>2009-08-10 10:35:09 -0400
commit00aa07816bfd4305ac94780a8c2b9e6609be39ea (patch)
tree92b03907bf39c825f41f464f244c0b55a2d0b9ec
parent11c621b5ee1a0cdc27610f8b172017764acc285e (diff)
downloadsssd-00aa07816bfd4305ac94780a8c2b9e6609be39ea.tar.gz
sssd-00aa07816bfd4305ac94780a8c2b9e6609be39ea.tar.bz2
sssd-00aa07816bfd4305ac94780a8c2b9e6609be39ea.zip
Build and run tests with 'make check'
When --enable-tests is set by configure, the sysdb, stress and resolver tests will be built by 'make check', which will also then run the sysdb and resolver tests automatically. This patch also updates the server Makefile to create a libtool convenience library of the common source files to spare them being built separately for every library/executable that has different CFLAGS.
-rw-r--r--server/Makefile.am32
-rw-r--r--server/configure.ac6
2 files changed, 11 insertions, 27 deletions
diff --git a/server/Makefile.am b/server/Makefile.am
index 4398259b..4b3eec2f 100644
--- a/server/Makefile.am
+++ b/server/Makefile.am
@@ -50,10 +50,12 @@ sssdlibexec_PROGRAMS = \
$(sssd_info)
if BUILD_TESTS
-noinst_PROGRAMS = \
+check_PROGRAMS = \
sysdb-tests \
stress-tests \
resolv-tests
+
+TESTS = sysdb-tests resolv-tests
endif
sssdlib_LTLIBRARIES = \
@@ -68,6 +70,7 @@ krb5plugin_LTLIBRARIES = \
sssd_krb5_locator_plugin.la
noinst_LTLIBRARIES = \
+ libsss_util.la \
libsss_crypt.la
libsss_crypt_la_SOURCES = \
util/nss_sha512crypt.c
@@ -122,7 +125,7 @@ EXTRA_DIST = build/config.rpath
SSSD_DEBUG_OBJ = \
util/debug.c
-SSSD_UTIL_OBJ = \
+libsss_util_la_SOURCES = \
confdb/confdb.c \
db/sysdb.c \
db/sysdb_ops.c \
@@ -172,6 +175,7 @@ SSSD_LIBS = \
$(COLLECTION_LIBS) \
$(REPLACE_LIBS) \
$(NSS_LIBS) \
+ libsss_util.la \
libsss_crypt.la
dist_noinst_HEADERS = \
@@ -218,8 +222,7 @@ dist_noinst_HEADERS = \
####################
sssd_SOURCES = \
monitor/monitor.c \
- confdb/confdb_setup.c \
- $(SSSD_UTIL_OBJ)
+ confdb/confdb_setup.c
sssd_LDADD = \
$(SSSD_LIBS)
@@ -228,7 +231,6 @@ sssd_nss_SOURCES = \
responder/nss/nsssrv_cmd.c \
responder/nss/nsssrv_dp.c \
responder/nss/nsssrv_nc.c \
- $(SSSD_UTIL_OBJ) \
$(SSSD_RESPONDER_OBJ)
sssd_nss_LDADD = \
$(SSSD_LIBS)
@@ -239,20 +241,17 @@ sssd_pam_SOURCES = \
responder/pam/pamsrv_cache.c \
responder/pam/pamsrv_cmd.c \
responder/pam/pamsrv_dp.c \
- $(SSSD_UTIL_OBJ) \
$(SSSD_RESPONDER_OBJ)
sssd_pam_LDADD = \
$(SSSD_LIBS)
sssd_dp_SOURCES = \
- providers/data_provider.c\
- $(SSSD_UTIL_OBJ)
+ providers/data_provider.c
sssd_dp_LDADD = $(SSSD_LIBS)
sssd_be_SOURCES = \
- providers/data_provider_be.c \
- $(SSSD_UTIL_OBJ)
+ providers/data_provider_be.c
sssd_be_LDADD = $(SSSD_LIBS)
sssd_be_LDFLAGS = \
-Wl,--version-script,$(srcdir)/providers/sssd_be.exports \
@@ -270,42 +269,36 @@ dist_noinst_DATA = \
######################
sss_useradd_SOURCES = \
tools/sss_useradd.c \
- $(SSSD_UTIL_OBJ) \
$(SSSD_TOOLS_OBJ)
sss_useradd_LDADD = \
$(SSSD_LIBS)
sss_userdel_SOURCES = \
tools/sss_userdel.c \
- $(SSSD_UTIL_OBJ) \
$(SSSD_TOOLS_OBJ)
sss_userdel_LDADD = \
$(SSSD_LIBS)
sss_groupadd_SOURCES = \
tools/sss_groupadd.c \
- $(SSSD_UTIL_OBJ) \
$(SSSD_TOOLS_OBJ)
sss_groupadd_LDADD = \
$(SSSD_LIBS)
sss_groupdel_SOURCES = \
tools/sss_groupdel.c \
- $(SSSD_UTIL_OBJ) \
$(SSSD_TOOLS_OBJ)
sss_groupdel_LDADD = \
$(SSSD_LIBS)
sss_usermod_SOURCES = \
tools/sss_usermod.c \
- $(SSSD_UTIL_OBJ) \
$(SSSD_TOOLS_OBJ)
sss_usermod_LDADD = \
$(SSSD_LIBS)
sss_groupmod_SOURCES = \
tools/sss_groupmod.c \
- $(SSSD_UTIL_OBJ) \
$(SSSD_TOOLS_OBJ)
sss_groupmod_LDADD = \
$(SSSD_LIBS)
@@ -315,8 +308,7 @@ sss_groupmod_LDADD = \
#################
if BUILD_TESTS
sysdb_tests_SOURCES = \
- tests/sysdb-tests.c \
- $(SSSD_UTIL_OBJ)
+ tests/sysdb-tests.c
sysdb_tests_CFLAGS = \
$(CHECK_CFLAGS)
sysdb_tests_LDADD = \
@@ -324,14 +316,12 @@ sysdb_tests_LDADD = \
$(CHECK_LIBS)
stress_tests_SOURCES = \
- tests/stress-tests.c \
- $(SSSD_UTIL_OBJ)
+ tests/stress-tests.c
stress_tests_LDADD = \
$(SSSD_LIBS)
resolv_tests_SOURCES = \
tests/resolv-tests.c \
- $(SSSD_UTIL_OBJ) \
$(SSSD_RESOLV_OBJ)
resolv_tests_CFLAGS = \
$(CHECK_CFLAGS)
diff --git a/server/configure.ac b/server/configure.ac
index 5a9888ba..1abaa15c 100644
--- a/server/configure.ac
+++ b/server/configure.ac
@@ -31,9 +31,6 @@ AM_CONDITIONAL([HAVE_GCC], [test "$ac_cv_prog_gcc" = yes])
AC_CHECK_HEADERS(stdint.h dlfcn.h)
AC_CONFIG_HEADER(config.h)
-TESTS=""
-EXTRA_OBJ=""
-
m4_include([build_macros.m4])
BUILD_WITH_SHARED_BUILD_DIR
@@ -80,9 +77,6 @@ if test x$HAVE_MANPAGES != x; then
AC_PATH_PROG([XMLLINT], [xmllint])
fi
-AC_SUBST(TESTS)
-AC_SUBST(EXTRA_OBJ)
-
AC_CHECK_HEADERS([sys/inotify.h])
AC_CONFIG_FILES([Makefile po/Makefile.in])