8

Is there a way to repeatedly run a unit-test or a set of unit-tests in Boost test?

Let say I have the following:

BOOST_FIXTURE_TEST_SUITE(someSuite, someFixture)

BOOST_AUTO_TEST_CASE(someTest)
{
    ...
}

BOOST_AUTO_TEST_SUITE_END()

... and I'd like to run someTest with setup/teardown for let say 100 times.

manlio
  • 18,345
  • 14
  • 76
  • 126
marton
  • 81
  • 3

2 Answers2

1

You can always run your test program in a loop. I do not believe there is test case/suite level feature to do this now. Feel free to request one through the ticket.

Gennadiy Rozental
  • 1,905
  • 2
  • 13
  • 17
1

According to boost config there is no option to specify multiple times execution.

It is possible to use some Linux commands like:

for i in `seq 10`; do command; done
Roman Ivasyshyn
  • 118
  • 1
  • 8
  • This type of approach won't be suited when you want the command to generate a single report (e.g. JUnit). You'd have to strap together multiple reports into one. – celestialorb May 16 '23 at 05:39