You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Gabriela Gibson <ga...@gmail.com> on 2013/02/01 19:34:07 UTC

Re: [PATCH] OPW 2013: Build System Gtest Addition

On 22/01/13 12:03, Stefan Sperling wrote:
>
> On Tue, Jan 22, 2013 at 11:15:30AM +0000, Gabriela Gibson wrote:
>>
>> Part of my 2013 OPW Project for Subversion is to add the Googletest

First of all thanks to Ben for rescuing my messy post =)

Also thanks to everyone who gave me hints!

---

At this point I have ./configure --enable-gtest working but the show
stops here:

[[[
g++ -std=c++98  -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE   -g
-O2  -I./subversion/include -I./subversion -I/home/g/trunk/\
apr/include   -I/home/g/trunk/apr-util/include
-I/home/g/trunk/sqlite-amalgamation  gtest/src/gtest-all.cc
gtest/src/gtest-all.cc:39:25: fatal error: gtest/gtest.h: No such file
or directory
(...snip...)
gtest/src/gtest-all.cc:39:25: fatal error: gtest/gtest.h: No such file
or directory
compilation terminated.
make: *** [gtest/src/gtest-all.lo] Error 1
]]]

Looking at the file in question I find:

[[[
// This line ensures that gtest.h can be compiled on its own, even
// when it's fused.
#include "gtest/gtest.h"
]]]

The file in question is located here: /trunk/gtest/include/gtest/gtest.h

also a similar problem exists when using autogen.sh:

[[[
Creating build-outputs.mk...
WARNING: "gtest/internal/gtest-port.h" header not found, file
gtest/src/gtest-internal-inl.h
WARNING: "gtest/gtest.h" header not found, file gtest/src/gtest-internal-inl.h
WARNING: "gtest/gtest-spi.h" header not found, file
gtest/src/gtest-internal-inl.h
Creating svn_private_config.h.in...
]]]

again, the files exist, but not where gtest thinks they should be.

What can I do about that, if anything?

thanks,

Gabriela

Ps.: it turns out that configure is issuing a misleading warning:
configure: WARNING: unrecognized options: --enable-gtest
but it also does it for --without-gpg-agent and --with-kwallet

Re: [PATCH] Re: [PATCH] OPW 2013: Build System Gtest Addition

Posted by Branko Čibej <br...@wandisco.com>.
On 05.02.2013 14:28, Gabriela Gibson wrote:
> On 02/02/13 10:31, Branko Čibej wrote:
>> You could try adding ${abs_srcdir}/gtest/include to the include path. :)
>> Also, you'll get rid of those warnings by adding appropriate paths to
>> the private-includes list in build.conf.
>>
>> -- Brane
>>
> Thanks Brane,
>
> I think it is now working, please see attached patch and log.

I see this:

Index: get-deps.sh
=======================================

--- get-deps.sh	(revision 1442436)

+++ get-deps.sh	(working copy)

@@ -115,8 +115,12 @@

get_gtest() {
unzip -q $TEMPDIR/$GTEST.zip
- mv $GTEST gtest
+ mv $GTEST gtestlib 


And then this:

Index: Makefile.in
=======================================

--- Makefile.in	(revision 1442436)

+++ Makefile.in	(working copy)

@@ -135,7 +135,9 @@

APACHE_INCLUDES = @APACHE_INCLUDES@
APACHE_LIBEXECDIR = $(DESTDIR)@APACHE_LIBEXECDIR@
APACHE_LDFLAGS = @APACHE_LDFLAGS@
+GTEST_INCLUDES = -Igtest -Igtest/include


and scratch my head in confusion ... is it in gtestlib, or gtest? :)

-- Brane

-- 
Branko Čibej
Director of Subversion | WANdisco | www.wandisco.com


Re: [PATCH] Re: [PATCH] OPW 2013: Build System Gtest Addition

Posted by Branko Čibej <br...@wandisco.com>.
On 12.02.2013 18:36, Stefan Sperling wrote:
> On Wed, Feb 06, 2013 at 08:37:04AM +0000, Gabriela Gibson wrote:
>> On 05/02/13 17:00, Branko Čibej wrote:
>>> On 05.02.2013 14:28, Gabriela Gibson wrote:
>>> I'm almost sure you meant, "path = gtestlib".
>>>
>>> -- Brane
>>>
>> Nope, meant libgtest, ended up with both and the mistake compiled %-)
>>
>> I think it's working now, see attached patch.
> Branko, any news?

Fighting viruses (the biological kind), so I haven't tested the patch yet.

> This patch only seems to support a build with an in-tree libgtest
> obtained with get-deps.sh. Will there be support for using a system-wide
> gtest installation, too? Or does that not make sense?

It does not make sense, no. libgtest has to be built from source with
the same compiler and flags as the rest of the C++ code being tested.
While Ubuntu for example has a package that installs the sources in
/usr/src, I think it's OK for now to not worry about alternate source
locations.

> Gabriela, feel free to commit this patch to your branch, and then
> commit further follow-up fixes there, too, if any.

+1


-- Brane

-- 
Branko Čibej
Director of Subversion | WANdisco | www.wandisco.com


Re: [PATCH] Re: [PATCH] OPW 2013: Build System Gtest Addition

