Steve -
I make enough timing measurements that I have functions handy to record t_start, t_end, and calculate t_elapsed using the high resolution windows timers. For the things I test, I'm able to calculate an estimated time and EXPECT_* that t_elapsed is within some percent.
It seems like gtest taking the measurement automatically is too coarse. For example should the interval include SetUp and TearDown for the Test? For the fixture? For the environment? What if instead we had a:
- Function to take a high resolution timestamp
- Function to calculate an elapsed interval
- Assertion that a float is between min and max limits
- Assertion that a float is within a percentage in each direction
That way you can measure any interval and check for failure with only 3 or 4 lines of code. And helpers would be nice because I reuse that code constantly.
One thing I would like to see at the TEST() level is a timeout, in case the software under test has deadlocked, that can stop the offending test and still run the subsequent tests. However that probably requires a subprocess and is discussed in more detail in other postings.
-joey