[LLVMdev] Any objections to my importing GoogleMock to go with GoogleTest in LLVM?

Renato Golin renato.golin at linaro.org
Fri Nov 15 01:47:45 PST 2013


On 15 November 2013 04:38, Chris Lattner <clattner at apple.com> wrote:

> Right, validating my assertion that while TDD and unit testing are good in
> general, they may not be right for LLVM.  In LLVM, we have mature tests of
> other sorts, as well as a strong process of review.
>

While I understand the value of TDD, I have to agree with Chris, here.

I have been bitten by having to write silly boundary checks tests that the
code would never allow, and getting 100% test coverage (of lines AND
branches), only to realize that a test engineer could break my new feature
in many different ways by misusing it on a command-line level.

I personally think we'd have a much better use of time by making the MI
layer dumpable and re-readable, so we could create lots of very specific
low-level tests, than having yet-another unit-test infrastructure.

The only place I think that unit-tests are worthy is on base libraries
(APFLoat, APInt, containers, basic algorithms), and for that, you need
nothing special.



> Further, even if you guys didn't notice the bug immediately, I would have
> noticed it in my (planned) next commit.  That commit was the code that used
> it.  You don't need a unit test to catch obvious bozo bugs like the one you
> are referring to.
>

That is the point. Most of us don't commit before a check-all anyway, so
looking back on the commits list won't give you a clear picture.

cheers,
--renato
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131115/3c623c4b/attachment.html>


More information about the llvm-dev mailing list