Merge lp:~chasedouglas/grail/gtest-source into lp:grail

Proposed by Chase Douglas
Status: Merged
Merged at revision: 201
Proposed branch: lp:~chasedouglas/grail/gtest-source
Merge into: lp:grail
Prerequisite: lp:~chasedouglas/grail/fix-visibility
Diff against target: 208 lines (+83/-48)
6 files modified
.bzrignore (+3/-0)
Makefile.am (+2/-0)
configure.ac (+4/-13)
m4/gtest.m4 (+0/-27)
test/Makefile-xorg-gtest.am (+61/-0)
test/Makefile.am (+13/-8)
To merge this branch: bzr merge lp:~chasedouglas/grail/gtest-source
Reviewer Review Type Date Requested Status
Stephen M. Webb (community) Approve
Chase Douglas (community) Needs Resubmitting
Review via email: mp+98314@code.launchpad.net

Description of the change

This change switches the xorg-gtest build framework from a library linking mechanism to a local building mechanism. This is required due to upstream changes to gtest and xorg-gtest, where precompiled libraries are discouraged.

In order to test this, update xutils-dev to version 1:7.7~1 and libxorg-gtest-dev to version 2.0.0-0ubuntu1.

To post a comment you must log in.
lp:~chasedouglas/grail/gtest-source updated
206. By Chase Douglas

Merged fix-visibility into gtest-source.

Revision history for this message
Stephen M. Webb (bregma) wrote :

This does not not build for me as-is. In src/Makefile.am, the libraries listed in LIBADD are not linked in because LIBADD is not a standard variable picked up automatcally by libtool. The symptom is that later tests fail with missing evemu_ symbol errors.

To get the library to build properly I added the line

libutouch_grail_la_LIBADD = $(LIBADD)

review: Needs Fixing
lp:~chasedouglas/grail/gtest-source updated
207. By Chase Douglas

Merged fix-visibility into gtest-source.

Revision history for this message
Chase Douglas (chasedouglas) wrote :

This was a bug in the previous am-flags pipe. Since I hadn't merged it yet, I fixed it in that pipe and pumped it through to here.

I double checked that grail builds from source by cleaning my tree of all ignored files and building from scratch.

review: Needs Resubmitting
Revision history for this message
Stephen M. Webb (bregma) wrote :

