build: require cmocka >= 1.0.1

Our mem-pool unit test does a funky realloc(ptr, 0) as an alternative to
free(ptr). cmocka 1.0.0 has a bug where this is not handled correctly
and thinks to detect a memory leak. The next cmocka release will have
this bug fixed, making our unit tests require cmocka >= 1.0.1.

URL: https://cmocka.org/archive/cmocka/2015-02/0000059.html
Change-Id: I3d7f9b4cf7ace3f958158425ecbcc8f176579122
BUG: 1067059
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/9801
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Andreas Schneider <asn@fedoraproject.org>
Tested-by: Andreas Schneider <asn@fedoraproject.org>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
This commit is contained in:
Niels de Vos 2015-03-03 00:27:34 +01:00 committed by Kaleb KEITHLEY
parent 6df8d1d878
commit 9c37b68bc1
2 changed files with 5 additions and 10 deletions

View File

@ -1196,14 +1196,9 @@ AC_ARG_ENABLE([cmocka],
[Enable cmocka build options.]))
if test "x$enable_cmocka" = "xyes"; then
BUILD_UNITTEST="yes"
PKG_CHECK_MODULES([UNITTEST], [cmocka], [],[
AC_CHECK_LIB([cmocka], [mock_assert], [
UNITTEST_LDFLAGS="-lcmocka -lgcov"
UNITTEST_CFLAGS="-Wall -Werror"
], [
AC_MSG_ERROR([cmocka library is required to build glusterfs])
])
])
PKG_CHECK_MODULES([UNITTEST], [cmocka >= 1.0.1], [BUILD_UNITTEST="yes"],
[AC_MSG_ERROR([cmocka library is required to build glusterfs])]
)
fi
AM_CONDITIONAL([UNITTEST], [test x$BUILD_UNITTEST = xyes])

View File

@ -204,8 +204,8 @@ BuildRequires: libaio-devel libacl-devel
BuildRequires: python-devel
BuildRequires: python-ctypes
BuildRequires: userspace-rcu-devel >= 0.7
%if ( 0%{?_with_cmocka:0} )
BuildRequires: libcmocka-devel >= 1.0.0
%if ( 0%{?_with_cmocka:1} )
BuildRequires: libcmocka-devel >= 1.0.1
%endif
BuildRequires: sqlite-devel
%if ( 0%{!?_without_systemtap:1} )