]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
configure: add cmocka for unit tests
authorIker Pedrosa <ipedrosa@redhat.com>
Thu, 14 Sep 2023 10:13:21 +0000 (12:13 +0200)
committerIker Pedrosa <ikerpedrosam@gmail.com>
Fri, 29 Sep 2023 07:24:01 +0000 (09:24 +0200)
Prepare the ground for unit tests.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
configure.ac

index 7d21303819ae00ce05531e8e6633381dfee330aa..d76bde3ea0868e8e8f798295ec92f87310944bbf 100644 (file)
@@ -719,6 +719,10 @@ if test "$with_skey" = "yes"; then
        ]])],[AC_DEFINE(SKEY_BSD_STYLE, 1, [Define to support newer BSD S/Key API])],[])
 fi
 
+PKG_CHECK_MODULES([CMOCKA], [cmocka], [have_cmocka="yes"],
+       [AC_MSG_WARN([libcmocka not found, cmocka tests will not be built])])
+AM_CONDITIONAL([HAVE_CMOCKA], [test x$have_cmocka = xyes])
+
 AC_CHECK_FUNC(fgetpwent_r, [AC_DEFINE(HAVE_FGETPWENT_R, 1, [Defined to 1 if you have the declaration of 'fgetpwent_r'])])
 
 AC_DEFINE_UNQUOTED(SHELL, ["$SHELL"], [The default shell.])
@@ -762,6 +766,7 @@ AC_CONFIG_FILES([
        etc/pam.d/Makefile
        etc/shadow-maint/Makefile
        shadow.spec
+       tests/unit/Makefile
 ])
 AC_OUTPUT