cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: curl unit testing

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sun, 2 Jan 2011 22:58:54 +0100 (CET)

On Sun, 2 Jan 2011, Kamil Dudka wrote:

>> Or maybe just force the unit tests link against the static libcurl library.
>> That should be enough to make it work.
>
> I am afraid this clashes with --disable-static, hence defeats any unit
> testing in our Fedora builds.

I spent a few minutes on this problem. I don't have any really good
alternatives to using a static library for it. Trying to use object files
directly will fail miserably due to all cross-dependencies.

Another problem struck me that is related: what about functions that are
declared 'static' in the code? Shouldn't we be able to write unit tests for
such functions as well? To make that possible we just might need to have
special unit-test builds that don't have those functions static. Or can anyone
think of other clever ways to do it?

I'm attaching my revised version of my patch that now has the unit tests in a
new dedicated directory (tests/unit/). If nobody has any strong objections,
I'll start off with pushing this within shortly and then we can work on things
further from there.

-- 
  / daniel.haxx.se


-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html

Received on 2011-01-02