|
Boost Users : |
Subject: Re: [Boost-users] [boost.test] parsing runtime arguments
From: Raffi Enficiaud (raffi.enficiaud_at_[hidden])
Date: 2018-08-24 14:02:22
On 12.08.18 20:17, Olaf Peter via Boost-users wrote:
> Hi,
> 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:
>
> fixture::fixture()
> {
> Â Â Â 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.
>
> Thanks,
> Olaf
Also, for installing the global fixture, please use the new macro
BOOST_TEST_GLOBAL_FIXTURE.
Raffi
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net