[webkit-dev] choosing a unit test framework

David Levin levin at chromium.org
Tue Apr 19 14:36:20 PDT 2011


In the interest of moving this along, I'll move to using the criteria listed
in the previous email to evaluate the test frameworks.

*Musts:*

   - Compatible license with WebKit
      - Builds/Can be built on the many platforms and build systems
      supported by WebKit (ideally without extra installs).

TestWebKitAPI and gtest meet these criteria.
I don't think that QTest does.


*Useful:*

   - Easy to write tests
      - Maintained

TestWebKitAPI, gtest have these.






   - Hackable to suit our needs

TestWebKitAPI meets this better as it is solely in WebKit.
gtest is an open source project with outside contributions accepted.
Also, gtest
is flexible to allow for many uses and widely used in many scenarios so it
is less likely to need modifications.






   - Supports filtering of tests so you can run just the test you care about
      (and easily listing the tests).

TestWebKitAPI and gtest supports listing the tests and running a single
test.
Also, gtest supports running all tests, or matching a simple pattern (Xml*).


   - Well tested features (to support hackability/stability)
      - 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

gtest has these features.


To me, both gtest and TestWebKitAPI seem close. I feel like there is a
slight edge for gtest in these criteria (plus it has other features that
aren't used as often but are nice when you have the scenario).

I'm sure that TestWebKitAPI could meet these criteria as well. One nice
thing about having these features already done, tested and documented is
that it will allow us to focus on other places where we can add value (as
opposed to working on another unit test framework).

dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20110419/c7e017d8/attachment.html>


More information about the webkit-dev mailing list