CodeCoverage: Move installCoverageTool call.
authorCaroline Chao <caroline.chao@nokia.com>
Fri, 17 Feb 2012 08:37:15 +0000 (09:37 +0100)
committerQt by Nokia <qt-info@nokia.com>
Wed, 22 Feb 2012 06:25:49 +0000 (07:25 +0100)
Call it from qtest_qParseArgs() instead of qExec(). This will allow to
remove the code coverage calls from quicktest.

Both the installation and the saving of code coverage data are now
gathered in testlib.

Change-Id: If3baedb0cff9d894e6f232b947af7e3158703d9d
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
src/testlib/qtestcase.cpp

index 0b5f636..e867b96 100644 (file)
@@ -1449,6 +1449,9 @@ Q_TESTLIB_EXPORT void qtest_qParseArgs(int argc, char *argv[], bool qml)
         }
     }
 
+    bool installedTestCoverage = installCoverageTool(QTestResult::currentAppname(), QTestResult::currentTestObjectName());
+    QTestLog::setInstalledTestCoverage(installedTestCoverage);
+
     // If no loggers were created by the long version of the -o command-line
     // option, create a logger using whatever filename and format were
     // set using the old-style command-line options.
@@ -1987,9 +1990,6 @@ int QTest::qExec(QObject *testObject, int argc, char **argv)
 
     qtest_qParseArgs(argc, argv, false);
 
-    bool installedTestCoverage = installCoverageTool(argv[0], metaObject->className());
-    QTestLog::setInstalledTestCoverage(installedTestCoverage);
-
 #ifdef QTESTLIB_USE_VALGRIND
     if (QBenchmarkGlobalData::current->mode() == QBenchmarkGlobalData::CallgrindParentProcess) {
         const QStringList origAppArgs(QCoreApplication::arguments());