Re: RFC: GLib testing framework

On Sun, 2007-11-04 at 06:06 +0000, BJ�Lindqvist wrote:
> On 11/1/07, Behdad Esfahbod <behdad behdad org> wrote:
> > On Thu, 2007-11-01 at 18:24 -0400, BJ�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.

Then you have to package the test suite as a separate module.

> > 2) Your tests may hit binding bugs.  It's hard to know.
> Good, more coverage!

If that was good, the current let-millions-of-users-test it would have
been perfect.

> > 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.

Less users running it.  Drastically less users...  It helps a lot if you
can run the cairo test suite for the ARM platform you've finally got
cairo compiling for.

> (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.

The complaints typically don't have much technical merit or fact.


"Those who would give up Essential Liberty to purchase a little
 Temporary Safety, deserve neither Liberty nor Safety."
        -- Benjamin Franklin, 1759

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