Results 1 to 5 of 5

Thread: Unit tests can not be executed

  1. #1
    Join Date
    Jan 2012
    Posts
    7
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Unit tests can not be executed

    Hello,

    I am having trouble executing the newly created template unit tests. By template I mean those created by the Qt Creator.

    I create a new unit test the standard way:

    File -> New file or project -> Other project -> Qt Unit test

    and select everything default. The problem is that when I run the test from the Qt Creator, all that happens is that the Terminal (Ubuntu) opens. The terminal itself does nothing. It is just an empty console.

    Previously, the behaviour was something like this:

    Qt Code:
    1. ********* Start testing of IntervalTest *********
    2. Config: Using QTest library 4.8.1, Qt 4.8.1
    3. PASS : IntervalTest::initTestCase()
    4. PASS : IntervalTest::testContains()
    5. PASS : IntervalTest::cleanupTestCase()
    6. Totals: 3 passed, 0 failed, 0 skipped
    7. ********* Finished testing of IntervalTest *********
    To copy to clipboard, switch view to plain text mode 

    Int the "Application Output" of the Qt Creator. But now nothing happens.

    I tried to compare the .pro files of old Unit tests that are running without problem but I cannot find any discernible difference. Also the build configurations seem to be the same.

    I started having this problem only recently, so I have no Idea what is causing it. Please help. I am using gcc on Ubuntu.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Unit tests can not be executed

    You'll probably find the output in the Qt Creator output pane if is is not appearing in the console.

    If the terminal is not useful then in the Qt Creator run settings for the test executable untick the "Run in terminal" option.

  3. #3
    Join Date
    Jan 2012
    Posts
    7
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Unit tests can not be executed

    Thank you, but the problem is that there is no output in the pane. There is just:

    Starting /home/martin/Projects/ExtendedRealLine-build-desktop-Qt_in_PATH_Debug/tst_extendedreallinetest...
    And nothing else. The The program cannot even be debugged using the Qt Creator debugger. The unit test is "empty" so it should end in a fraction of second, but it continues to "run" until I terminate it

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Unit tests can not be executed

    Hmm, odd. The terminal window tends to hang around after the program terminates, displaying "Press <RETURN> to close this window..." (even if the program output nothing) on my machine. The template test code doesn't loop or do anything except run top-to-bottom. Perhaps the program is not being found or failing to start. Have you checked the run settings closely?

    Can you run the compiled test program manually from a command prompt?

  5. The following user says thank you to ChrisW67 for this useful post:

    Martin Drozdik (24th May 2012)

  6. #5
    Join Date
    Jan 2012
    Posts
    7
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Unit tests can not be executed

    So I tried to execute the test from the command line. It works. But suddenly when I tried to execute the test from the Qt Creator, I got

    Cannot connect creator comm socket /tmp/qt_temp.jF2050/stub-socket: No such file or directory
    Press <RETURN> to close this window...
    In the previously blank Terminal window. After I unticked the "Run in terminal" option as you suggested earlier, I am able to run the test in the Qt Creator pane as usual. That is all I wanted

    Thanks again!

Similar Threads

  1. Replies: 3
    Last Post: 11th November 2012, 21:17
  2. How to write automated tests for my app?
    By oficjalne100 in forum Qt Programming
    Replies: 4
    Last Post: 13th March 2012, 06:06
  3. Qt unit testing using Google Tests
    By Archa4 in forum Newbie
    Replies: 4
    Last Post: 11th May 2011, 10:35
  4. I do not understand as to start qt tests for gui
    By Chexov in forum Qt Programming
    Replies: 0
    Last Post: 15th April 2010, 15:50
  5. Unit tests
    By leoalvesmachado in forum Newbie
    Replies: 1
    Last Post: 13th April 2010, 20:50

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.