Opened 10 years ago

Last modified 10 years ago

#7082 new Feature Requests

Add support for benchmarking

Reported by: marco.craveiro@… Owned by: Gennadiy Rozental
Milestone: To Be Determined Component: test
Version: Boost 1.51.0 Severity: Not Applicable
Keywords: test benchmarking Cc:

Description

One useful thing with boost test would be to run the tests in a "benchmarking mode". The general idea is to be able to run many iterations of all tests to get an idea of their performance. I believe the following changes would be sufficient:

  • BOOST_AUTO_TEST_CASE could have an additional optional parameter: number_of_iterations. This is set by the user manually. For example: BOOST_AUTO_TEST_CASE(my_test_case, 10000). If not passed in, it would default to 1.
  • A new command line parameter would trigger benchmarking: say --benchmarking. When passed in, all tests would run number_of_ iterations times.
  • the elapsed time for a test would then be the accumulated time taken by all iterations

This would be great for nightlies.

This issue was discussed a bit on the mailing-list on this thread:

http://lists.boost.org/boost-users/2011/01/65790.php

Change History (1)

comment:1 by marco.craveiro@…, 10 years ago

It just occurred me that, as a side effect, setting number_of_iterations to zero is also a great way of ignoring tests. However, Gennadiy has stated there is already a solution for this particular problem:

http://lists.boost.org/boost-users/2012/07/75075.php

Note: See TracTickets for help on using tickets.