diff --git a/Makefile.am b/Makefile.am index 67139fae..9fc29bd9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -67,5 +67,9 @@ SUBDIRS = \ tests \ tools +if PERFORM_UNIT_TESTS +SUBDIRS += tests +endif + distclean-local: -rm -f xrdp_configure_options.h diff --git a/configure.ac b/configure.ac index afac52ab..b84b8c69 100644 --- a/configure.ac +++ b/configure.ac @@ -357,9 +357,20 @@ AC_CHECK_HEADER([X11/extensions/Xrandr.h], [], CFLAGS="$save_CFLAGS" -# checking for libcheck (used for unit testing) -PKG_CHECK_MODULES([CHECK], [check >= 0.10.0], [], - [AC_MSG_ERROR([please install check])]) +# perform unit tests if libcheck found +PKG_CHECK_MODULES([CHECK], [check >= 0.10.0], + [perform_unit_tests=yes], + [perform_unit_tests=no]) + +if test "x$perform_unit_tests" == "xyes"; then + AC_MSG_NOTICE([libcheck found, unit tests will be performed]) +else + AC_MSG_NOTICE([libcheck not found, unit tests will be skipped]) +fi + +AM_CONDITIONAL(PERFORM_UNIT_TESTS, + [test "x$perform_unit_tests" = "xyes"]) +# -- end perform unit tests AC_SUBST([moduledir], '${libdir}/xrdp') @@ -443,6 +454,8 @@ echo " libdir $libdir" echo " bindir $bindir" echo " sysconfdir $sysconfdir" echo "" +echo " perform unit tests $perform_unit_tests" +echo "" echo " CFLAGS = $CFLAGS" echo " LDFLAGS = $LDFLAGS"