boost unit tests and command line args
I have some unit tests that all use BOOST_AUTO_TEST_CASE. Is there a way for me to hook into the main function before any of my test cases are run to perform initialization, involving the command line arguments that were passed to the executable? Currently there is no main function, it's defined inside the boost headers, and I don't see an obvious way of hooking into it.
Zachary Turner wrote:
I have some unit tests that all use BOOST_AUTO_TEST_CASE. Is there a way for me to hook into the main function before any of my test cases are run to perform initialization, involving the command line arguments that were passed to the executable? Currently there is no main function, it's defined inside the boost headers, and I don't see an obvious way of hooking into it.
You can use global fixture. Command line arguments are available through the master test suite. All Boost.Test specific CLAs are going to be removed by this time. Gennadiy
participants (2)
-
Gennadiy Rozental
-
Zachary Turner