Boost logo

Boost Users :

Subject: Re: [Boost-users] testing command-line interface using Boost.Test
From: Olaf Meeuwissen (olaf.meeuwissen_at_[hidden])
Date: 2011-09-27 19:17:14

Gennadiy Rozental <rogeeff_at_[hidden]> writes:

> Olaf Meeuwissen <olaf.meeuwissen <at>> writes:
>> My only problem now is that I have no clue how to get at or where to
>> look for the execution_monitor instance that I would need to change.
> You do not need execution_monitor instance. Yo ucan spacify runtime parameter
> using either environment variable or CLA --catch_system_error=no

True, but I would like to do this only for those tests that need it.
That is, only for those tests that use the test fixture that provides
the my_system() functionality. So if I have

  struct system_fixture {
    int run (const char *cmd) { return my_system (cmd); }

  BOOST_FIXTURE_TEST_CASE (test_false, system_fixture)
    BOOST_CHECK_EQUAL (EXIT_FAILURE, run ("false"));

  BOOST_AUTO_TEST_CASE (test_true)
    BOOST_CHECK_EQUAL (EXIT_SUCCESS, my_system ("true"));

I don't want system error caught for test_false but I do want them still
caught for test_true as that is not supposed to cause any.

The example is a bit contrived and overly simplistic but I hope you see
what I'm thinking of.

Thanks in advance,

Olaf Meeuwissen, LPIC-2           FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962               Help support software freedom

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