1
Last-Update: 2014-10-30
3
Author: Dmitry Smirnov <onlyjob@member.fsf.org>
4
Description: use system "libgtest" instead of bundled one.
5
This patch may be incomplete as it causes FTBFS in tests:
7
g++ -DHAVE_CONFIG_H -I. -D__CEPH__ -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D_THREAD_SAFE -D__STDC_FORMAT_MACROS -D_GNU_SOURCE -DCEPH_LIBDIR=\"/usr/lib/x86_64-linux-gnu\" -DCEPH_PKGLIBDIR=\"/usr/lib/x86_64-linux-gnu/ceph\" -DGTEST_HAS_TR1_TUPLE=0 -D_FORTIFY_SOURCE=2 -I/usr/include/nss -I/usr/include/nspr -Wall -Wtype-limits -Wignored-qualifiers -Winit-self -Wpointer-arith -Werror=format-security -fno-strict-aliasing -fsigned-char -rdynamic -ftemplate-depth-1024 -Wnon-virtual-dtor -Wno-invalid-offsetof -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -Wstrict-null-sentinel -I../src/gtest/include -I../src/gtest/include -g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -c -o test/unittest_str_list-test_str_list.o `test -f 'test/test_str_list.cc' || echo './'`test/test_str_list.cc
8
In file included from test/osd/TestOSDMap.cc:2:0:
9
/usr/include/gtest/gtest.h: In instantiation of ‘testing::AssertionResult testing::internal::CmpHelperEQ(const char*, const char*, const T1&, const T2&) [with T1 = int; T2 = char [41]]’:
10
/usr/include/gtest/gtest.h:1525:30: required from ‘static testing::AssertionResult testing::internal::EqHelper<true>::Compare(const char*, const char*, const T1&, const T2&, typename testing::internal::EnableIf<(! testing::internal::is_pointer<T2>::value)>::type*) [with T1 = int; T2 = char [41]; typename testing::internal::EnableIf<(! testing::internal::is_pointer<T2>::value)>::type = void]’
11
test/osd/TestOSDMap.cc:309:280: required from here
12
/usr/include/gtest/gtest.h:1448:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
13
if (expected == actual) {
15
Makefile:16560: recipe for target 'test/osd/unittest_osdmap-TestOSDMap.o' failed
16
make[6] *** [test/osd/unittest_osdmap-TestOSDMap.o] Error 1
21
include Makefile-env.am
23
SUBDIRS += ocf java tracing
24
-DIST_SUBDIRS += gtest ocf libs3 java tracing
25
+DIST_SUBDIRS += ocf libs3 java tracing
33
AC_MSG_NOTICE([RPM_RELEASE='$RPM_RELEASE'])
35
AC_CONFIG_MACRO_DIR([m4])
37
-AC_CONFIG_SUBDIRS([src/gtest])
38
+#AC_CONFIG_SUBDIRS([src/gtest])
48
# We need gtest to build the rados-api tests. We only build those in
49
# a debug build, though.
50
- @cd src/gtest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.a lib/libgtest_main.a
51
+# @cd src/gtest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.a lib/libgtest_main.a
52
+ cd src/gtest && cmake . && $(MAKE) $(AM_MAKEFLAGS)
56
# We build gtest this way, instead of using SUBDIRS, because with that,
57
# gtest's own tests would be run and that would slow us down.
58
- @cd src/gtest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.a lib/libgtest_main.a
59
+# @cd src/gtest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.a lib/libgtest_main.a
60
+ cd src/gtest && cmake . && $(MAKE) $(AM_MAKEFLAGS)
62
$(srcdir)/src/test/run-cli-tests '$(top_builddir)/src/test'
64
# "make distclean" both runs this and recurses into src/gtest, if
65
--- a/src/test/Makefile.am
66
+++ b/src/test/Makefile.am
69
-I$(top_srcdir)/src/gtest/include \
70
-I$(top_builddir)/src/gtest/include
72
- $(top_builddir)/src/gtest/lib/libgtest.a \
73
- $(top_builddir)/src/gtest/lib/libgtest_main.a \
74
+ $(top_builddir)/src/gtest/libgtest.a \
75
+ $(top_builddir)/src/gtest/libgtest_main.a \
78
unittest_encoding_SOURCES = test/encoding.cc
79
unittest_encoding_LDADD = $(LIBCEPHFS) $(LIBRADOS) -lm $(UNITTEST_LDADD)