summaryrefslogtreecommitdiffstats
path: root/src/testlib/qxmltestlogger.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/testlib/qxmltestlogger.cpp')
-rw-r--r--src/testlib/qxmltestlogger.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/testlib/qxmltestlogger.cpp b/src/testlib/qxmltestlogger.cpp
index 3f77f152b5..b4035301d3 100644
--- a/src/testlib/qxmltestlogger.cpp
+++ b/src/testlib/qxmltestlogger.cpp
@@ -121,10 +121,16 @@ void QXmlTestLogger::startLogging()
" <QTestVersion>" QTEST_VERSION_STR "</QTestVersion>\n"
"</Environment>\n", qVersion());
outputString(buf.constData());
+ m_totalTime.start();
}
void QXmlTestLogger::stopLogging()
{
+ QTestCharBuffer buf;
+ QTest::qt_asprintf(&buf,
+ "<Duration msecs=\"%f\"/>\n",
+ m_totalTime.nsecsElapsed() / 1000000.);
+ outputString(buf.constData());
if (xmlmode == QXmlTestLogger::Complete) {
outputString("</TestCase>\n");
}
@@ -139,11 +145,19 @@ void QXmlTestLogger::enterTestFunction(const char *function)
xmlQuote(&quotedFunction, function);
QTest::qt_asprintf(&buf, "<TestFunction name=\"%s\">\n", quotedFunction.constData());
outputString(buf.constData());
+
+ m_functionTime.start();
}
void QXmlTestLogger::leaveTestFunction()
{
- outputString("</TestFunction>\n");
+ QTestCharBuffer buf;
+ QTest::qt_asprintf(&buf,
+ " <Duration msecs=\"%f\"/>\n"
+ "</TestFunction>\n",
+ m_functionTime.nsecsElapsed() / 1000000.);
+
+ outputString(buf.constData());
}
namespace QTest