Boost logo

Boost Users :

Subject: [Boost-users] [boost.test] parsing runtime arguments
From: Olaf Peter (ope-devel_at_[hidden])
Date: 2018-08-12 18:17:08

how get an 'user' API for the boost.test like this:

testsuite_xyz -- --help

or even

testsuite_xyz -- --save-path=/foo

to get the user aspects. I know I can get the args by

 Â Â Â  int argc{ framework::master_test_suite().argc };
 Â Â Â  char** argv{ framework::master_test_suite().argv };

Further, at test/include/boost/test/utils/runtime/cla/parser.hpp are
some utils used by boost.test self. Anyway, the problem rises to get the
behaviour desribed above, simply using a global fixture with:

 Â Â Â  int argc{ utf::framework::master_test_suite().argc };
 Â Â Â  char** argv{ utf::framework::master_test_suite().argv };

 Â Â Â     for (int i = 0; i != argc; ++i) {
 Â Â Â         std::cerr << "test_observer_fixture: " << argv[i] << "\n";
 Â Â Â     }

doesn't give the expected results - all the BOOST_AUTO_TEST_SUITE test
cases are called even they depend on this arguments.


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at