diff options
author | Liang Qi <liang.qi@qt.io> | 2017-05-29 10:30:39 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-06-06 15:59:38 +0200 |
commit | c254cec22a2352a3fcab60244a6ab74f95d45ace (patch) | |
tree | d8456def48b09bd3914eb87c57ab53376f92c14f /tests/benchmarks | |
parent | c158ca8be49a75026e83751dfd825c5bdd63189a (diff) | |
parent | 3f9367cb32533b691cb8c761213f21a524e3d1cb (diff) |
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts:
.qmake.conf
src/qml/jsruntime/qv4argumentsobject.cpp
src/qml/jsruntime/qv4arraydata.cpp
src/qml/jsruntime/qv4context.cpp
src/qml/jsruntime/qv4context_p.h
src/qml/jsruntime/qv4errorobject.cpp
src/qml/jsruntime/qv4functionobject.cpp
src/qml/jsruntime/qv4internalclass.cpp
src/qml/jsruntime/qv4lookup.cpp
src/qml/jsruntime/qv4managed.cpp
src/qml/jsruntime/qv4managed_p.h
src/qml/jsruntime/qv4object.cpp
src/qml/jsruntime/qv4object_p.h
src/qml/jsruntime/qv4qmlcontext.cpp
src/qml/jsruntime/qv4runtime.cpp
src/qml/jsruntime/qv4vme_moth.cpp
src/qml/memory/qv4heap_p.h
src/qml/memory/qv4mm.cpp
src/qml/memory/qv4mm_p.h
src/qml/memory/qv4mmdefs_p.h
src/quick/scenegraph/util/qsgdistancefieldutil.cpp
src/quick/scenegraph/util/qsgdistancefieldutil_p.h
tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
Change-Id: I7ed925d4f5d308f872a58ddf51fdce0c8494ec9c
Diffstat (limited to 'tests/benchmarks')
18 files changed, 39 insertions, 325 deletions
diff --git a/tests/benchmarks/benchmarks.pro b/tests/benchmarks/benchmarks.pro index 5e6bc65815..07a6d5ecaa 100644 --- a/tests/benchmarks/benchmarks.pro +++ b/tests/benchmarks/benchmarks.pro @@ -1,5 +1,5 @@ TEMPLATE = subdirs -SUBDIRS = qml script +SUBDIRS = qml qtConfig(private_tests) { qtConfig(opengl(es1|es2)?):SUBDIRS += particles } diff --git a/tests/benchmarks/particles/affectors/affectors.pro b/tests/benchmarks/particles/affectors/affectors.pro index 3351228a4b..35e1f514cc 100644 --- a/tests/benchmarks/particles/affectors/affectors.pro +++ b/tests/benchmarks/particles/affectors/affectors.pro @@ -1,10 +1,10 @@ -CONFIG += benchmark +# This benchmark is broken, see QTBUG-60621 +#CONFIG += benchmark +TEMPLATE = app TARGET = tst_affectors SOURCES += tst_affectors.cpp macx:CONFIG -= app_bundle -testDataFiles.files = data -testDataFiles.path = . -DEPLOYMENT += testDataFiles +DEFINES += SRCDIR=\\\"$$PWD\\\" QT += quickparticles-private testlib diff --git a/tests/benchmarks/particles/affectors/tst_affectors.cpp b/tests/benchmarks/particles/affectors/tst_affectors.cpp index 99d175564b..4c611c6faa 100644 --- a/tests/benchmarks/particles/affectors/tst_affectors.cpp +++ b/tests/benchmarks/particles/affectors/tst_affectors.cpp @@ -48,6 +48,11 @@ tst_affectors::tst_affectors() { } +inline QUrl TEST_FILE(const QString &filename) +{ + return QUrl::fromLocalFile(QLatin1String(SRCDIR) + QLatin1String("/data/") + filename); +} + void tst_affectors::test_basic_data() { QTest::addColumn<int> ("dt"); @@ -69,7 +74,7 @@ void tst_affectors::test_filtered_data() void tst_affectors::test_basic() { QFETCH(int, dt); - QQuickView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml"); + QQuickView* view = createView(TEST_FILE("basic.qml")); QQuickParticleSystem* system = view->rootObject()->findChild<QQuickParticleSystem*>("system"); //Pretend we're running, but we manually advance the simulation system->m_running = true; @@ -109,7 +114,7 @@ void tst_affectors::test_basic() void tst_affectors::test_filtered() { QFETCH(int, dt); - QQuickView* view = createView(QCoreApplication::applicationDirPath() + "/data/filtered.qml"); + QQuickView* view = createView(TEST_FILE("filtered.qml")); QQuickParticleSystem* system = view->rootObject()->findChild<QQuickParticleSystem*>("system"); //Pretend we're running, but we manually advance the simulation system->m_running = true; diff --git a/tests/benchmarks/particles/emission/emission.pro b/tests/benchmarks/particles/emission/emission.pro index f6730e60ff..963346ebdd 100644 --- a/tests/benchmarks/particles/emission/emission.pro +++ b/tests/benchmarks/particles/emission/emission.pro @@ -1,4 +1,5 @@ -CONFIG += benchmark +# This benchmark is broken, see QTBUG-60621 +#CONFIG += benchmark TARGET = tst_emission SOURCES += tst_emission.cpp macx:CONFIG -= app_bundle diff --git a/tests/benchmarks/qml/animation/tst_animation.cpp b/tests/benchmarks/qml/animation/tst_animation.cpp index 59f5a57f5c..27622ed013 100644 --- a/tests/benchmarks/qml/animation/tst_animation.cpp +++ b/tests/benchmarks/qml/animation/tst_animation.cpp @@ -41,8 +41,11 @@ public: private slots: void abstractAnimation(); + +#if defined(QT_BUILD_INTERNAL) void bulkValueAnimator(); void propertyUpdater(); +#endif void animationtree_qml(); @@ -75,6 +78,7 @@ void tst_animation::abstractAnimation() } } +#if defined(QT_BUILD_INTERNAL) void tst_animation::bulkValueAnimator() { QBENCHMARK { @@ -90,6 +94,7 @@ void tst_animation::propertyUpdater() delete updater; } } +#endif // QT_BUILD_INTERNAL void tst_animation::animationtree_qml() { diff --git a/tests/benchmarks/qml/js/js.pro b/tests/benchmarks/qml/js/js.pro index 7711e7130d..b1448d8eb8 100644 --- a/tests/benchmarks/qml/js/js.pro +++ b/tests/benchmarks/qml/js/js.pro @@ -1,7 +1,7 @@ TEMPLATE = subdirs SUBDIRS = \ qjsengine \ -# qjsvalue \ ### FIXME: doesn't build + qjsvalue \ qjsvalueiterator \ TRUSTED_BENCHMARKS += \ diff --git a/tests/benchmarks/qml/js/qjsengine/qjsengine.pro b/tests/benchmarks/qml/js/qjsengine/qjsengine.pro index e49a48f779..c4aba78756 100644 --- a/tests/benchmarks/qml/js/qjsengine/qjsengine.pro +++ b/tests/benchmarks/qml/js/qjsengine/qjsengine.pro @@ -1,6 +1,8 @@ +CONFIG += benchmark TEMPLATE = app TARGET = tst_bench_qjsengine SOURCES += tst_qjsengine.cpp QT += qml testlib +macos:CONFIG -= app_bundle diff --git a/tests/benchmarks/qml/js/qjsengine/tst_qjsengine.cpp b/tests/benchmarks/qml/js/qjsengine/tst_qjsengine.cpp index 9da310d976..d13751385c 100644 --- a/tests/benchmarks/qml/js/qjsengine/tst_qjsengine.cpp +++ b/tests/benchmarks/qml/js/qjsengine/tst_qjsengine.cpp @@ -324,7 +324,7 @@ void tst_QJSEngine::newQObject() { newEngine(); QBENCHMARK { - (void)m_engine->newQObject(QCoreApplication::instance()); + (void)m_engine->newQObject(new QObject); } } diff --git a/tests/benchmarks/qml/js/qjsvalue/qjsvalue.pro b/tests/benchmarks/qml/js/qjsvalue/qjsvalue.pro index c646613799..edfb619608 100644 --- a/tests/benchmarks/qml/js/qjsvalue/qjsvalue.pro +++ b/tests/benchmarks/qml/js/qjsvalue/qjsvalue.pro @@ -5,3 +5,4 @@ TARGET = tst_bench_qjsvalue SOURCES += tst_qjsvalue.cpp QT += qml testlib +macos:CONFIG -= app_bundle diff --git a/tests/benchmarks/qml/js/qjsvalue/tst_qjsvalue.cpp b/tests/benchmarks/qml/js/qjsvalue/tst_qjsvalue.cpp index 5cb0f2f44b..7488d613e5 100644 --- a/tests/benchmarks/qml/js/qjsvalue/tst_qjsvalue.cpp +++ b/tests/benchmarks/qml/js/qjsvalue/tst_qjsvalue.cpp @@ -943,7 +943,7 @@ void tst_QJSValue::defineStandardTestValues() QTest::newRow("regexp") << m_engine->evaluate("new RegExp('foo')"); QTest::newRow("error") << m_engine->evaluate("new Error"); - QTest::newRow("qobject") << m_engine->newQObject(this); + QTest::newRow("qobject") << m_engine->newQObject(new QObject); #if 0 // no qmetaobject QTest::newRow("qmetaobject") << m_engine->newQMetaObject(&QJSEngine::staticMetaObject); #endif diff --git a/tests/benchmarks/qml/qml.pro b/tests/benchmarks/qml/qml.pro index f1fe87e532..437d13c87e 100644 --- a/tests/benchmarks/qml/qml.pro +++ b/tests/benchmarks/qml/qml.pro @@ -9,7 +9,7 @@ SUBDIRS += \ qqmlcomponent \ qqmlmetaproperty \ librarymetrics_performance \ -# script \ ### FIXME: doesn't build + script \ js \ creation diff --git a/tests/benchmarks/qml/qqmlchangeset/tst_qqmlchangeset.cpp b/tests/benchmarks/qml/qqmlchangeset/tst_qqmlchangeset.cpp index bbfb52343c..cdbec699dc 100644 --- a/tests/benchmarks/qml/qqmlchangeset/tst_qqmlchangeset.cpp +++ b/tests/benchmarks/qml/qqmlchangeset/tst_qqmlchangeset.cpp @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2016 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Milian Wolff <milian.wolff@kdab.com> -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Milian Wolff <milian.wolff@kdab.com> +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/tests/benchmarks/qml/qqmldebugtrace/qqmldebugtrace.pro b/tests/benchmarks/qml/qqmldebugtrace/qqmldebugtrace.pro deleted file mode 100644 index 556842af80..0000000000 --- a/tests/benchmarks/qml/qqmldebugtrace/qqmldebugtrace.pro +++ /dev/null @@ -1,8 +0,0 @@ -CONFIG += benchmark -QT += qml testlib -TEMPLATE = app -TARGET = tst_qqmldebugtrace -macx:CONFIG -= app_bundle - -SOURCES += tst_qqmldebugtrace.cpp - diff --git a/tests/benchmarks/qml/qqmldebugtrace/tst_qqmldebugtrace.cpp b/tests/benchmarks/qml/qqmldebugtrace/tst_qqmldebugtrace.cpp deleted file mode 100644 index 68b34deb3a..0000000000 --- a/tests/benchmarks/qml/qqmldebugtrace/tst_qqmldebugtrace.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QtCore/QElapsedTimer> -#include <QObject> -#include <qtest.h> - -class tst_qqmldebugtrace : public QObject -{ - Q_OBJECT - -public: - tst_qqmldebugtrace() {} - -private slots: - void all(); - void startElapsed(); - void doubleElapsed(); - void trace(); -}; - -void tst_qqmldebugtrace::all() -{ - QBENCHMARK { - QElapsedTimer t; - t.start(); - t.nsecsElapsed(); - } -} - -void tst_qqmldebugtrace::startElapsed() -{ - QElapsedTimer t; - QBENCHMARK { - t.start(); - t.nsecsElapsed(); - } -} - -void tst_qqmldebugtrace::doubleElapsed() -{ - QElapsedTimer t; - t.start(); - QBENCHMARK { - t.nsecsElapsed(); - t.nsecsElapsed(); - } -} - -void tst_qqmldebugtrace::trace() -{ - QString s("A decent sized string of text here."); - QBENCHMARK { - QByteArray data; - QDataStream ds(&data, QIODevice::WriteOnly); - ds << (qint64)100 << (int)5 << (int)5 << s; - } -} - -QTEST_MAIN(tst_qqmldebugtrace) - -#include "tst_qqmldebugtrace.moc" diff --git a/tests/benchmarks/qml/script/tst_script.cpp b/tests/benchmarks/qml/script/tst_script.cpp index 3829f3df6a..a48d6bdec7 100644 --- a/tests/benchmarks/qml/script/tst_script.cpp +++ b/tests/benchmarks/qml/script/tst_script.cpp @@ -52,10 +52,8 @@ private slots: void property_getter_qmetaproperty(); #endif void property_qobject(); - void property_qmlobject(); void setproperty_js(); - void setproperty_qmlobject(); void function_js(); #if 0 @@ -63,7 +61,6 @@ private slots: void function_cpp(); #endif void function_qobject(); - void function_qmlobject(); void function_args_js(); #if 0 @@ -71,7 +68,6 @@ private slots: void function_args_cpp(); #endif void function_args_qobject(); - void function_args_qmlobject(); void signal_unconnected(); void signal_qml(); @@ -178,7 +174,7 @@ void tst_script::property_js() } } -#if 0 +#if 0 // This requires internal API access in V4 static QJSValue property_getter_method(QScriptContext *, QJSEngine *engine) { static int x = 0; @@ -305,26 +301,6 @@ void tst_script::property_qobject() } } -void tst_script::property_qmlobject() -{ - QQmlEngine qmlengine; - - TestObject to; - QV8Engine *engine = QQmlEnginePrivate::getV8Engine(&qmlengine); - v8::HandleScope handle_scope; - v8::Context::Scope scope(engine->context()); - QJSValue v = engine->scriptValueFromInternal(engine->qobjectWrapper()->newQObject(&to)); - - QJSValueList args; - args << v; - QJSValue prog = qmlengine.evaluate(PROPERTY_PROGRAM).call(args); - prog.call(); - - QBENCHMARK { - prog.call(); - } -} - #define SETPROPERTY_PROGRAM \ "(function(testObject) { return (function() { " \ " for (var ii = 0; ii < 10000; ++ii) { " \ @@ -349,27 +325,6 @@ void tst_script::setproperty_js() } } -void tst_script::setproperty_qmlobject() -{ - QQmlEngine qmlengine; - - TestObject to; - - QV8Engine *engine = QQmlEnginePrivate::getV8Engine(&qmlengine); - v8::HandleScope handle_scope; - v8::Context::Scope scope(engine->context()); - QJSValue v = engine->scriptValueFromInternal(engine->qobjectWrapper()->newQObject(&to)); - - QJSValueList args; - args << v; - QJSValue prog = qmlengine.evaluate(SETPROPERTY_PROGRAM).call(args); - prog.call(); - - QBENCHMARK { - prog.call(); - } -} - #define FUNCTION_PROGRAM \ "(function(testObject) { return (function() { " \ " var test = 0; " \ @@ -437,27 +392,6 @@ void tst_script::function_qobject() } } -void tst_script::function_qmlobject() -{ - QQmlEngine qmlengine; - - TestObject to; - - QV8Engine *engine = QQmlEnginePrivate::getV8Engine(&qmlengine); - v8::HandleScope handle_scope; - v8::Context::Scope scope(engine->context()); - QJSValue v = engine->scriptValueFromInternal(engine->qobjectWrapper()->newQObject(&to)); - - QJSValueList args; - args << v; - QJSValue prog = qmlengine.evaluate(FUNCTION_PROGRAM).call(args); - prog.call(); - - QBENCHMARK { - prog.call(); - } -} - #define FUNCTION_ARGS_PROGRAM \ "(function(testObject) { return (function() { " \ " var test = 0; " \ @@ -525,27 +459,6 @@ void tst_script::function_args_qobject() } } -void tst_script::function_args_qmlobject() -{ - QQmlEngine qmlengine; - - TestObject to; - - QV8Engine *engine = QQmlEnginePrivate::getV8Engine(&qmlengine); - v8::HandleScope handle_scope; - v8::Context::Scope scope(engine->context()); - QJSValue v = engine->scriptValueFromInternal(engine->qobjectWrapper()->newQObject(&to)); - - QJSValueList args; - args << v; - QJSValue prog = qmlengine.evaluate(FUNCTION_ARGS_PROGRAM).call(args); - prog.call(); - - QBENCHMARK { - prog.call(); - } -} - void tst_script::signal_unconnected() { QQmlEngine engine; diff --git a/tests/benchmarks/script/qjsvalue/qjsvalue.pro b/tests/benchmarks/script/qjsvalue/qjsvalue.pro deleted file mode 100644 index 1b39091dea..0000000000 --- a/tests/benchmarks/script/qjsvalue/qjsvalue.pro +++ /dev/null @@ -1,10 +0,0 @@ -CONFIG += benchmark -TEMPLATE = app -TARGET = tst_bench_qjsvalue -INCLUDEPATH += . -macx:CONFIG -= app_bundle -CONFIG += release - -SOURCES += tst_qjsvalue.cpp - -QT += core-private qml-private testlib diff --git a/tests/benchmarks/script/qjsvalue/tst_qjsvalue.cpp b/tests/benchmarks/script/qjsvalue/tst_qjsvalue.cpp deleted file mode 100644 index f1bdb78c7b..0000000000 --- a/tests/benchmarks/script/qjsvalue/tst_qjsvalue.cpp +++ /dev/null @@ -1,99 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <qtest.h> -#include <QJSEngine> -#include <QJSValue> - -class tst_QJSValue : public QObject -{ - Q_OBJECT -public: - tst_QJSValue() {} - -private slots: - void fillArray(); - - void property(); - - void setProperty(); - - void call(); -}; - -void tst_QJSValue::fillArray() -{ - QJSEngine eng; - static const int ArrayLength = 10000; - QJSValue array = eng.newArray(ArrayLength); - QBENCHMARK { - for (int i = 0; i < ArrayLength; ++i) - array.setProperty(i, i); - } -} - -void tst_QJSValue::property() -{ - QJSEngine eng; - QJSValue object = eng.newObject(); - QString propertyName = QString::fromLatin1("foo"); - object.setProperty(propertyName, 123); - QVERIFY(object.property(propertyName).isNumber()); - QBENCHMARK { - object.property(propertyName); - } -} - -void tst_QJSValue::setProperty() -{ - QJSEngine eng; - QJSValue object = eng.newObject(); - QString propertyName = QString::fromLatin1("foo"); - QJSValue value(123); - QBENCHMARK { - object.setProperty(propertyName, value); - } -} - -#define TEST_FUNCTION_SOURCE "(function() { return 123; })" - -void tst_QJSValue::call() -{ - QJSEngine eng; - QJSValue fun = eng.evaluate(TEST_FUNCTION_SOURCE); - QVERIFY(fun.isCallable()); - QJSValueList args; - QVERIFY(fun.call(args).isNumber()); - QBENCHMARK { - fun.call(args); - } -} - -QTEST_MAIN(tst_QJSValue) - -#include "tst_qjsvalue.moc" diff --git a/tests/benchmarks/script/script.pro b/tests/benchmarks/script/script.pro deleted file mode 100644 index 37dc03801d..0000000000 --- a/tests/benchmarks/script/script.pro +++ /dev/null @@ -1,4 +0,0 @@ -TEMPLATE = subdirs - -SUBDIRS += \ - qjsvalue |