From 3a5f86d78452714f2a57772f33f8e6c6b49b6f22 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 6 Aug 2018 17:07:07 +0200 Subject: Add a feature to enable CodeCoverage analysis of testlib Based on Asmo Saarela's advice (QTPM-686), adapted on advice from FrogLogic support and converted to a feature so that the selftest and testlib qmake config can be co-ordinated. Task-number: QTPM-1385 Change-Id: Icd706f086009e1e08b3f8c5cd553f792402e28c0 Reviewed-by: Volker Hilsheimer --- src/testlib/qtestlog.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/testlib/qtestlog.cpp') diff --git a/src/testlib/qtestlog.cpp b/src/testlib/qtestlog.cpp index 1268730cc6..e7150260e5 100644 --- a/src/testlib/qtestlog.cpp +++ b/src/testlib/qtestlog.cpp @@ -73,6 +73,10 @@ QT_BEGIN_NAMESPACE static void saveCoverageTool(const char * appname, bool testfailed, bool installedTestCoverage) { #ifdef __COVERAGESCANNER__ +# if QT_CONFIG(testlib_selfcover) + __coveragescanner_teststate(QTestLog::failCount() > 0 ? "FAILED" : + QTestLog::passCount() > 0 ? "PASSED" : "SKIPPED"); +# else if (!installedTestCoverage) return; // install again to make sure the filename is correct. @@ -83,6 +87,7 @@ static void saveCoverageTool(const char * appname, bool testfailed, bool install __coveragescanner_testname(""); __coveragescanner_clear(); unsetenv("QT_TESTCOCOON_ACTIVE"); +# endif // testlib_selfcover #else Q_UNUSED(appname); Q_UNUSED(testfailed); -- cgit v1.2.3