1

I have some widget application project on Qt 5.9.3. Now for a Unit testing I've created a new root "subdir" project, which contains my main application project and the new Qt test project:

enter image description here

Notice - how I create the root solution folder with an existing project:

  1. In Qt creator: File -> New File or Project -> Other Projects -> Subdirs Projects
  2. How to add an existing project to it: in subdirs project's .pro file append my existing project name and *copy the existing project's folder to the solution folder.
  3. Create new test project through File -> New File or Project -> Other Projects -> Qt Unit Test -> Next -> ... -> Add as subproject to project 'my_solution'.pro.

.pro SUBDIRS

Folders

Now I need to run the test project automatically before the main application start. How this can be done in Qt Creator (4.4.1)? What I have now in the solution project settings:

enter image description here

enter image description here

Any ideas? Is it possible to make two such tasks sequentially? How do you make auto start for unit tests in Qt Creator?

Vladimir Bershov
  • 2,701
  • 2
  • 21
  • 51
  • 1
    I don't believe you can automate this in such a way that works with the Qt Creator unit test user interface. But at the end of the day each unit test project is just compiled into an executable so you could create another project to run all your unit tests in a terminal or something and add that as a custom executable step in your run or build configurations. That being said it would certainly be much simpler to add a comfortable keybind for the 'run all tests' menu option and learn to live with it. – aatwo Feb 09 '18 at 09:56

0 Answers0