cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: documenting unit tests for functions

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Wed, 11 May 2011 12:24:32 -0700

On Wed, May 11, 2011 at 06:46:06PM +0200, Daniel Stenberg wrote:
> I think this is a good idea. I would however prefer it to be a more
> compact more easily machine-parsed format, like perhaps:
>
> /*
> * @unit-test: 1300
> */
>
> ... without reference to exact line number since that is doomed to
> change over time, and unit-tests should preferably be focused on a
> single function in each test anyway.
>
> >I was wondering if it's best to add this to the .h file or the .c file
>
> I say the .c file since we might end up with tests even for static
> functions that have no prototypes in .h files.

The alternative which the current tests already do to a degree, is to make
the tested functions keywords in the test13xx file.

>>> Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-05-11