Works nicely now. Pass.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2012-03-09 13:23:57 +0000
3+++ .bzrignore 2012-03-20 20:48:21 +0000
4@@ -18,6 +18,9 @@
5 m4/ltsugar.m4
6 m4/ltversion.m4
7 m4/lt~obsolete.m4
8+m4/pkg.m4
9+m4/xorg-gtest.m4
10+m4/xorg-macros.m4
11 Makefile
12 Makefile.in
13 stamp-h1
14
15=== modified file 'Makefile.am'
16--- Makefile.am 2012-02-15 16:31:09 +0000
17+++ Makefile.am 2012-03-20 20:48:21 +0000
18@@ -1,3 +1,5 @@
19+ACLOCAL_AMFLAGS = -I m4 --install
20+
21 SUBDIRS = src test tools
22
23 pkgconfigdir = $(libdir)/pkgconfig
24
25=== modified file 'configure.ac'
26--- configure.ac 2012-03-20 20:48:21 +0000
27+++ configure.ac 2012-03-20 20:48:21 +0000
28@@ -9,9 +9,6 @@
29 AC_CONFIG_AUX_DIR([config-aux])
30 AC_CONFIG_MACRO_DIR([m4])
31
32-m4_include([m4/gcov.m4])
33-m4_include([m4/gtest.m4])
34-
35 # Initialize Automake
36 AM_INIT_AUTOMAKE([foreign dist-bzip2])
37 AM_SILENT_RULES([yes])
38@@ -41,16 +38,10 @@
39 ])
40
41 # Check for TDD tools
42-AC_CHECK_GTEST
43-
44-AS_IF([test "x$have_gtest" = xyes],
45- [PKG_CHECK_MODULES(XORG_GTEST, xorg-gtest,
46- [have_xorg_gtest="yes"],
47- [AC_MSG_WARN([xorg-gtest not installed, tests will not be built])])],
48- [AC_MSG_WARN([gtest not installed, tests will not be build])]
49-)
50-
51-AM_CONDITIONAL([HAVE_GTEST], [test "x$have_xorg_gtest" = xyes])
52+CHECK_XORG_GTEST([AC_MSG_NOTICE([xorg-gtest is available, tests will be built])],
53+ [AC_MSG_WARN([xorg-gtest is not available, tests will not be built])])
54+
55+AM_CONDITIONAL([ENABLE_INTEGRATION_TESTS], [test "x$have_xorg_gtest" = xyes])
56
57 AC_SUBST([GTEST_LDFLAGS])
58 AC_SUBST([GTEST_CXXFLAGS])
59
60=== removed file 'm4/gtest.m4'
61--- m4/gtest.m4 2012-03-20 20:48:21 +0000
62+++ m4/gtest.m4 1970-01-01 00:00:00 +0000
63@@ -1,27 +0,0 @@
64-# Checks whether the gtest library is available on the system
65-# Allows for adjusting the include and library path.
66-# Sets have_gtest=yes if the library is present and
67-# reports the compiler and linker flags in
68-# GTEST_CXXFLAGS AND GTEST_LDFLAGS, respectively.
69-AC_DEFUN([AC_CHECK_GTEST],
70-[
71- AC_ARG_WITH([gtest-include-path],
72- [AS_HELP_STRING([--with-gtest-include-path],
73- [location of the Google test headers, defaults to /usr/include])],
74- [GTEST_CXXFLAGS="-I$withval"],
75- [GTEST_CXXFLAGS='-I/usr/include'])
76-
77- AC_ARG_WITH([gtest-lib-path],
78- [AS_HELP_STRING([--with-gtest-lib-path], [location of the Google test libraries])],
79- [GTEST_LDFLAGS="-L$withval -lpthread"],
80- [GTEST_LDFLAGS='-lgtest -lpthread'])
81-
82- AC_HAVE_LIBRARY( [gtest],
83- [have_gtest=yes],
84- AC_MSG_WARN([package 'gtest' not found: tests disabled]))
85-
86- AC_SUBST(GTEST_CXXFLAGS)
87- AC_SUBST(GTEST_LDFLAGS)
88-
89-]) # AC_CHECK_GTEST
90-
91
92=== added file 'test/Makefile-xorg-gtest.am'
93--- test/Makefile-xorg-gtest.am 1970-01-01 00:00:00 +0000
94+++ test/Makefile-xorg-gtest.am 2012-03-20 20:48:21 +0000
95@@ -0,0 +1,61 @@
96+# Copyright (C) 2012 Canonical, Ltd.
97+#
98+# Permission is hereby granted, free of charge, to any person obtaining a copy
99+# of this software and associated documentation files (the "Software"), to deal
100+# in the Software without restriction, including without limitation the rights
101+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
102+# copies of the Software, and to permit persons to whom the Software is
103+# furnished to do so, subject to the following conditions:
104+#
105+# The above copyright notice and this permission notice (including the next
106+# paragraph) shall be included in all copies or substantial portions of the
107+# Software.
108+#
109+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
110+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
111+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
112+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
113+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
114+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
115+# SOFTWARE.
116+#
117+
118+XORG_GTEST_BUILD_LIBS = \
119+ libgtest.a \
120+ libgtest_main.a \
121+ libxorg-gtest.a \
122+ libxorg-gtest_main.a
123+
124+nodist_libgtest_a_SOURCES = $(GTEST_SOURCE)/src/gtest-all.cc
125+libgtest_a_CPPFLAGS = $(GTEST_CPPFLAGS) $(AM_CPPFLAGS) -w
126+libgtest_a_CXXFLAGS = $(GTEST_CXXFLAGS) $(AM_CXXFLAGS)
127+
128+nodist_libgtest_main_a_SOURCES = $(GTEST_SOURCE)/src/gtest_main.cc
129+libgtest_main_a_CPPFLAGS = $(GTEST_CPPFLAGS) $(AM_CPPFLAGS) -w
130+libgtest_main_a_CXXFLAGS = $(GTEST_CXXFLAGS) $(AM_CXXFLAGS)
131+
132+nodist_libxorg_gtest_a_SOURCES = $(XORG_GTEST_SOURCE)/src/xorg-gtest-all.cpp
133+libxorg_gtest_a_CPPFLAGS = \
134+ $(XORG_GTEST_CPPFLAGS) \
135+ $(GTEST_CPPFLAGS) \
136+ $(AM_CPPFLAGS) \
137+ -w
138+libxorg_gtest_a_CXXFLAGS = \
139+ $(XORG_GTEST_CXXFLAGS) \
140+ $(GTEST_CXXFLAGS) \
141+ $(AM_CPPFLAGS)
142+
143+nodist_libxorg_gtest_main_a_SOURCES = \
144+ $(XORG_GTEST_SOURCE)/src/xorg-gtest_main.cpp
145+libxorg_gtest_main_a_CPPFLAGS = \
146+ $(XORG_GTEST_CPPFLAGS) \
147+ $(GTEST_CPPFLAGS) \
148+ $(AM_CPPFLAGS) \
149+ -w
150+libxorg_gtest_main_a_CXXFLAGS = \
151+ $(XORG_GTEST_CXXFLAGS) \
152+ $(GTEST_CXXFLAGS) \
153+ $(AM_CXXFLAGS)
154+
155+XORG_GTEST_LIBS = libxorg-gtest.a libgtest.a -lpthread $(X11_LIBS)
156+XORG_GTEST_MAIN_LIBS = libxorg-gtest_main.a
157
158=== modified file 'test/Makefile.am'
159--- test/Makefile.am 2012-03-20 20:48:21 +0000
160+++ test/Makefile.am 2012-03-20 20:48:21 +0000
161@@ -1,6 +1,9 @@
162 test_targets = test-c-compile test-cxx-compile
163
164-if HAVE_GTEST
165+if ENABLE_INTEGRATION_TESTS
166+include $(top_srcdir)/test/Makefile-xorg-gtest.am
167+check_LIBRARIES = $(XORG_GTEST_BUILD_LIBS)
168+
169 test_targets += check-grail
170 endif
171
172@@ -47,7 +50,8 @@
173 -I$(top_srcdir)/include \
174 -I../include \
175 $(WARNING_CPPFLAGS) \
176- $(GTEST_CPPFLAGS)
177+ $(GTEST_CPPFLAGS) \
178+ $(XORG_GTEST_CPPFLAGS)
179
180 AM_CFLAGS = \
181 $(COVERAGE_CFLAGS) \
182@@ -57,7 +61,7 @@
183 $(CXX11_CXXFLAGS) \
184 $(COVERAGE_CXXFLAGS) \
185 $(GTEST_CXXFLAGS) \
186- $(XORG_GTEST_CFLAGS) \
187+ $(XORG_GTEST_CXXFLAGS) \
188 $(FRAME_CFLAGS)
189
190 #
191@@ -66,11 +70,12 @@
192 #
193 check_grail_LDADD = \
194 $(top_builddir)/src/.libs/libutouch-grail.a \
195- $(EVEMU_LIBS) $(FRAME_LIBS) $(MTDEV_LIBS) $(COVERAGE_LIBS)
196-
197-if HAVE_GTEST
198-check_grail_LDADD += $(GTEST_LDFLAGS) -lxorg-gtest_main $(XORG_GTEST_LIBS)
199-endif
200+ $(EVEMU_LIBS) \
201+ $(FRAME_LIBS) \
202+ $(MTDEV_LIBS) \
203+ $(COVERAGE_LIBS) \
204+ $(XORG_GTEST_LIBS) \
205+ $(XORG_GTEST_MAIN_LIBS)
206
207 if HAVE_XI
208 check_grail_LDADD += \

Subscribers

People subscribed via source and target branches