aboutsummaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/objectcount/tst_objectcount.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-05-16 09:50:32 +0200
committerLiang Qi <liang.qi@qt.io>2017-05-16 08:30:34 +0000
commitd0748129835e5977c144874e5ccaf8a7e4fb0b54 (patch)
treef9aef03523768b73239a0e10ac13476ff7b9a1ff /tests/benchmarks/objectcount/tst_objectcount.cpp
parentc693c0eed9aee6f41dd838f36ad723ec2a5dcfa2 (diff)
tst_objectcount: use setBenchmarkResult() instead of print
Change-Id: Ieb435b6ac929da753cfff0b157d18d4218cb50d9 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'tests/benchmarks/objectcount/tst_objectcount.cpp')
-rw-r--r--tests/benchmarks/objectcount/tst_objectcount.cpp19
1 files changed, 6 insertions, 13 deletions
diff --git a/tests/benchmarks/objectcount/tst_objectcount.cpp b/tests/benchmarks/objectcount/tst_objectcount.cpp
index e4a7971e..d12f3293 100644
--- a/tests/benchmarks/objectcount/tst_objectcount.cpp
+++ b/tests/benchmarks/objectcount/tst_objectcount.cpp
@@ -88,18 +88,6 @@ void tst_ObjectCount::cleanup()
qtHookData[QHooks::RemoveQObject] = 0;
}
-template <typename T>
-static void printObjects(const QObjectList &objects)
-{
- std::cout << "RESULT tst_ObjectCount::" << QTest::currentTestFunction() << "():\"" << QTest::currentDataTag() << "\":" << std::endl;
- std::cout << " " << T::staticMetaObject.className() << "s: " << objects.count() << std::endl;
-
- if (qt_verbose) {
- for (QObject *object : objects)
- qInfo() << "\t" << object;
- }
-}
-
static void addTestRows(QQmlEngine *engine, const QString &sourcePath, const QString &targetPath, const QStringList &skiplist = QStringList())
{
// We cannot use QQmlComponent to load QML files directly from the source tree.
@@ -157,7 +145,12 @@ static void doBenchmark(QQmlEngine *engine, const QUrl &url)
objects += object;
}
- printObjects<T>(objects);
+ if (qt_verbose) {
+ for (QObject *object : objects)
+ qInfo() << "\t" << object;
+ }
+
+ QTest::setBenchmarkResult(objects.count(), QTest::Events);
}
void tst_ObjectCount::qobjects()