将测试添加到现有测试项目中

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

  1. 转到“File ” > “New File ”。
  2. 选择“Test Case ” > “Choose ”。
  3. 在“Test framework ”中,选择正在使用的测试框架。该框架必须与您要添加此文件的目标项目中使用的测试框架一致。

    “测试案例向导”中的“测试信息”对话框

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

注意: 除 Qt Test 外,此功能 仅支持基于代码的测试框架。单个 Qt 测试应用程序内不支持包含多个测试用例,建议为每个测试用例创建独立的测试子项目。

另请参阅 《如何:测试测试》。

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.