Boost logo

Boost Users :

From: Gennadiy Rozental (gennadiy.rozental_at_[hidden])
Date: 2005-10-04 09:04:00


> Hello!
> I got a question about unit testing. I have an application, which uses
> PWLIB (http://www.voxgratia.org/docs/pwlib/pwlib-v1_7_4/index.html).
> This library creates MAIN function by it's own macros. When I'm trying
> to write unit tests for my application I have to use PWLIB. Can I use
> boost test unit framework with PWLIB application? As I understand, Boost
> test unit framework will try to create its MAIN function by its macros

Actually main is in the library.

> and this will cause to problems. Is it possible to use both - Boost test
> framework and PWLIB library? Will be grateful for your help.
>
> Storm.

Hi,

It is possible if you are using boost 1.33.0. It will require you to go one
extra mile though. In this release most of the initialization functionality
is moved into framework class. All that you need is to implement different
runner. IOW do whatever I do in main() in unit_test_main.ipp, in your main
function. Be aware that now you need to link boost library *without*
unit_test_main.cpp. And you are good to go.

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