[Boost.test] [BOOST_AUTO_TEST_CASE] accessing argc and argv

Hi, I am trying to learn to use the Boost.Test framework and have read through the online documents explaining how to use Boost.Test. I have been unable to find how to access the argc and argv variables while using BOOST_AUTO_TEST_CASE with "BOOST_AUTO_TEST_MAIN" defined. So my question is using "The automatic registration facility" (http://tinyurl.com/y2en48) is it possible to access argc and argv? If not does that mean I have to define a "boost::unit_test::test_suite* init_unit_test_suite ( int argc, char* argv[] )" and use these variables? Thanks, Peter.

Peter
is it possible to access argc and argv?
I had the same problem. You can use boost::unit_test::auto_unit_test_suite()->argc and boost::unit_test::auto_unit_test_suite()->argv. Regards.

"Rob Caldecott"
Peter
writes: is it possible to access argc and argv?
I had the same problem. You can use boost::unit_test::auto_unit_test_suite()->argc and boost::unit_test::auto_unit_test_suite()->argv.
Correct interface in 1.34.0 is: boost::unit_test::master_test_suite()->argc and boost::unit_test::master_test_suite()->argv. In a future this interface may be revisited though. See Boost.Test examples also. Genandiy
participants (3)
-
Gennadiy Rozental
-
Peter
-
Rob Caldecott