diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2018-08-06 17:07:07 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2019-01-24 15:51:13 +0000 |
commit | 3a5f86d78452714f2a57772f33f8e6c6b49b6f22 (patch) | |
tree | f7a6b66c73a76f87343a08c4b6456b6e7699ae99 /src/testlib/qtestlog.cpp | |
parent | f3de22b2117f083308a45cc3ed80979db421e274 (diff) |
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 <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/testlib/qtestlog.cpp')
-rw-r--r-- | src/testlib/qtestlog.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
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); |