0

I'm running boost unit-tests of a c++ project in eclipse (Version:2019-06), and would like to print some output.

cout does not print to the console during testing and boost own BOOST_TEST_MESSAGE doesnt output anything either. According to boost documentation (see answer to this question: How do I get BOOST_TEST_MESSAGE to display on the screen?) I should set log_level to 'message'.

When I add --log_level=message to 'Program Arguments' in Run Configurations I get the following message:

Test setup error: Fail to process runtime parameters: Unexpected repetition of the parameter log_level in the following position:

When i add the BOOST_TEST_LOG_LEVEL and/or log_level variables in the 'Environment' tab of Run Configurations, nothing happens.

What is the correct place to specify log-level for boost unit tests? Is there any other way to get output?

Ivana
  • 643
  • 10
  • 27

1 Answers1

0

Test messages, written using BOOST_TEST_MESSAGE("..."); will appear in eclipses own test output window if the message button, labelled i (see image) is toggled.

One caveat, this only happens when Boost test output is valid xml. If for example the code under test writes to cout it will break the xml and no output will be visible in eclipse, except a warning about malformed xml.

enter image description here

Ivana
  • 643
  • 10
  • 27