0

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

ashishsony
  • 2,537
  • 3
  • 26
  • 38
  • Note: this script is now part of the CI builds and is in fact maintained. However it is still not clear to me why one would be needing this. – Raffi Apr 22 '20 at 17:27

1 Answers1

0

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.

Raffi
  • 3,068
  • 31
  • 33