build: Remove cmockery2 from repo

While we wait for cmockery2 to be available from Fedora,
we can remove cmockery2 from the repo.

BUG: 1077011

Change-Id: I75d462c607cd376a5d838ea83f4d12eb59757e73
Signed-off-by: Luis Pabon <lpabon@redhat.com>
Reviewed-on: http://review.gluster.org/7281
Reviewed-by: Justin Clift <justin@gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Harshavardhana <harsha@harshavardhana.net>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
This commit is contained in:
Luis Pabon 2014-03-16 23:07:19 -04:00 committed by Anand Avati
parent 9565ac3328
commit 6224e878cd
10 changed files with 1 additions and 92 deletions

3
.gitmodules vendored
View File

@ -1,3 +0,0 @@
[submodule "cmockery2"]
path = cmockery2
url = https://github.com/lpabon/cmockery2.git

View File

@ -6,7 +6,7 @@ EXTRA_DIST = autogen.sh \
gen-headers.py run-tests.sh \
$(shell find $(top_srcdir)/tests -type f -print)
SUBDIRS = argp-standalone cmockery2 libglusterfs rpc api xlators glusterfsd \
SUBDIRS = argp-standalone libglusterfs rpc api xlators glusterfsd \
$(FUSERMOUNT_SUBDIR) doc extras cli @SYNCDAEMON_SUBDIR@
pkgconfigdir = @pkgconfigdir@

View File

@ -106,15 +106,9 @@ $AUTOCONF
echo Running ${AUTOMAKE}...
$AUTOMAKE --add-missing --copy --foreign
# Update git modules
echo "Obtaining git module cmockery2 ..."
git submodule update --init cmockery2
# Run autogen in the argp-standalone sub-directory
echo "Running autogen.sh in argp-standalone ..."
( cd argp-standalone;./autogen.sh )
echo "Running autogen.sh in cmockery2 ..."
( cd cmockery2; ./autogen.sh )
# Instruct user on next steps
echo

@ -1 +0,0 @@
Subproject commit 4eb53ab96fd2b227fbf68c40bcc8d915b48213b9

View File