Posted by Stefan Sperling <st...@elego.de>.
On Wed, Feb 06, 2013 at 08:37:04AM +0000, Gabriela Gibson wrote:
> On 05/02/13 17:00, Branko Čibej wrote:
> >On 05.02.2013 14:28, Gabriela Gibson wrote:
> >I'm almost sure you meant, "path = gtestlib".
> >
> >-- Brane
> >
> Nope, meant libgtest, ended up with both and the mistake compiled %-)
> 
> I think it's working now, see attached patch.

Branko, any news?

This patch only seems to support a build with an in-tree libgtest
obtained with get-deps.sh. Will there be support for using a system-wide
gtest installation, too? Or does that not make sense?

Gabriela, feel free to commit this patch to your branch, and then
commit further follow-up fixes there, too, if any.
The quickest way of doing this from a working copy of Subversion's
trunk code which contains the local modifications corresponding
to your patch is:
  svn copy ^/subversion/trunk ^/subversion/branches/gtest
  svn switch ^/subversion/branches/gtest
  svn commit
This makes the working copy point to the gtest branch. To commit to
trunk you'd have to switch it back to ^/trunk first.

Re: [PATCH] Re: [PATCH] OPW 2013: Build System Gtest Addition

Posted by Gabriela Gibson <ga...@gmail.com>.
On 05/02/13 17:00, Branko Čibej wrote:
> On 05.02.2013 14:28, Gabriela Gibson wrote:
> I'm almost sure you meant, "path = gtestlib".
>
> -- Brane
>
Nope, meant libgtest, ended up with both and the mistake compiled %-)

I think it's working now, see attached patch.



Re: [PATCH] Re: [PATCH] OPW 2013: Build System Gtest Addition

Posted by Branko Čibej <br...@wandisco.com>.
On 05.02.2013 14:28, Gabriela Gibson wrote:
> On 02/02/13 10:31, Branko Čibej wrote:
>> You could try adding ${abs_srcdir}/gtest/include to the include path. :)
>> Also, you'll get rid of those warnings by adding appropriate paths to
>> the private-includes list in build.conf.
>>
>> -- Brane
>>
> Thanks Brane,
>
> I think it is now working, please see attached patch and log.
>


You ask:

> ## I don't understand why, but I need to provide "-o ... -c" in order
> to get the object file in the correct directory

And my best guess is this:

+# Gtest targets
+#
+
+# renamed from gtest to libgtest because libtool couldn't output
+# a library that didn't have the prefix 'lib'
+[libgtest]
+description = Gtest Test Suite
+type = lib
+path = libgtest 


I'm almost sure you meant, "path = gtestlib".

-- Brane

-- 
Branko Čibej
Director of Subversion | WANdisco | www.wandisco.com


[PATCH] Re: [PATCH] OPW 2013: Build System Gtest Addition

Posted by Gabriela Gibson <ga...@gmail.com>.
On 02/02/13 10:31, Branko Čibej wrote:
> You could try adding ${abs_srcdir}/gtest/include to the include path. :)
> Also, you'll get rid of those warnings by adding appropriate paths to
> the private-includes list in build.conf.
>
> -- Brane
>
Thanks Brane,

I think it is now working, please see attached patch and log.


Re: [PATCH] OPW 2013: Build System Gtest Addition

Posted by Branko Čibej <br...@wandisco.com>.
On 01.02.2013 19:34, Gabriela Gibson wrote:
> On 22/01/13 12:03, Stefan Sperling wrote:
>> On Tue, Jan 22, 2013 at 11:15:30AM +0000, Gabriela Gibson wrote:
>>> Part of my 2013 OPW Project for Subversion is to add the Googletest
> First of all thanks to Ben for rescuing my messy post =)
>
> Also thanks to everyone who gave me hints!
>
> ---
>
> At this point I have ./configure --enable-gtest working but the show
> stops here:
>
> [[[
> g++ -std=c++98  -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE   -g
> -O2  -I./subversion/include -I./subversion -I/home/g/trunk/\
> apr/include   -I/home/g/trunk/apr-util/include
> -I/home/g/trunk/sqlite-amalgamation  gtest/src/gtest-all.cc
> gtest/src/gtest-all.cc:39:25: fatal error: gtest/gtest.h: No such file
> or directory
> (...snip...)
> gtest/src/gtest-all.cc:39:25: fatal error: gtest/gtest.h: No such file
> or directory
> compilation terminated.
> make: *** [gtest/src/gtest-all.lo] Error 1
> ]]]
>
> Looking at the file in question I find:
>
> [[[
> // This line ensures that gtest.h can be compiled on its own, even
> // when it's fused.
> #include "gtest/gtest.h"
> ]]]
>
> The file in question is located here: /trunk/gtest/include/gtest/gtest.h
>
> also a similar problem exists when using autogen.sh:
>
> [[[
> Creating build-outputs.mk...
> WARNING: "gtest/internal/gtest-port.h" header not found, file
> gtest/src/gtest-internal-inl.h
> WARNING: "gtest/gtest.h" header not found, file gtest/src/gtest-internal-inl.h
> WARNING: "gtest/gtest-spi.h" header not found, file
> gtest/src/gtest-internal-inl.h
> Creating svn_private_config.h.in...
> ]]]
>
> again, the files exist, but not where gtest thinks they should be.
>
> What can I do about that, if anything?
You could try adding ${abs_srcdir}/gtest/include to the include path. :)
Also, you'll get rid of those warnings by adding appropriate paths to
the private-includes list in build.conf.

-- Brane

-- 
Branko Čibej
Director of Subversion | WANdisco | www.wandisco.com