[boost.test] benchmarking support
hi boosters, i've been looking for benchmarking support for unit tests, but googling didn't produce any obvious results (and a wealth of spurious matches, so i may have missed something). what i have in mind is something akin to cppbench but for boost.test: http://blog.quibb.org/cppbench/ basically, something that allows repeating each test a number of times, and then time the total execution time per test. is this available? if not, can anyone recall any discussions on the subject? many thanks for your time, marco -- Constraint has encouraged not only economy, but also a certain elegance of design. -- Dennis Ritchie
Marco Craveiro wrote: hi boosters,
i've been looking for benchmarking support for unit tests, but googling didn't produce any obvious results (and a wealth of spurious matches, so i may have missed something). what i have in mind is something akin to cppbench but for boost.test:
basically, something that allows repeating each test a number of times, and then time the total execution time per test.
is this available? if not, can anyone recall any discussions on the subject?
many thanks for your time,
marco
hmmm - you can look at libs/serialization/test/performance to see how I've addressed the problem. Robert Ramey -- Constraint has encouraged not only economy, but also a certain elegance of design. -- Dennis Ritchie
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
On Wed, 2011-01-26 at 14:30 -0800, Robert Ramey wrote:
hmmm - you can look at libs/serialization/test/performance to see how I've addressed the problem.
thanks Robert, this looks like what i need. however, wouldn't it be easier to benchmark if one could do it directly from boost.test? - BOOST_AUTO_TEST_CASE(test_name, 10000 /*repetitions*/) - pass in a parameter in the command line to activate benchmarking, e.g. --benchmark. this results in running the test "repetitions" times; if not passed, runs only once - the timing is already done by boost.test so no changes there. do ppl think this is an acceptable approach? i'll raise a feature request if that's the case. many thanks marco -- Constraint has encouraged not only economy, but also a certain elegance of design. -- Dennis Ritchie
Marco Craveiro
On Wed, 2011-01-26 at 14:30 -0800, Robert Ramey wrote:
hmmm - you can look at libs/serialization/test/performance to see how I've addressed the problem.
thanks Robert, this looks like what i need. however, wouldn't it be easier to benchmark if one could do it directly from boost.test?
- BOOST_AUTO_TEST_CASE(test_name, 10000 /*repetitions*/) - pass in a parameter in the command line to activate benchmarking, e.g. --benchmark. this results in running the test "repetitions" times; if not passed, runs only once - the timing is already done by boost.test so no changes there.
do ppl think this is an acceptable approach? i'll raise a feature request if that's the case.
Some kind of benchmarking support has been sitting on my TODO list for very long. I have some ideas as to what can go there. I am open for anyone implementing the change in Boost.Test I can help with suggestion and review. I myself can't really find a time slot these days, but maybe I can try one of the weekends... Gennadiy
Gennadiy Rozental wrote:
Marco Craveiro
writes: On Wed, 2011-01-26 at 14:30 -0800, Robert Ramey wrote:
hmmm - you can look at libs/serialization/test/performance to see how I've addressed the problem.
thanks Robert, this looks like what i need. however, wouldn't it be easier to benchmark if one could do it directly from boost.test?
- BOOST_AUTO_TEST_CASE(test_name, 10000 /*repetitions*/) - pass in a parameter in the command line to activate benchmarking, e.g. --benchmark. this results in running the test "repetitions" times; if not passed, runs only once - the timing is already done by boost.test so no changes there.
do ppl think this is an acceptable approach? i'll raise a feature request if that's the case.
Hmmm - you've already said you need this, so your commited to doing the work anyway. Why not just do the work and submit it as a suggested patch/enhancement to the test system via the TRACK system. Robert Ramey
participants (3)
-
Gennadiy Rozental
-
Marco Craveiro
-
Robert Ramey