Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Feb 2019 12:53:45 -0800
From:      Enji Cooper <yaneurabeya@gmail.com>
To:        Alan Somers <asomers@freebsd.org>
Cc:        "freebsd-testing@freebsd.org" <freebsd-testing@freebsd.org>, Ed Maste <emaste@freebsd.org>, Julio Merino <jmmv@freebsd.org>, "Jonathan T. Looney" <jtl@freebsd.org>
Subject:   Re: atf-c++ vs GoogleTest vs share/mk
Message-ID:  <A6D8F747-37B6-4EC9-ADE6-823E529EF226@gmail.com>
In-Reply-To: <CAOtMX2jCi9ZUVdCLVE8kMRcrdwAmSbLPJTmHdhf3pJyyWR=k-A@mail.gmail.com>
References:  <CAOtMX2h_tJHH=mX8wVrMLQNeCsN%2B_D4Jw35KyuiHUcQniNweWg@mail.gmail.com> <C9F53820-7817-4FEC-A20C-ACA35819E763@gmail.com> <CAOtMX2jCi9ZUVdCLVE8kMRcrdwAmSbLPJTmHdhf3pJyyWR=k-A@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

> On Feb 27, 2019, at 12:42 PM, Alan Somers <asomers@freebsd.org> wrote:
>=20
> On Wed, Feb 27, 2019 at 12:46 PM Enji Cooper <yaneurabeya@gmail.com> =
wrote:
>>=20
>>=20
>>> On Feb 27, 2019, at 9:59 AM, Alan Somers <asomers@freebsd.org> =
wrote:
>>>=20
>>> So it turns out to be impossible to use GoogleMock with atf-c++.  =
The
>>> problem is that atf-c++'s only way to report a test failure is
>>> ATF_FAIL, which immediately terminates the program on failure.  That
>>> conflicts with the way that GoogleMock uses pthreads, which is to
>>> report a failure while a pthread mutex is locked.  atf-c++ has many
>>> other shortcomings, too.  It lacks the ATF_CHECK_* macros, and its
>>> syntax is surprisingly inconsistent with atf-c=E2=80=99s.
>>=20
>> Yes, I=E2=80=99ve brought that up before in the past. This is part of =
the reason why I want to abandon/kill off atf-c++ in favor of something =
more functionally complete, i.e., googletest
>>=20
>>> So I tried writing a C++ program that uses atf-c instead.  But the
>>> Makefiles in share/mk make that a frustrating proposition.  They =
don't
>>> want C++ programs to link to atf-c, and they don't want atf-c =
programs
>>> to be built in C++ mode.
>>=20
>> Well=E2=80=A6 yeah. This makes sense.
>>=20
>>> Googletest would probably work fine, but I would sorely miss ATF's
>>> test case isolation features.
>>=20
>> In what ways? Using plain tests builds in some level of isolation, =
but it=E2=80=99s not perfect, and this is the direction I=E2=80=99m =
taking Googletest for a first iteration.
>=20
> Having $PWD be a disposable tmpdir is convenient,

This is already handled via kyua, just like it is with plain tests (and =
ATF and TAP tests for that matter).

> but I'm even more concerned about what happens if a googletest =
segfaults.  In that case,
> its cleanup routines won't run.  That could potentially be
> catastrophic for the entire test run if the test program does
> something like alter network configuration.  Or do you have a plan for
> this?

I will look into how Googletest currently handles segfaults, etc, and =
raise that as a point of concern with the upstream project if need be, =
as I don=E2=80=99t know how exactly this is handled in exceptional =
cases.

Cheers,
-Enji=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?A6D8F747-37B6-4EC9-ADE6-823E529EF226>