2

I've been able to configure Boost Test to create a report when the tests are complete but what I'd also like to do is while running a set of tests to be able to print the pass/fail state of each test to the console as the tests are running.

So I started looking into how I might get access to the test_results and results_collector classes in Boost Test. But I can't figure it out.

Can anyone help?

ksl
  • 4,519
  • 11
  • 65
  • 106

2 Answers2

0

If you run the test executable with the --log_level=all flag it will print whether the checks failed or passed.

For more info on boost test runtime parameters check here.

Alexandru C.
  • 3,337
  • 1
  • 25
  • 27
  • Thanks for the reply but I'm already aware of that. I want to choose how to output the pass/fail details myself by using the test_results class (for example) but I can't figure out how to get a handle to it. – ksl Dec 23 '14 at 13:52
0

You can set up your own log formatter and register it like this.

The API has slightly changed in 1.62 but stays backward compatible. Your log formatter can manage its own log_level. Have a look at the boost.test log formatter existing implementations: some sequences can be a bit tricky.

Raffi
  • 3,068
  • 31
  • 33