[PATCH 0/3] Resubmit - Unit test framework for Wayland

Michael Hasselmann michaelh at openismus.com
Fri Mar 2 01:36:55 PST 2012


On Thu, 2012-03-01 at 22:34 -0500, Kristian Høgsberg wrote:
> Hi Artie,
> 
> Thanks for starting this.  Looks good and certainly when we start
> adding tests for some of the more complex objects and data structures
> in the library (wl_map would be a good next step), it will be a good
> way to avoid regressing functionality.  I'm not convinced that we
> really need an external unit testing framework though. All each TESTS
> binary need to do is to test something and fail or succeed.  We can
> add a little test helper to provide the fail_if() etc functions.

I found that a good testing framework can lower the barrier of writing
useful tests. Nice logging and status reports are important I feel. And
if for example you can easily write data driven tests, then testing all
possible code paths in a critical area becomes straight-forward and the
tests will remain readable (and with that, maintainable; people tend
forget that every test also adds to the overall maintenance costs which
can often enough outweight the benefits of the test). It's actually the
one thing I really like about Qt's testlib.

If a testing framework even goes so far to allow fuzz testing out of the
box, then you have a nice sanity check for your APIs.

I have no experience in writing a testlib, but I would assume it's a
non-trivial task.

regards,
Michael



More information about the wayland-devel mailing list