summaryrefslogtreecommitdiffstats
path: root/src/testlib/qabstracttestlogger.cpp
diff options
context:
space:
mode:
authorThiago Macieira <[email protected]>2022-10-24 17:49:49 -0700
committerThiago Macieira <[email protected]>2022-11-09 20:34:12 -0800
commitf341e99aab9393430b588f8824ecb64fb75583d2 (patch)
tree84e4f0fd113ff536a2671dff916ee841d5f53893 /src/testlib/qabstracttestlogger.cpp
parent0e8eb20af43ca473b7a7639bb2941c9e6bad537b (diff)
QPlainTestLogger: don't print "RESULT" before each additional result
We do that by passing the full list of results to the logger, to a virtual that is present in the base class to call the existing function. For all but the plain logger, we'll just print multiple results. The plain logger now prints: RESULT : tst_MyClass::QString_toInt() 383 nsecs per iteration (total: 3,837,324, iterations: 10000) 1,069 CPU cycles per iteration (total: 10,692,457, iterations: 10000) 3,123 instructions per iteration (total: 31,230,101, iterations: 10000) 536 branch instructions per iteration (total: 5,360,022, iterations: 10000) Change-Id: I3c79b7e08fa346988dfefffd17203cb5802693dd Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Fabian Kosmale <[email protected]>
Diffstat (limited to 'src/testlib/qabstracttestlogger.cpp')
-rw-r--r--src/testlib/qabstracttestlogger.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/testlib/qabstracttestlogger.cpp b/src/testlib/qabstracttestlogger.cpp
index 08fdade90bd..596799f5c44 100644
--- a/src/testlib/qabstracttestlogger.cpp
+++ b/src/testlib/qabstracttestlogger.cpp
@@ -3,6 +3,7 @@
#include <QtTest/private/qabstracttestlogger_p.h>
#include <QtTest/qtestassert.h>
+#include <qbenchmark_p.h>
#include <qtestresult_p.h>
#include <QtCore/qbytearray.h>
@@ -222,6 +223,12 @@ void QAbstractTestLogger::stopLogging()
{
}
+void QAbstractTestLogger::addBenchmarkResults(const QList<QBenchmarkResult> &result)
+{
+ for (const auto &m : result)
+ addBenchmarkResult(m);
+}
+
/*!
\fn void QAbstractTestLogger::enterTestFunction(const char *function)