summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks
diff options
context:
space:
mode:
Diffstat (limited to 'tests/benchmarks')
-rw-r--r--tests/benchmarks/benchmarks.pro4
-rw-r--r--tests/benchmarks/corelib/io/io.pro2
-rw-r--r--tests/benchmarks/corelib/io/qfileinfo/qfileinfo.pro2
-rw-r--r--tests/benchmarks/corelib/tools/qstring/qstring.pro1
-rw-r--r--tests/benchmarks/dbus/qdbustype/qdbustype.pro2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/functional.pro3
-rw-r--r--tests/benchmarks/gui/graphicsview/graphicsview.pro1
-rw-r--r--tests/benchmarks/gui/graphicsview/qgraphicslayout/qgraphicslayout.pro6
-rw-r--r--tests/benchmarks/gui/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp153
-rw-r--r--tests/benchmarks/gui/image/blendbench/main.cpp4
-rw-r--r--tests/benchmarks/gui/image/qpixmap/qpixmap.pro3
-rw-r--r--tests/benchmarks/gui/painting/qpainter/qpainter.pro3
-rw-r--r--tests/benchmarks/gui/painting/qtracebench/qtracebench.pro3
-rw-r--r--tests/benchmarks/gui/text/qtext/qtext.pro5
-rw-r--r--tests/benchmarks/network/kernel/kernel.pro3
-rwxr-xr-xtests/benchmarks/network/kernel/qhostinfo/qhostinfo.pro2
-rw-r--r--tests/benchmarks/opengl/opengl.pro4
17 files changed, 188 insertions, 13 deletions
diff --git a/tests/benchmarks/benchmarks.pro b/tests/benchmarks/benchmarks.pro
index b5e3a4b8b3..0831e6257e 100644
--- a/tests/benchmarks/benchmarks.pro
+++ b/tests/benchmarks/benchmarks.pro
@@ -3,10 +3,8 @@ SUBDIRS = \
corelib \
gui \
network \
- script \
- svg
+
contains(QT_CONFIG, opengl): SUBDIRS += opengl
-contains(QT_CONFIG, declarative): SUBDIRS += declarative
contains(QT_CONFIG, dbus): SUBDIRS += dbus
check-trusted.CONFIG += recursive
diff --git a/tests/benchmarks/corelib/io/io.pro b/tests/benchmarks/corelib/io/io.pro
index 97445d7c6c..15ae0d2101 100644
--- a/tests/benchmarks/corelib/io/io.pro
+++ b/tests/benchmarks/corelib/io/io.pro
@@ -3,7 +3,7 @@ SUBDIRS = \
qdir \
qdiriterator \
qfile \
- qfileinfo \
+ #qfileinfo \ # FIXME: broken
qiodevice \
qtemporaryfile
diff --git a/tests/benchmarks/corelib/io/qfileinfo/qfileinfo.pro b/tests/benchmarks/corelib/io/qfileinfo/qfileinfo.pro
index 3edf6a65c8..b628c0af41 100644
--- a/tests/benchmarks/corelib/io/qfileinfo/qfileinfo.pro
+++ b/tests/benchmarks/corelib/io/qfileinfo/qfileinfo.pro
@@ -6,6 +6,8 @@ INCLUDEPATH += .
QT -= gui
+QT += core-private
+
CONFIG += release
# Input
diff --git a/tests/benchmarks/corelib/tools/qstring/qstring.pro b/tests/benchmarks/corelib/tools/qstring/qstring.pro
index 5db9776b09..7460f8a4e4 100644
--- a/tests/benchmarks/corelib/tools/qstring/qstring.pro
+++ b/tests/benchmarks/corelib/tools/qstring/qstring.pro
@@ -1,6 +1,7 @@
load(qttest_p4)
TARGET = tst_bench_qstring
QT -= gui
+QT += core-private
SOURCES += main.cpp data.cpp fromlatin1.cpp fromutf8.cpp
wince*:{
diff --git a/tests/benchmarks/dbus/qdbustype/qdbustype.pro b/tests/benchmarks/dbus/qdbustype/qdbustype.pro
index d480a05f38..2f3edf074b 100644
--- a/tests/benchmarks/dbus/qdbustype/qdbustype.pro
+++ b/tests/benchmarks/dbus/qdbustype/qdbustype.pro
@@ -1,7 +1,7 @@
load(qttest_p4)
TARGET = tst_bench_qdbustype
QT -= gui
-QT += dbus
+QT += dbus dbus-private
QMAKE_CXXFLAGS += $$QT_CFLAGS_DBUS
LIBS_PRIVATE += $$QT_LIBS_DBUS
diff --git a/tests/benchmarks/gui/graphicsview/functional/functional.pro b/tests/benchmarks/gui/graphicsview/functional/functional.pro
index f8e122be89..3c2979448b 100644
--- a/tests/benchmarks/gui/graphicsview/functional/functional.pro
+++ b/tests/benchmarks/gui/graphicsview/functional/functional.pro
@@ -1,3 +1,4 @@
TEMPLATE = subdirs
SUBDIRS = \
- GraphicsViewBenchmark
+ #GraphicsViewBenchmark # FIXME: cannot be compiled by default as part of qtbase,
+ # since it depends on qtsvg
diff --git a/tests/benchmarks/gui/graphicsview/graphicsview.pro b/tests/benchmarks/gui/graphicsview/graphicsview.pro
index e4fed197e9..4a85df812e 100644
--- a/tests/benchmarks/gui/graphicsview/graphicsview.pro
+++ b/tests/benchmarks/gui/graphicsview/graphicsview.pro
@@ -3,6 +3,7 @@ SUBDIRS = \
functional \
qgraphicsanchorlayout \
qgraphicsitem \
+ #qgraphicslayout \ # FIXME: broken
qgraphicsscene \
qgraphicsview \
qgraphicswidget
diff --git a/tests/benchmarks/gui/graphicsview/qgraphicslayout/qgraphicslayout.pro b/tests/benchmarks/gui/graphicsview/qgraphicslayout/qgraphicslayout.pro
new file mode 100644
index 0000000000..19e2979d98
--- /dev/null
+++ b/tests/benchmarks/gui/graphicsview/qgraphicslayout/qgraphicslayout.pro
@@ -0,0 +1,6 @@
+load(qttest_p4)
+TEMPLATE = app
+TARGET = tst_bench_qgraphicslayout
+
+SOURCES += tst_qgraphicslayout.cpp
+
diff --git a/tests/benchmarks/gui/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp b/tests/benchmarks/gui/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp
new file mode 100644
index 0000000000..4bdcfb3ecf
--- /dev/null
+++ b/tests/benchmarks/gui/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp
@@ -0,0 +1,153 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtTest/QtTest>
+#include <QtGui/qgraphicslayout.h>
+#include <QtGui/qgraphicslinearlayout.h>
+#include <QtGui/qgraphicswidget.h>
+#include <QtGui/qgraphicsview.h>
+
+class tst_QGraphicsLayout : public QObject
+{
+ Q_OBJECT
+public:
+ tst_QGraphicsLayout() {}
+ ~tst_QGraphicsLayout() {}
+
+private slots:
+ void invalidate();
+};
+
+
+class RectWidget : public QGraphicsWidget
+{
+public:
+ RectWidget(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0) : QGraphicsWidget(parent, wFlags), setGeometryCalls(0) {}
+
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
+ {
+ Q_UNUSED(option);
+ Q_UNUSED(widget);
+ painter->drawRoundRect(rect());
+ painter->drawLine(rect().topLeft(), rect().bottomRight());
+ painter->drawLine(rect().bottomLeft(), rect().topRight());
+ }
+
+ void setGeometry(const QRectF &rect)
+ {
+ //qDebug() << "setGeometry():" << this->data(0).toString();
+ setGeometryCalls->insert(this, rect);
+ QGraphicsWidget::setGeometry(rect);
+ }
+
+ void callUpdateGeometry() {
+ QGraphicsWidget::updateGeometry();
+ }
+
+ QMap<RectWidget*, QRectF> *setGeometryCalls;
+};
+
+/**
+ * Test to see how much time is needed to resize all widgets in a
+ * layout-widget-layout-widget-.... hierarchy from the point where a
+ * leaf widget changes its size hint. (updateGeometry() is called).
+ *
+ * If you run the test for 4.7 you'll get some really high numbers, but
+ * that's because they also include painting (and possible processing of
+ * some other events).
+ */
+void tst_QGraphicsLayout::invalidate()
+{
+ QGraphicsLayout::setInstantInvalidatePropagation(true);
+ QGraphicsScene scene;
+ QGraphicsView *view = new QGraphicsView(&scene);
+ QMap<RectWidget*, QRectF> setGeometryCalls;
+
+ RectWidget *window = new RectWidget(0, Qt::Window);
+ window->setGeometryCalls = &setGeometryCalls;
+ window->setData(0, QString(QChar('a')));
+
+ scene.addItem(window);
+ RectWidget *leaf = 0;
+ const int depth = 100;
+ RectWidget *parent = window;
+ for (int i = 1; i < depth; ++i) {
+ QGraphicsLinearLayout *l = new QGraphicsLinearLayout(parent);
+ l->setContentsMargins(0,0,0,0);
+ RectWidget *child = new RectWidget;
+ child->setData(0, QString(QChar('a' + i)));
+ child->setGeometryCalls = &setGeometryCalls;
+ l->addItem(child);
+ parent = child;
+ }
+ leaf = parent;
+ leaf->setMinimumSize(QSizeF(1,1));
+
+ view->show();
+
+ QTest::qWaitForWindowShown(view);
+
+ // ...then measure...
+
+ int pass = 1;
+
+ // should be as small as possible, to reduce overhead of painting
+ QSizeF size(1, 1);
+ setGeometryCalls.clear();
+ QBENCHMARK {
+ leaf->setMinimumSize(size);
+ leaf->setMaximumSize(size);
+ while (setGeometryCalls.count() < depth) {
+ QApplication::sendPostedEvents();
+ }
+ // force a resize on each widget, this will ensure
+ // that each iteration will resize all 50 widgets
+ int w = int(size.width());
+ w^=2;
+ size.setWidth(w);
+ }
+ delete view;
+ QGraphicsLayout::setInstantInvalidatePropagation(false);
+}
+
+QTEST_MAIN(tst_QGraphicsLayout)
+
+#include "tst_qgraphicslayout.moc"
diff --git a/tests/benchmarks/gui/image/blendbench/main.cpp b/tests/benchmarks/gui/image/blendbench/main.cpp
index a16fd5a5fa..06c36e7298 100644
--- a/tests/benchmarks/gui/image/blendbench/main.cpp
+++ b/tests/benchmarks/gui/image/blendbench/main.cpp
@@ -208,9 +208,9 @@ void BlendBench::unalignedBlendArgb32()
uchar *srcMemory = static_cast<uchar*>(qMallocAligned((dimension * dimension * sizeof(quint32)) + 16, 16));
QFETCH(int, offset);
- srcMemory += (offset * sizeof(quint32));
+ uchar *imageSrcMemory = srcMemory + (offset * sizeof(quint32));
- QImage src(srcMemory, dimension, dimension, QImage::Format_ARGB32_Premultiplied);
+ QImage src(imageSrcMemory, dimension, dimension, QImage::Format_ARGB32_Premultiplied);
src.fill(0x87654321);
QPainter painter(&destination);
diff --git a/tests/benchmarks/gui/image/qpixmap/qpixmap.pro b/tests/benchmarks/gui/image/qpixmap/qpixmap.pro
index 201ac9ea99..72ce42faf4 100644
--- a/tests/benchmarks/gui/image/qpixmap/qpixmap.pro
+++ b/tests/benchmarks/gui/image/qpixmap/qpixmap.pro
@@ -1,4 +1,7 @@
load(qttest_p4)
+
+QT += gui-private
+
TEMPLATE = app
TARGET = tst_bench_qpixmap
diff --git a/tests/benchmarks/gui/painting/qpainter/qpainter.pro b/tests/benchmarks/gui/painting/qpainter/qpainter.pro
index 6603abafea..78b4f1a4e5 100644
--- a/tests/benchmarks/gui/painting/qpainter/qpainter.pro
+++ b/tests/benchmarks/gui/painting/qpainter/qpainter.pro
@@ -1,4 +1,7 @@
load(qttest_p4)
+
+QT += gui-private
+
TEMPLATE = app
TARGET = tst_bench_qpainter
diff --git a/tests/benchmarks/gui/painting/qtracebench/qtracebench.pro b/tests/benchmarks/gui/painting/qtracebench/qtracebench.pro
index 56ec8bbe4e..4f527f62b3 100644
--- a/tests/benchmarks/gui/painting/qtracebench/qtracebench.pro
+++ b/tests/benchmarks/gui/painting/qtracebench/qtracebench.pro
@@ -1,4 +1,7 @@
load(qttest_p4)
+
+QT += core-private gui-private
+
TEMPLATE = app
TARGET = tst_qtracebench
diff --git a/tests/benchmarks/gui/text/qtext/qtext.pro b/tests/benchmarks/gui/text/qtext/qtext.pro
index 1c18302a39..27465b0897 100644
--- a/tests/benchmarks/gui/text/qtext/qtext.pro
+++ b/tests/benchmarks/gui/text/qtext/qtext.pro
@@ -1,4 +1,7 @@
load(qttest_p4)
+
+QT += gui-private
+
TEMPLATE = app
TARGET = tst_bench_QText
@@ -11,4 +14,4 @@ symbian* {
DEPLOYMENT += addFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
-} \ No newline at end of file
+}
diff --git a/tests/benchmarks/network/kernel/kernel.pro b/tests/benchmarks/network/kernel/kernel.pro
index 1ec3071f03..02e6854f4a 100644
--- a/tests/benchmarks/network/kernel/kernel.pro
+++ b/tests/benchmarks/network/kernel/kernel.pro
@@ -1,3 +1,4 @@
TEMPLATE = subdirs
-SUBDIRS = \
+
+contains(QT_CONFIG,private-tests):SUBDIRS += \
qhostinfo
diff --git a/tests/benchmarks/network/kernel/qhostinfo/qhostinfo.pro b/tests/benchmarks/network/kernel/qhostinfo/qhostinfo.pro
index e621d50e45..d456620d5a 100755
--- a/tests/benchmarks/network/kernel/qhostinfo/qhostinfo.pro
+++ b/tests/benchmarks/network/kernel/qhostinfo/qhostinfo.pro
@@ -5,7 +5,7 @@ DEPENDPATH += .
INCLUDEPATH += .
QT -= gui
-QT += network
+QT += core-private network network-private
CONFIG += release
diff --git a/tests/benchmarks/opengl/opengl.pro b/tests/benchmarks/opengl/opengl.pro
index b510c2bb06..8646413bc7 100644
--- a/tests/benchmarks/opengl/opengl.pro
+++ b/tests/benchmarks/opengl/opengl.pro
@@ -4,9 +4,9 @@ TARGET = tst_bench_opengl
DEPENDPATH += .
INCLUDEPATH += .
-QT += opengl
+QT += core-private gui-private opengl opengl-private
# Input
SOURCES += main.cpp
-include(../trusted-benchmarks.pri) \ No newline at end of file
+include(../trusted-benchmarks.pri)