6

I need a behavior of non-existing option test_launcher --exclude_test='Benchmark*'? Is there a working mechanism in Boost.Test that can be used to achieve the same?

Weston
  • 2,732
  • 1
  • 28
  • 34
bobah
  • 18,364
  • 2
  • 37
  • 70

2 Answers2

2

In the test filtering documentation see the discussion on Relative specification used with the command-line argument --run_test.

The disabler specification format is to preface the specification with an exclamation mark (!). So for your example the following will disable any enabled tests matching the pattern Benchmark*

test_launcher --run_test=!Benchmark*

Note that on linux you'll need to add quotes to prevent the asterisk and exclamation from getting interpreted

test_launcher --run_test='!Benchmark*'
Weston
  • 2,732
  • 1
  • 28
  • 34
0

You may use labels instead, as it is an easy way to logically group your tests.

Boost.test provides then powerful unit test filtering options from the command line, especially in your case the disabler modifier.

Raffi
  • 3,068
  • 31
  • 33