[cfe-dev] Updating googletest to v1.10.0

Pavel Labath via cfe-dev cfe-dev at lists.llvm.org
Fri Apr 24 06:39:55 PDT 2020


On Fri, 24 Apr 2020 at 14:01, Sam McCall via cfe-dev
<cfe-dev at lists.llvm.org> wrote:
>
> 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
>> - llvm/unittests/Support/ThreadPool.cpp:81
>> - llvm/unittests/Support/MemoryTest.cpp:89
>>
>> 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.

One thing I remember running into was the inability to add "override"
specifiers to mocked methods, which tends to trigger a torrent of
-Winconsistent-missing-override warnings. New googletests solve that

>
>>
>> Should we upgrade googletest to version 1.10.0?
>
> +1 from me.
+1 as well, and I also volunteer to help with any problems within lldb tests.

pl


More information about the cfe-dev mailing list