简体   繁体   English

升压单元测试计时机制

[英]Boost Unit Test timing mechanism

Is there some built-in mechanism in the Boost Unit Test framework to check for timing issues. Boost单元测试框架中是否存在一些内置机制来检查时序问题。 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. 我尝试使用命令行参数,例如--report_level或--log_level,但没有报告与计时相关的任何信息。

Thanks 谢谢

  1. You can specify timeout for the test case 您可以为测试用例指定超时
  2. Boost.Test report time for each test unit in detailed report mode 详细报告模式下每个测试单元的Boost.Test报告时间
  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". 报告每个测试的计时:为了让Boost.Test报告计时,您需要指定“ --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"; 离开测试用例“ my_test_1”; testing time: 220mks 测试时间:220mks
Leaving test case"my_test_2"; 离开测试用例“ my_test_2”; testing time: 219mks 测试时间:219mks
... ...

  1. Check for tests exceeding a given time limit : I have never tested it, but boost test framework offers a decorator timeout 检查是否超过给定时间限制的测试:我从未测试过,但是boost测试框架提供了装饰器超时

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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