using boost test framework with PWLIB
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 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.
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
Gennadiy Rozental wrote:
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
Thank you very much. I did so and now BOOST testing framework successfully lives into PWLIB thread. storm
participants (2)
-
Bondarenko Denis
-
Gennadiy Rozental