sed -i -e "s#@buildman@#bcond_without#g" $@-t
else
sed -i -e "s#@buildman@#bcond_with#g" $@-t
+endif
+if INSTALL_TESTS
+ sed -i -e "s#@installtests@#bcond_without#g" $@-t
+else
+ sed -i -e "s#@installtests@#bcond_with#g" $@-t
endif
sed -i -e "s#@defaultadmgroup@#$(DEFAULTADMGROUP)#g" $@-t
chmod a-w $@-t
[AC_MSG_ERROR(["missing required bzlib.h"])])])
])
+AC_ARG_ENABLE([install-tests],
+ [AS_HELP_STRING([--enable-install-tests],[install tests])],,
+ [ enable_install_tests="no" ])
+AM_CONDITIONAL([INSTALL_TESTS], [test x$enable_install_tests = xyes])
+
AC_ARG_ENABLE([poc],
[AS_HELP_STRING([--enable-poc],[enable building poc code])],,
[ enable_poc="no" ])
AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug],[enable debug build])])
+AC_ARG_WITH([testdir],
+ [AS_HELP_STRING([--with-testdir=DIR],[path to /usr/lib../kronosnet/tests/ dir where to install the test suite])],
+ [ TESTDIR="$withval" ],
+ [ TESTDIR="$libdir/kronosnet/tests" ])
+
AC_ARG_WITH([initdefaultdir],
[AS_HELP_STRING([--with-initdefaultdir=DIR],[path to /etc/sysconfig or /etc/default dir])],
[ INITDEFAULTDIR="$withval" ],
## do subst
+AC_SUBST([TESTDIR])
AC_SUBST([DEFAULT_CONFIG_DIR])
AC_SUBST([INITDEFAULTDIR])
AC_SUBST([INITDDIR])
%@rpmdebuginfo@ rpmdebuginfo
%@overriderpmdebuginfo@ overriderpmdebuginfo
%@buildman@ buildman
+%@installtests@ installtests
%if %{with overriderpmdebuginfo}
%undefine _enable_debug_packages
%if %{with buildman}
%global buildmanpages 1
%endif
+%if %{with installtests}
+%global installtestsuite 1
+%endif
# main (empty) package
# http://www.rpm.org/max-rpm/s1-rpm-subpack-spec-file-changes.html
%endif
%{configure} \
+%if %{defined installtestsuite}
+ --enable-install-tests \
+%else
+ --disable-install-tests \
+%endif
%if %{defined buildmanpages}
--enable-man \
%else
%files -n libknet1-plugins-all
+%if %{with installtests}
+%package -n kronosnet-tests
+Group: System Environment/Libraries
+Summary: kronosnet test suite
+
+%description -n kronosnet-tests
+ this package contains all the libknet and libnozzle test suite
+
+%files -n kronosnet-tests
+%defattr(-,root,root,-)
+%{_libdir}/kronosnet/tests/*
+%endif
+
%if %{with rpmdebuginfo}
%debug_package
%endif
TESTS = $(check_PROGRAMS)
+if INSTALL_TESTS
+testsuitedir = $(TESTDIR)
+testsuite_PROGRAMS = $(noinst_PROGRAMS)
+endif
+
check-local: check-api-test-coverage
check-api-test-coverage:
TESTS = $(check_PROGRAMS)
+if INSTALL_TESTS
+testsuitedir = $(TESTDIR)
+testsuite_PROGRAMS = $(noinst_PROGRAMS)
+endif
+
check-local: check-api-test-coverage
check-api-test-coverage: