[webkit-dev] WebKit unit test framework

Darin Fisher darin at chromium.org
Wed Apr 20 16:59:37 PDT 2011


I believe both maruel and jcivelli have had experience contributing changes
to gtest.

While I wouldn't characterize its code as simple, I haven't had trouble
understanding it.  It is a fairly mature project, having been used
internally at Google for ages.  It seems to be fairly well maintained, and
the code is clean to my eyes.  Chances are good that it already has
solutions for much of what you may wish of a unit testing framework.

By the way, I was originally not in favor of using gtest for Chromium.  It
seemed too complicated at first blush.  I had created a very simple testing
framework that I liked for all the reasons you state below.  That was ~5
years ago.  However, I quickly became more than convinced that it was worth
it to use an established tool for unit testing.  It has so many nice
features--features I didn't even know I would appreciate.  It was also
really easy to use.

-Darin


On Wed, Apr 20, 2011 at 4:01 PM, Sam Weinig <weinig at apple.com> wrote:

> I am really not an expert on testing frameworks, and just put together
> something that met my needs (as has been the tradition in this project).
>  That said, the only features I like about TestWebKitAPI is that I know how
> it works and can hack
> it to do what I want, and that it has the ability to run each test in its
> own invocation (I also like the color output from the tests, because it's is
> in color!)
>
> So, my questions for people who have used gtest is, "Is it hackable?" What
> kind of changes have you had success making? Is a death test as scary as it
> sounds?
>
> -Sam
>
>
> On Apr 18, 2011, at 11:36 AM, David Levin wrote:
>
> *Issue: *There has been a long standing bug to add unit tests to WebKit (
> https://bugs.webkit.org/show_bug.cgi?id=21010). It was also mentioned<http://lists.macosforge.org/pipermail/webkit-dev/2009-January/006359.html>on webkit-dev that it would be helpful in various cases.
>
> *Landscape:* Surveying WebKit, it is looks like there are at least three
> testing frameworks being used: TestWebKitAPI/WebKitAPITest (in Tools),
> QTest, gtest (in Source/WebKit/chromium/). However, only one TestWebKitAPI
> has been used so far (as far as I can tell) for testing core WebKit items
> like WTF (though I was unaware of TestWebKitAPI until Friday).
>
> It seems like a good way to think about the issue of which to use in
> general in WebKit would be to decide on what would be desired in our
> framework and then see how each matches up.
>
> Here's my take on this. (It may be biased toward what I am familiar with
> but I welcome others to add their own criteria.)
>
> Criteria
>
> Musts:
>
>    - Compatible license with WebKit
>    - Builds/Can be built on the many platforms and build systems supported
>    by WebKit (ideally without extra installs).
>
> Useful:
>
>    - Easy to write tests
>    - Hackable to suit our needs
>    - Well tested features (to support hackability/stability)
>    - Supports filtering of tests so you can run just the test you care
>    about (and easily listing the tests).
>    - Supports writing out values when there is test failure. (For example,
>    if the is verifying that A == B but that is not true, then the values of A
>    and B should be printed.)
>    - Well documented
>
> thanks,
> dave
>
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
>
>
>
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20110420/e6bd1f6c/attachment.html>


More information about the webkit-dev mailing list