summaryrefslogtreecommitdiffstats
path: root/src/testlib/qtestresult.cpp
diff options
context:
space:
mode:
authorCaroline Chao <caroline.chao@nokia.com>2012-01-23 12:55:21 +0100
committerQt by Nokia <qt-info@nokia.com>2012-02-07 12:43:34 +0100
commit36f5cc848de25251bfb1cae2ddeea0871ded1fac (patch)
tree465fb9cdcdfa93de540abb412219e32f9e2b9216 /src/testlib/qtestresult.cpp
parent6a75785f49ad11ab1cd026dc8cc2c765f003031f (diff)
CodeCoverage: Save coverage data in QTestLog::stopLogging()
Currently when tests are crashing, aborting or hanging, their status are reported with a status "Unknown" because SaveCoverageTool is never called for them. The status of the test given by the coverage tool should be the same as the one reported in the log output when the test is run. This change will allow more accuracy in the status reported. Add QTestResult::setCurrentAppname and QTestResult::currentAppname. To retrieve the name of the current application running. Task-number: QTQAINFRA-460 Change-Id: Icc476dc2d6cb28185e5447f1e79da6a8a31cad54 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Diffstat (limited to 'src/testlib/qtestresult.cpp')
-rw-r--r--src/testlib/qtestresult.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/testlib/qtestresult.cpp b/src/testlib/qtestresult.cpp
index 1fb5bddcbb..d6846f363b 100644
--- a/src/testlib/qtestresult.cpp
+++ b/src/testlib/qtestresult.cpp
@@ -64,6 +64,8 @@ namespace QTest
static const char *expectFailComment = 0;
static int expectFailMode = 0;
+
+ static const char *currentAppname = 0;
}
void QTestResult::reset()
@@ -313,4 +315,14 @@ bool QTestResult::skipCurrentTest()
return QTest::skipCurrentTest;
}
+void QTestResult::setCurrentAppname(const char *appname)
+{
+ QTest::currentAppname = appname;
+}
+
+const char *QTestResult::currentAppname()
+{
+ return QTest::currentAppname;
+}
+
QT_END_NAMESPACE