[openbeos] Re: Another Testing Suite suggestion

  • From: Tyler Dauwalder <tyler@xxxxxxxxxxxxx>
  • To: openbeos@xxxxxxxxxxxxx
  • Date: Sun, 22 Sep 2002 12:01:02 -0700

> how easy would it be to include speed tests in our test suite? That
> would be very interesting for many areas, especially the support team.
> So we could easily compare our implementation to the one of BeOS, just
> to be sure we are as fast as they are.

It is not difficult, in fact, the testing framework currently displays 
the amount of time consumed by each subtest. The way I have it setup up 
at the moment, those times are rounded up to milliseconds before being 
displayed, which may not give fine enough granularity for some of the 
tests. If so, it can be modified (times are recorded in microseconds). 

As it is currently implemented, you get this timing info without having 
to modify your tests whatsoever. If you wanted to do your own timing 
inside the test, there's no reason that wouldn't work too. I've just 
been using real_time_clock_usecs(). To display your results, be sure to 
use the BTestCase::Outputf() function instead of printf()/cout (it 
works as printf does). It doesn't really matter that much for 
single-threaded tests, but for multi-threaded tests your output won't 
necessarily get displayed when you expect it to otherwise.

I'm happy to help if anyone has any questions, or something seems 
broken. And I do intend to clean up the testing framework a little bit 
more if I ever get off my recently lazy butt and finish BMimeType. :-) 

-Tyler

Other related posts: