Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Efficient compilation of QtTest subprojects

Efficient compilation of QtTest subprojects

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 101 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    M.Steinhilber
    wrote on last edited by
    #1

    Hello,

    I am struggling with the structure that (as it seems) most people use with QtTest. I did some research on recommended usage and it mostly boils down to the procedure described in https://forum.qt.io/topic/89038/how-to-properly-structure-qttest-project which is to use a subdir project either per class or per "function".

    In some examples the test projects include the whole project by using a shared .pri file with the main project. However that means that every subdir project will compile the whole project again and again for each test subproject.

    Of course you can insert only needed files into the test projects yourself, but at the cost of managing all the files. And although we try to have as few as possible dependencies for our classes, for some bigger service classes you still need quite some other classes to use and test them.

    So even then a lot of files would be compiled again and again for each test project where they are used. Which overall result in an immense time to compile all tests.

    Is there any way to use the subdirs test structure but reduce the compile work to once per class for all tests? Or any other way to make this more time efficient?

    Kind Regards

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Yes, put all your testable code in a library and then use it to build your tests in the same manner you use it for your application.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved