From 6224e878cdf780360b49760c4b0c20584bbc0b6f Mon Sep 17 00:00:00 2001 From: Luis Pabon Date: Sun, 16 Mar 2014 23:07:19 -0400 Subject: 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 Reviewed-on: http://review.gluster.org/7281 Reviewed-by: Justin Clift Tested-by: Gluster Build System Reviewed-by: Harshavardhana Reviewed-by: Niels de Vos Reviewed-by: Anand Avati --- .gitmodules | 3 --- Makefile.am | 2 +- autogen.sh | 6 ------ cmockery2 | 1 - configure.ac | 12 ------------ glusterfs.spec.in | 7 ------- libglusterfs/src/Makefile.am | 17 ----------------- libglusterfs/src/mem-pool.c | 9 --------- xlators/cluster/dht/src/Makefile.am | 15 --------------- xlators/cluster/dht/src/dht-layout.c | 21 --------------------- 10 files changed, 1 insertion(+), 92 deletions(-) delete mode 100644 .gitmodules delete mode 160000 cmockery2 diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 58165fe0a..000000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "cmockery2"] - path = cmockery2 - url = https://github.com/lpabon/cmockery2.git diff --git a/Makefile.am b/Makefile.am index 815d6ad3e..598ebb410 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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@ diff --git a/autogen.sh b/autogen.sh index 221cc2b78..8642deba2 100755 --- a/autogen.sh +++ b/autogen.sh @@ -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 diff --git a/cmockery2 b/cmockery2 deleted file mode 160000 index 4eb53ab96..000000000 --- a/cmockery2 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4eb53ab96fd2b227fbf68c40bcc8d915b48213b9 diff --git a/configure.ac b/configure.ac index 3e34673f5..d3f5c1b18 100644 --- a/configure.ac +++ b/configure.ac @@ -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) diff --git a/glusterfs.spec.in b/glusterfs.spec.in index 4ed1a75ed..f3038eaa4 100644 --- a/glusterfs.spec.in +++ b/glusterfs.spec.in @@ -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 diff --git a/libglusterfs/src/Makefile.am b/libglusterfs/src/Makefile.am index ac6a3b9ec..634e217ed 100644 --- a/libglusterfs/src/Makefile.am +++ b/libglusterfs/src/Makefile.am @@ -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 diff --git a/libglusterfs/src/mem-pool.c b/libglusterfs/src/mem-pool.c index 96e049105..b92803d4d 100644 --- a/libglusterfs/src/mem-pool.c +++ b/libglusterfs/src/mem-pool.c @@ -24,24 +24,17 @@ #define GLUSTERFS_ENV_MEM_ACCT_STR "GLUSTERFS_DISABLE_MEM_ACCT" -#include -#include - 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; diff --git a/xlators/cluster/dht/src/Makefile.am b/xlators/cluster/dht/src/Makefile.am index 3032705b5..174bea841 100644 --- a/xlators/cluster/dht/src/Makefile.am +++ b/xlators/cluster/dht/src/Makefile.am @@ -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 diff --git a/xlators/cluster/dht/src/dht-layout.c b/xlators/cluster/dht/src/dht-layout.c index deaa493f9..e1a37b77c 100644 --- a/xlators/cluster/dht/src/dht-layout.c +++ b/xlators/cluster/dht/src/dht-layout.c @@ -25,29 +25,12 @@ #define layout_size(cnt) (layout_base_size + (cnt * layout_entry_size)) -#include -#include - -// 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; } -- cgit