简体   繁体   中英

Boost Unit Test timing mechanism

Is there some built-in mechanism in the Boost Unit Test framework to check for timing issues. For example to:

  • Report timing of every test

  • Check for tests exceeding a given time limit

  • Any thing time related you know of

I've tried to use the command line parameter such as --report_level or --log_level, but it didn't report anything related to timing.

Thanks

  1. You can specify timeout for the test case
  2. Boost.Test report time for each test unit in detailed report mode
  3. I am looking to implement much more advanced tools for timing tests soon(ish)
  1. Report timing of every test: For Boost.Test to report timings, you need to specify "--report_level=detailed --log_level=all". The test timings will be lost in the output but will look like :

Leaving test case "my_test_1"; testing time: 220mks
Leaving test case"my_test_2"; testing time: 219mks
...

  1. Check for tests exceeding a given time limit : I have never tested it, but boost test framework offers a decorator timeout

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM