[UTF] documentation of runtime configuration programmatically
Hello all, the documentation of Boost.Test contains the following sentence "The UTF provides two ways to set a parameter at runtime: by specifying a command line argument and by setting an environment variable. The command line argument always overrides the corresponding environment variable." However it does not explain how. For example if I add this line to my code it crashes: boost::runtime::env::get<bool>("BOOST_TEST_AUTO_START_DBG"); Anyone?
...even extending the question: I was replacing my home brew test framework with Boost.Test but this has become an exercise in frustration. I have the following setup: - tests in DLLs which can be invoked multiple times during program run - tests are invoked by another DLL which is steered from a GUI, in which u can click which test(s) u want to (re-)run So I need some kind of external test runner. The examples mentioned in the documentation work all fine if one uses an exe which just invoke the test run once. Unfortunately it doesn't work if you invoke the test multiple times. This is not mentioned in the documentation but in a post 'Regarding use of Boost.Test in Iteration'. With my setup it also goes wrong in the setup phase. The DLL has a 'Run' with should invoke the test(s): void Run() { char* aArgs[] = {"", "--run_test=KTestAlgoDifference,KTestAlgoEditDistance"}; int nResult = boost::unit_test::unit_test_main(&init_unit_test, count_array(aArgs), aArgs); } This invokes an exception on line 405 in framework.ipp. Basically I have 3 options now: 1) study the complete Boost.Test framework internals so I actually know what I am doing 2) Hope that the documentation includes a good example of using it with an external test runner 3) Switch back to my own homemade thing I hope this mail doesn't sound too harsh. For me libraries are meant to be used as black boxes, but unfortunately I regularly end up in spitting through source code because of some mysterious crash or exception (which ofc you don't know if it is your fault or library)
participants (1)
-
gast128