Merge lp:~cyphermox/ido/gtest-source into lp:ido/13.04

Proposed by Mathieu Trudel-Lapierre
Status: Merged
Approved by: Charles Kerr
Approved revision: 126
Merged at revision: 124
Proposed branch: lp:~cyphermox/ido/gtest-source
Merge into: lp:ido/13.04
Diff against target: 134 lines (+13/-69)
5 files modified
configure.ac (+1/-2)
debian/changelog (+7/-0)
m4/gtest.m4 (+0/-63)
src/idotimeline.c (+4/-3)
tests/Makefile.am (+1/-1)
To merge this branch: bzr merge lp:~cyphermox/ido/gtest-source
Reviewer Review Type Date Requested Status
Charles Kerr (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+146722@code.launchpad.net

Commit message

Fix building against gtest/xorg-gtest.

Description of the change

Fix building against gtest/xorg-gtest. xorg-gtest provides gtest source files, and overrides GTEST_SOURCE via its own m4 file shipped in the distro. Since it's called after CHECK_GTEST, it overrides anything the previous call did -- this renders our own version of m4/gtest.m4 obsolete too.

To post a comment you must log in.
lp:~cyphermox/ido/gtest-source updated
124. By Mathieu Trudel-Lapierre

Avoid FTBFS due to conflicting paths to gtest source, or because the relevant gtest files aren't found -- always use the xorg-gtest gtest source, and adjust path accordingly.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
lp:~cyphermox/ido/gtest-source updated
125. By Mathieu Trudel-Lapierre

Shut up coverity about CID:12650.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
lp:~cyphermox/ido/gtest-source updated
126. By Mathieu Trudel-Lapierre

Guard against CID:12651, division by zero of FPS value due to its use for timing timeline updates.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Charles Kerr (charlesk) wrote :

Good work!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'configure.ac'
2--- configure.ac 2012-12-13 20:58:39 +0000
3+++ configure.ac 2013-02-06 16:56:19 +0000
4@@ -133,8 +133,7 @@
5
6 dnl = Google Test Framework ===================================================
7
8-m4_include([m4/gtest.m4])
9-CHECK_GTEST
10+dnl xorg-gtest also provides gtest.
11 CHECK_XORG_GTEST
12
13 dnl = GTK Doc Check ===========================================================
14
15=== modified file 'debian/changelog'
16--- debian/changelog 2013-01-11 02:02:27 +0000
17+++ debian/changelog 2013-02-06 16:56:19 +0000
18@@ -1,3 +1,10 @@
19+ido (12.10.3daily13.01.11-0ubuntu2) UNRELEASED; urgency=low
20+
21+ * Fix build against libgtest/libxorg-gtest failing due to paths to gtest
22+ source being incorrect. (LP: #1112775)
23+
24+ -- Mathieu Trudel-Lapierre <mathieu-tl@ubuntu.com> Tue, 05 Feb 2013 16:19:25 -0500
25+
26 ido (12.10.3daily13.01.11-0ubuntu1) raring; urgency=low
27
28 [ Mathieu Trudel-Lapierre ]
29
30=== removed file 'm4/gtest.m4'
31--- m4/gtest.m4 2012-04-25 16:06:56 +0000
32+++ m4/gtest.m4 1970-01-01 00:00:00 +0000
33@@ -1,63 +0,0 @@
34-# Copyright (C) 2012 Canonical, Ltd.
35-#
36-# Permission is hereby granted, free of charge, to any person obtaining a copy
37-# of this software and associated documentation files (the "Software"), to deal
38-# in the Software without restriction, including without limitation the rights
39-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
40-# copies of the Software, and to permit persons to whom the Software is
41-# furnished to do so, subject to the following conditions:
42-#
43-# The above copyright notice and this permission notice (including the next
44-# paragraph) shall be included in all copies or substantial portions of the
45-# Software.
46-#
47-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
48-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
49-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
50-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
51-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
52-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
53-# SOFTWARE.
54-
55-# Checks whether the gtest source is available on the system. Allows for
56-# adjusting the include and source path. Sets have_gtest=yes if the source is
57-# present. Sets GTEST_CPPFLAGS and GTEST_SOURCE to the preprocessor flags and
58-# source location respectively.
59-AC_DEFUN([CHECK_GTEST],
60-[
61- AC_ARG_WITH([gtest-include-path],
62- [AS_HELP_STRING([--with-gtest-include-path],
63- [location of the Google test headers])],
64- [GTEST_CPPFLAGS="-I$withval"])
65-
66- AC_ARG_WITH([gtest-source-path],
67- [AS_HELP_STRING([--with-gtest-source-path],
68- [location of the Google test sources, defaults to /usr/src/gtest])],
69- [GTEST_SOURCE="$withval"],
70- [GTEST_SOURCE="/usr/src/gtest"])
71-
72- GTEST_CPPFLAGS="$GTEST_CPPFLAGS -I$GTEST_SOURCE"
73-
74- AC_LANG_PUSH([C++])
75-
76- tmp_CPPFLAGS="$CPPFLAGS"
77- CPPFLAGS="$CPPFLAGS $GTEST_CPPFLAGS"
78-
79- AC_CHECK_HEADER([gtest/gtest.h])
80-
81- CPPFLAGS="$tmp_CPPFLAGS"
82-
83- AC_LANG_POP
84-
85- AC_CHECK_FILES([$GTEST_SOURCE/src/gtest-all.cc]
86- [$GTEST_SOURCE/src/gtest_main.cc],
87- [have_gtest_source=yes],
88- [have_gtest_source=no])
89-
90- AS_IF([test "x$ac_cv_header_gtest_gtest_h" = xyes -a \
91- "x$have_gtest_source" = xyes],
92- [have_gtest=yes]
93- [AC_SUBST(GTEST_CPPFLAGS)]
94- [AC_SUBST(GTEST_SOURCE)],
95- [have_gtest=no])
96-]) # CHECK_GTEST
97
98=== modified file 'src/idotimeline.c'
99--- src/idotimeline.c 2012-12-13 20:58:39 +0000
100+++ src/idotimeline.c 2013-02-06 16:56:19 +0000
101@@ -409,8 +409,8 @@
102 else
103 priv->timer = g_timer_new ();
104
105- /* sanity check */
106- g_assert (priv->fps > 0);
107+ /* sanity check; CID: 12651 */
108+ priv->fps = priv->fps > 0 ? priv->fps : DEFAULT_FPS;
109
110 if (priv->screen)
111 {
112@@ -549,7 +549,8 @@
113
114 priv = IDO_TIMELINE_GET_PRIV (timeline);
115
116- priv->fps = fps;
117+ /* Coverity CID: 12650/12651: guard against division by 0. */
118+ priv->fps = fps > 0 ? fps : priv->fps;
119
120 if (ido_timeline_is_running (timeline))
121 {
122
123=== modified file 'tests/Makefile.am'
124--- tests/Makefile.am 2012-05-08 00:18:10 +0000
125+++ tests/Makefile.am 2013-02-06 16:56:19 +0000
126@@ -15,7 +15,7 @@
127
128 nodist_libgtest_a_SOURCES = \
129 $(XORG_GTEST_SOURCE)/src/xorg-gtest-all.cpp \
130- $(GTEST_SOURCE)/src/gtest-all.cc \
131+ $(GTEST_SOURCE)/gtest-all.cc \
132 $(XORG_GTEST_SOURCE)/src/xorg-gtest_main.cpp
133 libgtest_a_CPPFLAGS = \
134 $(XORG_GTEST_CPPFLAGS) \

Subscribers

People subscribed via source and target branches