Add tests to existing test projects

To add a new file that has test cases to a project that contains a test project:

  1. Go to File > New File.
  2. Select Test Case > Choose.
  3. In Test framework, select the test framework in use. This has to match the test framework you are using inside the project you want to add this file to.

    {Test Information dialog}

The settings to specify depend on the selected test framework.

Note: This is only supported for code based test frameworks, except for Qt Tests. There is no official support for having multiple test cases inside a single Qt test application, and it is better to create a separate test sub project for each test case.

See also How To: Test, Testing, and Test Results.

© 2024 The Qt Company Ltd. 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.