Re: RFC: GLib testing framework

On 11/1/07, Behdad Esfahbod <behdad behdad org> wrote:
> On Thu, 2007-11-01 at 18:24 -0400, BJörn Lindqvist wrote:
> > I have found that a good way to write tests, is to write them in
> > Python. Almost all libraries (and certainly all in the GNOME platform)
> > has Python bindings, so it doesn't matter if you use C or Python to
> > write your tests. In fact, writing the tests in Python should be
> > beneficial because the bindings only exposes the public api so you are
> > prevented from referencing internals.
> Problem is, most modules don't own their python bindings.  So:
> 1) Your need to have python bindings installed before you can test the
> module.  Circular dependency BTW.

Not if dependency goes from Test suite -> Python binding -> C library.

> 2) Your tests may hit binding bugs.  It's hard to know.

Good, more coverage!

> 3) Dependencies.  No dependencies is part of the design Tim brought.

Well, it's a trade off. :) Personally I don't understand what is so
bad about dependencies.

(I really don't expect you to buy my idea about Python tests for C
code, but the strategy has worked well for me. :) And a different
perspective might be interesting.)

> > YMMV of course. But even if there is a need for a test framework
> > written in pure C, does it really have to be placed in For
> > other languages than C that test framework is dead weight since they
> > already have better solutions.
> If it's like 2000 lines of code and 10 entry points, the overhead is
> nonexistent.

Technically yes, but I've heard people complain that glib already
contains to much. A test framework would naturally add to that.

mvh Björn

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]