On Tue, 20 Oct 2009 17:04:55 +0200, Kristian Nielsen
<knielsen@stripped> wrote:
> Tor Didriksen <Tor.Didriksen@stripped> writes:
>
>> I just wrote a couple of tests using gtest,
>> trying to show that it is a lot more expressive than mytap.
>> There are currently *very few* unit tests in the codebase.
>> If people think unit tests are a good idea, then maybe
>> they will actually start writing them, given a better framework.
>
> Hm. Maybe it is only in the Maria branch that many unit tests have been
> written? But I suppose it will be merged one day (or maybe not).
We currently have only a handfull of unit tests, for about one million
lines of code.
In the maria branch there's a couple of dozen more tests in
storage/maria/unittest/...
>
>> I use unit.pl as a test runner, so no re-invention there.
>
> Ah, so is that possible?
>
> Didn't realise that. If one could use multiple frameworks for writing
> different kinds of unit tests, that could actually be cool... different
> kinds
> of tests might have different needs.
>
> Really great if your work can improve unit testing!
Well I hope to!
>
> - Kristian.
>
Guilhem kindly copied my gtest branch from bk-internal to launchpad:
bzr+ssh://bk-internal.mysql.com/bzrroot/server/mysql-6.0-codebase-bugfixing-gtest/
https://code.launchpad.net/~mysql/mysql-server/mysql-6.0-codebase-bugfixing-gtest
I encourage people to check it out (pun intended)
I implemented the mdl tests for both gtest and mytap,
to illustrate (some of) the benefits of gtest:
- a rich set of predicates
- automatic registration of tests
- nice error reporting whenever a predicate fails
(with line number, expected and actual values, additional comments)
- test fixtures, and setup/teardown logic
- death tests
- disabled tests
and many more.
I hope to merge this into development branches in the not too distant
future.
-- didrik