diff --git a/Makefile.am b/Makefile.am index 91cda02..ee6e39b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -19,15 +19,7 @@ if HAVE_MANPAGES SUBDIRS += src/man endif -# The cwrap tests require the wrapper libraries and are written -# using cmocka -if HAVE_CMOCKA -if HAVE_NSS_WRAPPER -if HAVE_UID_WRAPPER -SUBDIRS += src/tests/cwrap -endif # HAVE_UID_WRAPPER -endif # HAVE_NSS_WRAPPER -endif # HAVE_CMOCKA +SUBDIRS += . src/tests/cwrap # Some old versions of automake don't define builddir builddir ?= . diff --git a/src/man/Makefile.am b/src/man/Makefile.am index f8e8f81..a92ac0d 100644 --- a/src/man/Makefile.am +++ b/src/man/Makefile.am @@ -218,5 +218,3 @@ uninstall-local-yes: man_MANS="$$manpages"; \ fi \ done - -tests: diff --git a/src/tests/cwrap/Makefile.am b/src/tests/cwrap/Makefile.am index 3bf2ff9..34aec92 100644 --- a/src/tests/cwrap/Makefile.am +++ b/src/tests/cwrap/Makefile.am @@ -1,4 +1,3 @@ - AM_CPPFLAGS = \ -Wall \ -I$(top_srcdir)/src \ @@ -6,28 +5,31 @@ AM_CPPFLAGS = \ $(DBUS_CFLAGS) \ $(NULL) -AM_TESTS_ENVIRONMENT = \ - SSSD_SRCDIR=$(top_srcdir) \ - . $(top_srcdir)/src/tests/cwrap/cwrap_test_setup.sh; \ +TESTS_ENVIRONMENT = \ + CWRAP_TEST_SRCDIR=$(abs_srcdir) \ + . $(srcdir)/cwrap_test_setup.sh; \ + $(AUX_TESTS_ENVIRONMENT) \ $(NULL) -check_PROGRAMS = \ - become_user-tests \ - $(NULL) +dist_noinst_SCRIPTS = \ + cwrap_test_setup.sh \ + $(NULL) -check_LTLIBRARIES = \ - libsss_test_common.la +dist_noinst_DATA = \ + group \ + passwd \ + $(NULL) -TESTS = $(check_PROGRAMS) +check_PROGRAMS = +if HAVE_CMOCKA +if HAVE_NSS_WRAPPER +if HAVE_UID_WRAPPER +check_PROGRAMS += become_user-tests +endif # HAVE_UID_WRAPPER +endif # HAVE_NSS_WRAPPER +endif # HAVE_CMOCKA -libsss_test_common_la_SOURCES = \ - ../common_tev.c \ - ../common_dom.c \ - ../leak_check.c \ - ../common.c -libsss_test_common_la_LIBADD = \ - $(TALLOC_LIBS) \ - $(TEVENT_LIBS) +TESTS = $(check_PROGRAMS) become_user_tests_SOURCES = \ test_become_user.c \ @@ -39,7 +41,7 @@ become_user_tests_LDADD = \ $(POPT_LIBS) \ $(CMOCKA_LIBS) \ $(abs_top_builddir)/libsss_debug.la \ - libsss_test_common.la \ + $(abs_top_builddir)/libsss_test_common.la \ $(NULL) tests: $(check_PROGRAMS) diff --git a/src/tests/cwrap/cwrap_test_setup.sh b/src/tests/cwrap/cwrap_test_setup.sh index d5ddffb..0d35cb7 100755 --- a/src/tests/cwrap/cwrap_test_setup.sh +++ b/src/tests/cwrap/cwrap_test_setup.sh @@ -11,7 +11,7 @@ if [ -z $nss_wrapper -o -z $uid_wrapper ]; then fi export LD_PRELOAD="$nss_wrapper $uid_wrapper" -export NSS_WRAPPER_PASSWD=$SSSD_SRCDIR/src/tests/cwrap/passwd -export NSS_WRAPPER_GROUP=$SSSD_SRCDIR/src/tests/cwrap/group +export NSS_WRAPPER_PASSWD=$CWRAP_TEST_SRCDIR/passwd +export NSS_WRAPPER_GROUP=$CWRAP_TEST_SRCDIR/group export UID_WRAPPER=1 export UID_WRAPPER_ROOT=1