Results 1 to 3 of 3

Thread: CMake project Unit test aren't visible in AutoTest plugin

  1. #1
    Join Date
    Feb 2007
    Location
    Wroclaw, Poland
    Posts
    72
    Thanks
    6
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default CMake project Unit test aren't visible in AutoTest plugin

    Hi,
    I've got small but mature project confgured by CMake. Plenty of UT test
    However I don't know WHAT my cmake is missing as AutoTest isn't detecting any tests. I've stumble on this where attached cmake project opened in QtCreator has been detected by AutoTest.
    I've analyzed both configuration. And I couldn't find any crucial differences. Beside fact that given example project use test prepared in cpp.
    I've even tried to analyze AT source code to find how it detects which file is which. And there I found only that AT doesn't care about project:
    In qtest/qttestparser.cpp I found some logic around Cpp code model which should detect if this file is ie. including QtTest.

    Perhaps here is the problem. First I split test to h and cpp file. Secondly - QTest::qExec is executed by TestRunner.

    Any help? What are conditions to decide - this is test file and this is how to use it.
    Last edited by T4ng10r; 11th December 2016 at 18:50.

  2. #2
    Join Date
    Feb 2007
    Location
    Wroclaw, Poland
    Posts
    72
    Thanks
    6
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: CMake project Unit test aren't visible in AutoTest plugin

    Hi,
    I would gladly debug interiors of this plugin.
    But how to do it? Beside placing plenty of qDebug prints only other possibility is to debug it interactively. Now, how to build it and how to run it? Are there any tutorial or specifications which describe this process?

  3. #3
    Join Date
    Feb 2007
    Location
    Wroclaw, Poland
    Posts
    72
    Thanks
    6
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: CMake project Unit test aren't visible in AutoTest plugin

    AutoTest looks for QTest::qExec calls to objects with private slots.
    I was using above mentioned TestRunner to avoid mulitple recompilation and this class made test classes hidden from AutoTest view.
    Case Closed.

Similar Threads

  1. Qml unit test
    By coder1998 in forum Qt Quick
    Replies: 5
    Last Post: 10th December 2015, 21:20
  2. How do I unit test a GUI
    By jolema in forum Newbie
    Replies: 3
    Last Post: 31st August 2015, 13:47
  3. Unit Test: Test if QPushButton has a menu
    By FelixB in forum Qt Programming
    Replies: 1
    Last Post: 7th November 2012, 12:12
  4. Problem when linking a Qt Unit Test with CMake
    By NoRulez in forum Qt Programming
    Replies: 6
    Last Post: 10th June 2010, 17:30
  5. How to unit test a Qt Gui
    By mitskits in forum Qt Programming
    Replies: 1
    Last Post: 20th January 2006, 07:36

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.