PDA

View Full Version : QTest with subdir. How to collect test summary with 'make check'



spachner
8th June 2016, 07:43
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

anda_skoa
8th June 2016, 19:51
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,
_

spachner
8th June 2016, 20:54
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.


make check TESTARGS="-silent"; echo $?
#Execution stop at first test error and $? is != 0


make -silent check TESTARGS="-silent"; echo $?
#Execution does not stop on test error and $? is always 0