From 7a1c8715cb008a6d9f605508da00572c678b23c0 Mon Sep 17 00:00:00 2001 From: Jani Heikkinen Date: Fri, 28 Apr 2017 14:42:38 +0300 Subject: Fix licensing - Remove unused license files - Switch old LGPLv21 license headers with GPL-EXCEPT one Task-number: QTBUG-57147 Change-Id: Ib59c3e2e39bfe0038db795af85dc75028564efa3 Reviewed-by: Lars Knoll --- .../qml/qqmlchangeset/tst_qqmlchangeset.cpp | 29 +++++++++------------- 1 file changed, 12 insertions(+), 17 deletions(-) (limited to 'tests/benchmarks/qml') 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 -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Milian Wolff +** 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$ ** -- cgit v1.2.3 From 365d43a22050a4ea69e36b8d1033bf6ab3189264 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Thu, 4 May 2017 10:35:37 +0200 Subject: Fix a QJSValue benchmark The benchmark added the tst_QJSValue instance driving the benchmark to the engine, which then takes over ownership. This would result in a use-after-free, leading to a crash. Change-Id: I524445487a1dabb3fb3fbbfb7fca084f7736c124 Reviewed-by: Robin Burchell --- tests/benchmarks/qml/js/js.pro | 2 +- tests/benchmarks/qml/js/qjsvalue/tst_qjsvalue.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/benchmarks/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/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 -- cgit v1.2.3 From 448104e4a09f66b62ff279d65ecc4658833e20f3 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Thu, 4 May 2017 10:43:42 +0200 Subject: Remove outdated QJSValue benchmark Now that the oterh QJSValue benchmark is fixed (yes, there were two benchmarks with the same name), this benchmark is superfluous. Change-Id: I39a7f9cc79dccef8aac3d4c3999a3d75e1b1aa3d Reviewed-by: Robin Burchell --- tests/benchmarks/qml/js/qjsvalue/qjsvalue.pro | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/benchmarks/qml') 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 -- cgit v1.2.3 From 63f0406cfbf58e8c3e3369beb8ae6995a7a21650 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Fri, 5 May 2017 14:37:30 +0200 Subject: Another benchmark fix Again JS ownership, now shown as an attempt to free a non-malloced pointer. Change-Id: I00a9b1e4918da96aa5bc99a321edc94d76c4f45b Reviewed-by: Simon Hausmann --- tests/benchmarks/qml/js/qjsengine/qjsengine.pro | 2 ++ tests/benchmarks/qml/js/qjsengine/tst_qjsengine.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'tests/benchmarks/qml') 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); } } -- cgit v1.2.3 From 720a88be5ba98a71a085ec5977d87ecb22c20008 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Fri, 5 May 2017 14:44:38 +0200 Subject: Fix build of animation benchmark This was using symbols exported only by a developer build. Change-Id: If2e80a7f7831366a23c5c52669915385cfb3e7c6 Reviewed-by: Simon Hausmann --- tests/benchmarks/qml/animation/tst_animation.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests/benchmarks/qml') 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() { -- cgit v1.2.3 From 9abcbbd3ab68da3cf7ee977c82b860e2ac42bb2c Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Thu, 4 May 2017 13:15:49 +0200 Subject: Fix benchmark: remove benchmarks containing old v8 references The removed benchmarks don't make sense anymore: they were testing the QQmlEngine part, while another test was doing the QJSEngine. These days the QQmlEngine is a subclass of the QJSEngine and the test would call the QJSEngine (which, as said, was already done in another benchmark). Change-Id: Id1982dc118c399938a2dca8fb3c0a733e52fb20e Reviewed-by: Lars Knoll --- tests/benchmarks/qml/qml.pro | 2 +- tests/benchmarks/qml/script/tst_script.cpp | 89 +----------------------------- 2 files changed, 2 insertions(+), 89 deletions(-) (limited to 'tests/benchmarks/qml') 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/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; -- cgit v1.2.3 From 5346da3f11f52530ef3c14d4ff16124b86f922e1 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Fri, 5 May 2017 14:20:37 +0200 Subject: Remove the qqmldebugtrace benchmark It benchmarks QElapsedTimer and QDataStream. We should do this in qtbase if we need to do it. The test was not in the parent qml.pro, but it was mentioned in some outdated comments in the QML profiler plugins. Remove those comments, too. Change-Id: I0d1341c32f4a2e02a04a958f76be015fe8d927fb Reviewed-by: Erik Verbruggen Reviewed-by: Lars Knoll --- .../qml/qqmldebugtrace/qqmldebugtrace.pro | 8 -- .../qml/qqmldebugtrace/tst_qqmldebugtrace.cpp | 87 ---------------------- 2 files changed, 95 deletions(-) delete mode 100644 tests/benchmarks/qml/qqmldebugtrace/qqmldebugtrace.pro delete mode 100644 tests/benchmarks/qml/qqmldebugtrace/tst_qqmldebugtrace.cpp (limited to 'tests/benchmarks/qml') 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 -#include -#include - -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" -- cgit v1.2.3