Boost logo

Boost Users :

Subject: Re: [Boost-users] [Test] Test cases in static libraries
From: Gennadiy Rozental (rogeeff_at_[hidden])
Date: 2011-10-04 16:34:13


Jérémy Coulon <jeremy.coulon <at> free.fr> writes:

>
> Hi all,
>
> I'm currently converting cppunit tests to Boost.Test.
> Boost test auto-registration is awesome !
>
> I'm now facing a problem and need help from Boost community.
>
> mytest -> libFoo.so -> libBar.a
>
> Let's say I have a dynamic library Foo which depends on a static library
> Bar.
> I created an executable mytest which uses Foo library. It doesn't know
> about Bar library.
>
> So far, I successfully created test cases in mytest for Foo library
> using the public library interface (exported symbols).
> I just figured out how to create test cases inside Foo library (for
> internal non-exported classes) using console_test_runner utility.

I am confused. So, you have Foo tests both inside the library and outside?
 
> Question: how do I test code inside Bar static library ?

I would imagine they are being run when you use console_test_runner. Since the
library statically linked into Foo, all test units should be registered once
static initializers are executed.

Gennadiy


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net