Results 1 to 3 of 3

Thread: QTest with subdir. How to collect test summary with 'make check'

  1. #1
    Join Date
    May 2016
    Posts
    5
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default QTest with subdir. How to collect test summary with 'make check'

    Hi,

    I have a perfect running QTest setup including subdirs. As supposed I can execute all tests one after another with 'make check' at the toplevel makefile. Unfortunately I do not know how to get the overall success as a single result. I expected the make exit code should reflect the overall success result, which does not. The exit code of make (via shell variable $?) is always 0 even when a test failed and this binary returned a value != 0.

    What is way to collect all the exit status of all test binaries called by 'make check' ?

    regards

    spachner

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QTest with subdir. How to collect test summary with 'make check'

    I guess the "check" target does not run the tests as make commands, otherwise the first failing test would result in make aborting right there (just like it aborts then the compiler exits non-zero on any file).

    Cheers,
    _

  3. #3
    Join Date
    May 2016
    Posts
    5
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: QTest with subdir. How to collect test summary with 'make check'

    Thanks for your answer.

    No, everything is fine. I had an expection in a test and catched them around QTest::qExec(), but return 0 from main() by accident.

    spachner

    One more thing: When I call make with argument -silent, the make return is always 0, but does not stop when a test fails.

    Qt Code:
    1. make check TESTARGS="-silent"; echo $?
    2. #Execution stop at first test error and $? is != 0
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. make -silent check TESTARGS="-silent"; echo $?
    2. #Execution does not stop on test error and $? is always 0
    To copy to clipboard, switch view to plain text mode 
    Last edited by spachner; 8th June 2016 at 21:52.

Similar Threads

  1. unit test focus behavior with QTest
    By bob_smith in forum Qt Programming
    Replies: 7
    Last Post: 19th August 2015, 21:21
  2. Make one qthread check the state of the other
    By kindlychung in forum Qt Programming
    Replies: 3
    Last Post: 17th May 2014, 14:06
  3. Easy to collect video signals by PLC
    By wondertek in forum General Discussion
    Replies: 0
    Last Post: 16th October 2013, 09:03
  4. How can we make unit test for multithread in QT
    By learning_qt in forum Qt Programming
    Replies: 8
    Last Post: 15th January 2013, 17:09
  5. how to test slot using QTest?
    By hashb in forum Qt Programming
    Replies: 6
    Last Post: 14th December 2009, 05:22

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.