GTEST_LIB_CHECK

76 views
Skip to first unread message

Tor Didriksen

unread,
Nov 4, 2009, 8:56:10 AM11/4/09
to Google C++ Testing Framework
hi

My current requirement when configuring my project:
build and run gtest-based unit tests if gtest is found, otherwise ignore.

Am I supposed to be able to use this ??
dnl GTEST_LIB_CHECK([minimum version [,
dnl action if found [,action if not found]]])

I'm hitting AC_MSG_ERROR, which aborts, if gtest cannot be found,
so the [action if not found] seems a bit misleading.

-- didrik

Chandler Carruth

unread,
Nov 4, 2009, 12:07:46 PM11/4/09
to Tor Didriksen, Google C++ Testing Framework
On Wed, Nov 4, 2009 at 5:56 AM, Tor Didriksen <torm...@gmail.com> wrote:
>
> hi
>
> My current requirement when configuring my project:
> build and run gtest-based unit tests if gtest is found, otherwise ignore.
>
> Am I supposed to be able to use this ??

Yes.

> dnl GTEST_LIB_CHECK([minimum version [,
> dnl                  action if found [,action if not found]]])
>
> I'm hitting AC_MSG_ERROR, which aborts, if gtest cannot be found,
> so the [action if not found] seems a bit misleading.

I need more information here to determine where the problem resides.
What version of gtest.m4? (head, a release?) What is the exact way you
are using it in your configure.ac? What is the exact output it
provides? How are you running the './configure' step when it does
this?

Thanks!
-Chandler

>
> -- didrik
>

Tor Didriksen

unread,
Nov 4, 2009, 12:33:39 PM11/4/09
to Chandler Carruth, Google C++ Testing Framework

I'm running from head of the svn branch.
Copied gtest.m4 to current directory.

a minimal configure.in
===============
AC_INIT([Testing])
AC_CONFIG_SRCDIR([./configure.in])
m4_include(gtest.m4)
GTEST_LIB_CHECK([1.4.0], AC_MSG_WARN([YAY]), AC_MSG_WARN([NON]))
===============


$autoreconf
$autoconf
$./configure
checking for 'gtest-config'... no
configure: error: Unable to locate either a built or installed Google Test.
The specific location '' was provided for a built or installed
Google Test, but no 'gtest-config' script could be found at this location.

$./configure --enable-gtest=/usr/local
checking for 'gtest-config'... /usr/local/bin/gtest-config
checking for Google Test at least version >= 1.4.0... yes
configure: WARNING: YAY

-- didrik

>
> Thanks!
> -Chandler
>
>>
>> -- didrik
>>
>

Reply all
Reply to author
Forward
0 new messages