summaryrefslogtreecommitdiffstats
path: root/src/testlib/qtestcase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/testlib/qtestcase.cpp')
-rw-r--r--src/testlib/qtestcase.cpp25
1 files changed, 5 insertions, 20 deletions
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index 8a1d4bf44a..b76ff39de4 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -947,22 +947,6 @@ static void installCoverageTool(const char * appname, const char * testname)
#endif
}
-static void saveCoverageTool(const char * appname, bool testfailed)
-{
-#ifdef __COVERAGESCANNER__
- // install again to make sure the filename is correct.
- // without this, a plugin or similar may have changed the filename.
- __coveragescanner_install(appname);
- __coveragescanner_teststate(testfailed ? "FAILED" : "PASSED");
- __coveragescanner_save();
- __coveragescanner_testname("");
- __coveragescanner_clear();
-#else
- Q_UNUSED(appname);
- Q_UNUSED(testfailed);
-#endif
-}
-
namespace QTest
{
static QObject *currentTestObject = 0;
@@ -1970,10 +1954,13 @@ int QTest::qExec(QObject *testObject, int argc, char **argv)
const QMetaObject *metaObject = testObject->metaObject();
QTEST_ASSERT(metaObject);
- installCoverageTool(argv[0], metaObject->className());
-
QTestResult::setCurrentTestObject(metaObject->className());
+ QTestResult::setCurrentAppname(argv[0]);
+
qtest_qParseArgs(argc, argv, false);
+
+ installCoverageTool(argv[0], metaObject->className());
+
#ifdef QTESTLIB_USE_VALGRIND
if (QBenchmarkGlobalData::current->mode() == QBenchmarkGlobalData::CallgrindParentProcess) {
const QStringList origAppArgs(QCoreApplication::arguments());
@@ -2025,8 +2012,6 @@ int QTest::qExec(QObject *testObject, int argc, char **argv)
}
#endif
- saveCoverageTool(argv[0], QTestLog::failCount());
-
#ifdef QTESTLIB_USE_VALGRIND
if (QBenchmarkGlobalData::current->mode() == QBenchmarkGlobalData::CallgrindParentProcess)
return callgrindChildExitCode;