简体   繁体   中英

implementing a BOOST_TEST test_runner for running multiple tests from different shared libraries

I am trying to implement a test_runner for BOOST_TEST that plugs-in to a set of shared_libs containing the tests.

I got the initial sample libs/test/tools/console_test_runner from official boost src. But unfortunately, this code does not compile and is unmaintained .

I have managed to put up a working test_runner, which works fine for first iteration that loads up the shared lib, and executes its testcases. But if i loadup any other shared lib in the second iteration, the test_runner's behaviour is undefined and crashes.

I have shared the sample code as a gist. I guess, the issue lies with the de-initialization of the boost test framework in the shared code, but i cant seem to figure out why. The load_library open/close looks fine to me.

gist

As it is written today, Boost.Test expects that only one and unique initialization is performed.

Basically from your Gist, at the end of the bool load_test_lib() call, Boost.Test continues its initialization with the test tree that should have been defined when pulling your shared library symbols. I believe from there you can load other shared libraries, but before returning from the load_test_lib function.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM