]> git.pld-linux.org Git - packages/protobuf.git/blame - system-gtest.patch
- up to 3.12.1; soname change
[packages/protobuf.git] / system-gtest.patch
CommitLineData
c19d590f
JB
1--- protobuf-3.6.1/Makefile.am.orig 2018-10-12 17:44:11.446510724 +0200
2+++ protobuf-3.6.1/Makefile.am 2018-10-12 17:46:58.769842145 +0200
8a85b52c 3@@ -11,28 +11,8 @@
c19d590f
JB
4 # Always include third_party directories in distributions.
5 DIST_SUBDIRS = src conformance benchmarks third_party/googletest
0759da77 6
8a85b52c
JB
7-# Build gmock before we build protobuf tests. We don't add gmock to SUBDIRS
8-# because then "make check" would also build and run all of gmock's own tests,
0759da77 9-# which takes a lot of time and is generally not useful to us. Also, we don't
8a85b52c
JB
10-# want "make install" to recurse into gmock since we don't want to overwrite
11-# the installed version of gmock if there is one.
0759da77 12-check-local:
8a85b52c 13- @echo "Making lib/libgmock.a lib/libgmock_main.a in gmock"
c19d590f
JB
14- @cd third_party/googletest/googletest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.la lib/libgtest_main.la
15- @cd third_party/googletest/googlemock && $(MAKE) $(AM_MAKEFLAGS) lib/libgmock.la lib/libgmock_main.la
0759da77 16-
8a85b52c 17-# We would like to clean gmock when "make clean" is invoked. But we have to
0759da77 18-# be careful because clean-local is also invoked during "make distclean", but
8a85b52c
JB
19-# "make distclean" already recurses into gmock because it's listed among the
20-# DIST_SUBDIRS. distclean will delete gmock/Makefile, so if we then try to
0759da77
ER
21-# cd to the directory again and "make clean" it will fail. So, check that the
22-# Makefile exists before recursing.
8a85b52c 23 clean-local:
c19d590f
JB
24- @if test -e third_party/googletest/Makefile; then \
25- echo "Making clean in googletest"; \
26- cd third_party/googletest && $(MAKE) $(AM_MAKEFLAGS) clean; \
8a85b52c
JB
27- fi; \
28- if test -e conformance/Makefile; then \
29+ @if test -e conformance/Makefile; then \
30 echo "Making clean in conformance"; \
31 cd conformance && $(MAKE) $(AM_MAKEFLAGS) clean; \
32 fi; \
c19d590f
JB
33--- protobuf-3.6.1/src/Makefile.am.orig 2018-10-12 17:44:11.446510724 +0200
34+++ protobuf-3.6.1/src/Makefile.am 2018-10-12 18:23:32.609817094 +0200
35@@ -692,19 +692,24 @@
8a85b52c
JB
36 google/protobuf/testing/file.cc \
37 google/protobuf/testing/file.h
0759da77 38
c19d590f
JB
39-GOOGLETEST_BUILD_DIR=../third_party/googletest/googletest
40-GOOGLEMOCK_BUILD_DIR=../third_party/googletest/googlemock
41-GOOGLETEST_SRC_DIR=$(srcdir)/../third_party/googletest/googletest
42-GOOGLEMOCK_SRC_DIR=$(srcdir)/../third_party/googletest/googlemock
8a85b52c
JB
43+gmock_dir = /usr/src/gmock/src
44+gmock_inc_dir = /usr/src/gmock/src
45+gtest_inc_dir = /usr/include/gtest
46+check_LTLIBRARIES = libgmock.la libgmock_main.la
47+libgmock_la_SOURCES = ./gmock-all.cc
48+libgmock_main_la_SOURCES = ./gmock_main.cc
49+
c19d590f
JB
50+GOOGLETEST_INC_DIR=/usr/include/gtest
51+GOOGLEMOCK_INC_DIR=/usr/src/gmock/src
0759da77 52 check_PROGRAMS = protoc protobuf-test protobuf-lazy-descriptor-test \
8a85b52c
JB
53 protobuf-lite-test test_plugin protobuf-lite-arena-test \
54 no-warning-test $(GZCHECKPROGRAMS)
0759da77 55 protobuf_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
c19d590f
JB
56- $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la \
57- $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la \
58- $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
59-protobuf_test_CPPFLAGS = -I$(GOOGLETEST_SRC_DIR)/include \
60- -I$(GOOGLEMOCK_SRC_DIR)/include
61+ -lgtest \
62+ libgmock_main.la \
8a85b52c 63+ libgmock.la
c19d590f
JB
64+protobuf_test_CPPFLAGS = -I$(GOOGLETEST_INC_DIR) \
65+ -I$(GOOGLEMOCK_INC_DIR)
0759da77
ER
66 # Disable optimization for tests unless the user explicitly asked for it,
67 # since test_util.cc takes forever to compile with optimization (with GCC).
68 # See configure.ac for more info.
c19d590f 69@@ -792,11 +797,11 @@
0759da77
ER
70 # Run cpp_unittest again with PROTOBUF_TEST_NO_DESCRIPTORS defined.
71 protobuf_lazy_descriptor_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la \
72bc381c 72 libprotoc.la \
c19d590f
JB
73- $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la \
74- $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la \
75- $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
76-protobuf_lazy_descriptor_test_CPPFLAGS = -I$(GOOGLEMOCK_SRC_DIR)/include \
77- -I$(GOOGLETEST_SRC_DIR)/include \
78+ -lgtest \
79+ libgmock_main.la \
8a85b52c 80+ libgmock.la
c19d590f
JB
81+protobuf_lazy_descriptor_test_CPPFLAGS = -I$(GOOGLEMOCK_INC_DIR) \
82+ -I$(GOOGLETEST_INC_DIR) \
72bc381c 83 -DPROTOBUF_TEST_NO_DESCRIPTORS
0759da77
ER
84 protobuf_lazy_descriptor_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
85 protobuf_lazy_descriptor_test_SOURCES = \
c19d590f 86@@ -818,11 +823,11 @@
50af910a
JB
87 # full runtime and we want to make sure this test builds without full
88 # runtime.
c19d590f
JB
89 protobuf_lite_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la \
90- $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la \
91- $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la \
92- $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
93-protobuf_lite_test_CPPFLAGS= -I$(GOOGLEMOCK_SRC_DIR)/include \
94- -I$(GOOGLETEST_SRC_DIR)/include
95+ -lgtest \
96+ libgmock_main.la \
50af910a 97+ libgmock.la
c19d590f
JB
98+protobuf_lite_test_CPPFLAGS= -I$(GOOGLEMOCK_INC_DIR) \
99+ -I$(GOOGLETEST_INC_DIR)
50af910a 100 protobuf_lite_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
c19d590f
JB
101 protobuf_lite_test_SOURCES = \
102 google/protobuf/lite_unittest.cc \
103@@ -834,11 +839,11 @@
8a85b52c
JB
104 # gtest when building the test internally our memory sanitizer doesn't detect
105 # memory leaks (don't know why).
106 protobuf_lite_arena_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la \
c19d590f
JB
107- $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la \
108- $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la \
109- $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
110-protobuf_lite_arena_test_CPPFLAGS = -I$(GOOGLEMOCK_SRC_DIR)/include \
111- -I$(GOOGLETEST_SRC_DIR)/include
112+ -lgtest \
113+ libgmock_main.la \
8a85b52c 114+ libgmock.la
c19d590f
JB
115+protobuf_lite_arena_test_CPPFLAGS = -I$(GOOGLEMOCK_INC_DIR) \
116+ -I$(GOOGLETEST_INC_DIR)
8a85b52c
JB
117 protobuf_lite_arena_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
118 protobuf_lite_arena_test_SOURCES = \
119 google/protobuf/lite_arena_unittest.cc \
c19d590f 120@@ -848,8 +853,8 @@
0759da77
ER
121
122 # Test plugin binary.
123 test_plugin_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
c19d590f
JB
124- $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la
125-test_plugin_CPPFLAGS = -I$(GOOGLETEST_SRC_DIR)/include
0759da77 126+ -lgtest
c19d590f 127+test_plugin_CPPFLAGS = -I$(GOOGLETEST_INC_DIR)
0759da77 128 test_plugin_SOURCES = \
8a85b52c
JB
129 google/protobuf/compiler/mock_code_generator.cc \
130 google/protobuf/testing/file.cc \
This page took 0.046092 seconds and 4 git commands to generate.