在现有测试项目中添加测试

在包含测试项目的项目中添加包含测试用例的新文件:

  1. 转到File >New File
  2. 选择Test Case >Choose
  3. Test framework 中,选择正在使用的测试框架。这必须与要将该文件添加到项目中的测试框架相匹配。

    测试用例向导中的测试信息对话框

要指定的设置取决于所选的测试框架。

注意: 除 Qt Tests 外,这仅支持基于代码的测试框架。官方不支持在一个 Qt Test 应用程序中包含多个测试用例,最好为每个测试用例创建一个单独的测试子项目。

另请参阅 "如何:测试""测试"和 "测试结果"。

Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.