Qt Creator can't see tests in nested SUBDIRS project



  • I have a Qmake .pro project as the top level of a project, and it uses SUBDIRS to see the .pro files for the various components of the project that build either shared objects or an application executable. One of those subdirectories is for tests, and it has a .pro file that uses SUBDIRS to include all of my tests in the project tree. Which is neat, but Qt Creator can't see into the second level SUBDIRS project to make the tests show up in the Qt Creator UI as tests. Is there any way to fix that?

    If I make a test in the top level project, it shows up in the UI correctly. I just don't want to pollute the top level of the project with mostly tests such that the actual source is obscured when you are browsing it, and I don't want to wedge all of my tests for various components into a single test project that makes one test executable.


  • Lifetime Qt Champion

    Hi,

    If your hierarchy is all made of subdirs projects, you should see the tests properly.

    Can you show how your project is organised ?


  • Qt Champions 2017

    Hi @wrosecrans

    One of those subdirectories is for tests, and it has a .pro file that uses SUBDIRS to include all of my tests in the project tree.

    That is also the way Qt's and QtCreators sources are organized, and there is no problem resolving the nested structures for Creator.

    Which is neat, but Qt Creator can't see into the second level SUBDIRS project to make the tests show up in the Qt Creator UI as tests.

    It must depend on your setup, as it works in principle as said.

    • which test framework do you use? (QTest, GoogleTest)
    • can you show your .pro files?

    Regards



  • Gaaaaaah. So, I started trying to create a minimal example to show the behavior I was seeing, because my actual hierarchy of .pro and .pri files is too big and ugly to post fully, and as soon as I touched it to start making a clean example, the nested tests started showing up in the Qt Creator UI.

    It was using QTest rather than Google Test. I don't quite understand what I was doing wrong, but since I can't make a useful reproduction of what I had been seeing and the problem has gone away, you can just ignore me. :)


  • Qt Champions 2017

    @wrosecrans glad you got it working.

    so please mark this topic as SOLVED.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.