I am using QTestLib Library and QTest for running my unit tests. I am working on windows 7 and using Qt 4.8 with the MVSC 2010 compiler. When I run my test using:
QTest::qExec(TestDateDD/whateverTestClass);
I get the output in the console:
********* Start testing of TestDateDD *********
Config: Using QTest library 4.8.0, Qt 4.8.0
PASS : TestDateDD::initTestCase()
PASS : TestDateDD::testValidity()
FAIL! : TestDateDD::testMonth(2012/7/10) Compared values are not the same
Actual (date.longMonthName(date.month())): July
Expected (monthname): June
..\UnitTestingPlugiin\TestDateDD.cpp(38) : failure location
PASS : TestDateDD::cleanupTestCase()
Totals: 3 passed, 1 failed, 0 skipped
********* Finished testing of TestDateDD *********
However my requirement is to display this message in my GUI for each test slot. I did some research and found that the qtestlog.cpp uses its own messageHandler that manages the test outuput and displays the result as PASS or FAIL with the failure message,line number etc. Is there any way that I can handle this messageHandler of QTest for my GUI Application?