[cfe-dev] Updating googletest to v1.10.0

Sam McCall via cfe-dev cfe-dev at lists.llvm.org
Fri Apr 24 05:01:27 PDT 2020


On Fri, Apr 24, 2020 at 11:17 AM Bal√°zs Benics via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> Hi all,
>
> On a Phabricator review (https://reviews.llvm.org/D78704) the `GTEST_SKIP`
> was
> mentioned as a way to express requirements for a test. In that patch, I
> wanted
> to skip the test if clang was not built with Z3.
>
> I think this `GTEST_SKIP` macro express the intention much better than the
> following code that I saw throughout the codebase:
>
> ```
> #define CHECK_UNSUPPORTED() \
>   do { \
>     if (isUnsupportedOSOrEnvironment()) \
>       return; \
>   } while (0);
> ```
>
>
> There are several places where we might benefit from the `GTEST_SKIP`
> macro:
> - llvm/unittests/ExecutionEngine/MCJIT/MCJITTestAPICommon.h:29
> <https://github.com/llvm/llvm-project/blob/master/llvm/unittests/ExecutionEngine/MCJIT/MCJITTestAPICommon.h#L29-L33>
> - llvm/unittests/Support/ThreadPool.cpp:81
> <https://github.com/llvm/llvm-project/blob/master/llvm/unittests/Support/ThreadPool.cpp#L81-L85>
> - llvm/unittests/Support/MemoryTest.cpp:89
> <https://github.com/llvm/llvm-project/blob/master/llvm/unittests/Support/MemoryTest.cpp#L89-L94>
>
> It is possible that the upgrade would introduce other benefits as well -
> which
> I'm not aware of.
>
I know there are some minor features unavailable in our old gtest that I've
wanted to use and worked around.
Unfortunately I can't remember what these cases were, but I think there are
at least minor benefits.


> Should we upgrade googletest to version 1.10.0?
>
+1 from me.

A thing to be aware of for anyone doing the upgrade: we have a few
customizations e.g.
llvm/utils/unittest/googletest/include/gtest/internal/custom/raw-ostream.h,
and also small (I hope clearly marked) modifications within gtest itself.

Some of these you'll notice (replacing them with clean sources will break
the build), but others affect assertion failure message quality, and I'm
not sure if they themselves are well tested.
It's probably worthwhile to trawl the history of the gtest directories to
find these...



>
> /CC Chandler
>
> Balazs.
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20200424/0e2afc94/attachment-0001.html>


More information about the cfe-dev mailing list