@ -636,18 +636,6 @@ AC_SUBST(HAVE_LINKAT)
dnl check for Monotonic clock
AC_CHECK_FUNC([clock_gettime], [has_monotonic_clock=yes], AC_CHECK_LIB([rt], [clock_gettime], , AC_MSG_WARN([System doesn't have monotonic clock using contrib])))
dnl Add cmockery2 for unit testing
AC_CONFIG_SUBDIRS([cmockery2])
UNITTEST_CFLAGS='-g -Wall -DUNIT_TESTING=1 -DDEBUG -Werror -O0 --coverage'
UNITTEST_CPPFLAGS='-I$(top_srcdir)/cmockery2/src'
UNITTEST_LDADD='$(top_builddir)/cmockery2/libcmockery.la'
UNITTEST_LDFLAGS=-lgcov
CFLAGS="$CFLAGS ${UNITTEST_CPPFLAGS}"
AC_SUBST(UNITTEST_CFLAGS)
AC_SUBST(UNITTEST_CPPFLAGS)
AC_SUBST(UNITTEST_LDADD)
AC_SUBST(UNITTEST_LDFLAGS)
dnl Check for argp
AC_CHECK_HEADER([argp.h], AC_DEFINE(HAVE_ARGP, 1, [have argp]))
AC_CONFIG_SUBDIRS(argp-standalone)

View File

@ -455,10 +455,6 @@ pushd api/examples
FLAGS="$RPM_OPT_FLAGS" python setup.py build
popd
%check
LD_LIBRARY_PATH=$PWD/cmockery2/.libs make check
%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot}
@ -677,9 +673,6 @@ rm -rf %{buildroot}
%exclude %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/encryption/rot-13*
%exclude %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/features/mac-compat*
%exclude %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/testing/performance/symlink-cache*
# exclude cmockery
%exclude %{_includedir}/cmockery*
%exclude %{_prefix}/share/doc/cmockery*
%post libs
/sbin/ldconfig

View File

@ -55,20 +55,3 @@ y.tab.h: graph.y
CLEANFILES = graph.lex.c y.tab.c y.tab.h
CONFIG_CLEAN_FILES = $(CONTRIB_BUILDDIR)/uuid/uuid_types.h
#### UNIT TESTS #####
CLEANFILES += *.gcda *.gcno *_xunit.xml
noinst_PROGRAMS =
TESTS =
mem_pool_unittest_CPPFLAGS = $(UNITTEST_CPPFLAGS) $(libglusterfs_la_CPPFLAGS)
mem_pool_unittest_SOURCES = mem-pool.c \
mem-pool.h \
unittest/mem_pool_unittest.c \
unittest/log_mock.c \
unittest/global_mock.c
mem_pool_unittest_CFLAGS = $(UNITTEST_CFLAGS)
mem_pool_unittest_LDADD = $(UNITTEST_LDADD)
mem_pool_unittest_LDFLAGS = $(UNITTEST_LDFLAGS)
noinst_PROGRAMS += mem_pool_unittest
TESTS += mem_pool_unittest

View File

@ -24,24 +24,17 @@
#define GLUSTERFS_ENV_MEM_ACCT_STR "GLUSTERFS_DISABLE_MEM_ACCT"
#include <cmockery/pbc.h>
#include <cmockery/cmockery_override.h>
void
gf_mem_acct_enable_set (void *data)
{
glusterfs_ctx_t *ctx = NULL;
REQUIRE(data != NULL);
ctx = data;
GF_ASSERT (ctx != NULL);
ctx->mem_acct_enable = 1;
ENSURE(1 == ctx->mem_acct_enable);
return;
}
@ -156,8 +149,6 @@ __gf_realloc (void *ptr, size_t size)
if (!THIS->ctx->mem_acct_enable)
return REALLOC (ptr, size);
REQUIRE(NULL != ptr);
tot_size = size + GF_MEM_HEADER_SIZE + GF_MEM_TRAILER_SIZE;
orig_ptr = (char *)ptr - 8 - 4;

View File

@ -36,18 +36,3 @@ uninstall-local:
install-data-hook:
ln -sf dht.so $(DESTDIR)$(xlatordir)/distribute.so
#### UNIT TESTS #####
CLEANFILES += *.gcda *.gcno *_xunit.xml
noinst_PROGRAMS =
TESTS =
dht_layout_unittest_CPPFLAGS = $(UNITTEST_CPPFLAGS) $(AM_CPPFLAGS)
dht_layout_unittest_SOURCES = unittest/dht_layout_unittest.c \
unittest/dht_layout_mock.c \
dht-layout.c
dht_layout_unittest_CFLAGS = $(UNITTEST_CFLAGS)
dht_layout_unittest_LDADD = $(UNITTEST_LDADD)
dht_layout_unittest_LDFLAGS = $(UNITTEST_LDFLAGS)
noinst_PROGRAMS += dht_layout_unittest
TESTS += dht_layout_unittest

View File

@ -25,29 +25,12 @@
#define layout_size(cnt) (layout_base_size + (cnt * layout_entry_size))
#include <cmockery/pbc.h>
#include <cmockery/cmockery_override.h>
// Change GF_CALLOC and GF_FREE to use
// cmockery2 memory allocation versions
#ifdef UNIT_TESTING
#undef GF_CALLOC
#define GF_CALLOC(n, s, t) test_calloc(n, s)
#undef GF_FREE
#define GF_FREE test_free
#endif
dht_layout_t *
dht_layout_new (xlator_t *this, int cnt)
{
dht_layout_t *layout = NULL;
dht_conf_t *conf = NULL;
REQUIRE(NULL != this);
REQUIRE(cnt >= 0);
conf = this->private;
layout = GF_CALLOC (1, layout_size (cnt),
@ -66,10 +49,6 @@ dht_layout_new (xlator_t *this, int cnt)
layout->ref = 1;
ENSURE(NULL != layout);
ENSURE(layout->type == DHT_HASH_TYPE_DM);
ENSURE(layout->cnt == cnt);
ENSURE(layout->ref == 1);
out:
return layout;
}