Re: [Vala] Any xUnit framework for Vala?



Oops, it seems that there are a few messages were out of the maillist.
Let me copy it here.

Hi

On Mon, Dec 27, 2010 at 7:58 PM, b4283 <da mi spirit gmail com> wrote:
Doesn't Vala already has assertion clauses ?
Assertions (and contract programming) is not the same as unit testing,
although they both serve the same thing - find bugs and states that
should never happen.

You inject assertions into your code so you can check internal state
during running program. From other side unit testing assumes that you
write special small and fast programs called testcases. And then you
run these small programs automatically, ideally after any your change
so you can be sure that the code works as expected.

Unit testing is widely used technique and almost any language has some
kind of framework that helps to create testcases
http://en.wikipedia.org/wiki/List_of_unit_testing_frameworks

I am not exactly sure what you mean by framework but that should be
sufficient.

Or do you mean a test class, something like GroovyTestCase to inherit from ?

Correct, something like this. GroovyTestCase itself is based on jUnit
(de-facto standard unit framework in java world).

There is a test framework in Glib already
http://library.gnome.org/devel/glib/unstable/glib-Testing.html and IMO
the best of all is to adopt it for Vala. There are at least 2 thing
have to be done:
 - add vapi bindings for these methods
 - add documentation/examples that shows how to use tests with
make/autotools/cmake in your project



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