From a129444bb0156c936900dbd2f12bd9f427ff366c Mon Sep 17 00:00:00 2001 From: Qt by Nokia Date: Wed, 27 Apr 2011 14:13:26 +0200 Subject: Initial import from qtquick2. Branched from the monolithic repo, Qt qtquick2 branch, at commit a4a585d2ee907746682846ae6e8a48e19deef469 --- tests/benchmarks/declarative/declarative.pro | 1 + .../holistic/data/dynamicTargets/DynamicFour.qml | 78 +++ .../holistic/data/dynamicTargets/DynamicOne.qml | 56 ++ .../holistic/data/dynamicTargets/DynamicThree.qml | 61 ++ .../holistic/data/dynamicTargets/DynamicTwo.qml | 68 +++ .../declarative/holistic/data/jsImports/Mlbsi.qml | 49 ++ .../declarative/holistic/data/jsImports/Mldsi.qml | 49 ++ .../declarative/holistic/data/jsImports/Mlsi.qml | 49 ++ .../holistic/data/jsImports/ModuleBm.qml | 49 ++ .../declarative/holistic/data/jsImports/Msbsi.qml | 49 ++ .../declarative/holistic/data/jsImports/Msdsi.qml | 49 ++ .../declarative/holistic/data/jsImports/Mssi.qml | 49 ++ .../holistic/data/jsImports/PragmaBm.qml | 55 ++ .../holistic/data/jsImports/PragmaModuleBm.qml | 51 ++ .../declarative/holistic/data/jsImports/Slsi.qml | 49 ++ .../declarative/holistic/data/jsImports/Sssi.qml | 49 ++ .../declarative/holistic/data/jsImports/mlbsi.js | 133 +++++ .../declarative/holistic/data/jsImports/mlbsi1.js | 108 ++++ .../declarative/holistic/data/jsImports/mlbsi10.js | 108 ++++ .../declarative/holistic/data/jsImports/mlbsi11.js | 108 ++++ .../declarative/holistic/data/jsImports/mlbsi12.js | 108 ++++ .../declarative/holistic/data/jsImports/mlbsi13.js | 108 ++++ .../declarative/holistic/data/jsImports/mlbsi14.js | 108 ++++ .../declarative/holistic/data/jsImports/mlbsi15.js | 108 ++++ .../declarative/holistic/data/jsImports/mlbsi2.js | 108 ++++ .../declarative/holistic/data/jsImports/mlbsi3.js | 108 ++++ .../declarative/holistic/data/jsImports/mlbsi4.js | 108 ++++ .../declarative/holistic/data/jsImports/mlbsi5.js | 108 ++++ .../declarative/holistic/data/jsImports/mlbsi6.js | 108 ++++ .../declarative/holistic/data/jsImports/mlbsi7.js | 108 ++++ .../declarative/holistic/data/jsImports/mlbsi8.js | 108 ++++ .../declarative/holistic/data/jsImports/mlbsi9.js | 108 ++++ .../declarative/holistic/data/jsImports/mldsi.js | 105 ++++ .../declarative/holistic/data/jsImports/mldsi1.js | 107 ++++ .../declarative/holistic/data/jsImports/mldsi10.js | 107 ++++ .../declarative/holistic/data/jsImports/mldsi11.js | 107 ++++ .../declarative/holistic/data/jsImports/mldsi12.js | 107 ++++ .../declarative/holistic/data/jsImports/mldsi13.js | 107 ++++ .../declarative/holistic/data/jsImports/mldsi14.js | 107 ++++ .../declarative/holistic/data/jsImports/mldsi15.js | 104 ++++ .../declarative/holistic/data/jsImports/mldsi2.js | 107 ++++ .../declarative/holistic/data/jsImports/mldsi3.js | 107 ++++ .../declarative/holistic/data/jsImports/mldsi4.js | 107 ++++ .../declarative/holistic/data/jsImports/mldsi5.js | 107 ++++ .../declarative/holistic/data/jsImports/mldsi6.js | 107 ++++ .../declarative/holistic/data/jsImports/mldsi7.js | 107 ++++ .../declarative/holistic/data/jsImports/mldsi8.js | 107 ++++ .../declarative/holistic/data/jsImports/mldsi9.js | 107 ++++ .../declarative/holistic/data/jsImports/mlsi.js | 138 +++++ .../holistic/data/jsImports/moduleBm.js | 109 ++++ .../declarative/holistic/data/jsImports/msbsi.js | 79 +++ .../declarative/holistic/data/jsImports/msbsi1.js | 53 ++ .../declarative/holistic/data/jsImports/msbsi10.js | 53 ++ .../declarative/holistic/data/jsImports/msbsi11.js | 53 ++ .../declarative/holistic/data/jsImports/msbsi12.js | 53 ++ .../declarative/holistic/data/jsImports/msbsi13.js | 53 ++ .../declarative/holistic/data/jsImports/msbsi14.js | 53 ++ .../declarative/holistic/data/jsImports/msbsi15.js | 53 ++ .../declarative/holistic/data/jsImports/msbsi2.js | 53 ++ .../declarative/holistic/data/jsImports/msbsi3.js | 53 ++ .../declarative/holistic/data/jsImports/msbsi4.js | 53 ++ .../declarative/holistic/data/jsImports/msbsi5.js | 53 ++ .../declarative/holistic/data/jsImports/msbsi6.js | 53 ++ .../declarative/holistic/data/jsImports/msbsi7.js | 53 ++ .../declarative/holistic/data/jsImports/msbsi8.js | 53 ++ .../declarative/holistic/data/jsImports/msbsi9.js | 53 ++ .../declarative/holistic/data/jsImports/msdsi.js | 51 ++ .../declarative/holistic/data/jsImports/msdsi1.js | 52 ++ .../declarative/holistic/data/jsImports/msdsi10.js | 52 ++ .../declarative/holistic/data/jsImports/msdsi11.js | 52 ++ .../declarative/holistic/data/jsImports/msdsi12.js | 52 ++ .../declarative/holistic/data/jsImports/msdsi13.js | 52 ++ .../declarative/holistic/data/jsImports/msdsi14.js | 52 ++ .../declarative/holistic/data/jsImports/msdsi15.js | 49 ++ .../declarative/holistic/data/jsImports/msdsi2.js | 52 ++ .../declarative/holistic/data/jsImports/msdsi3.js | 52 ++ .../declarative/holistic/data/jsImports/msdsi4.js | 52 ++ .../declarative/holistic/data/jsImports/msdsi5.js | 52 ++ .../declarative/holistic/data/jsImports/msdsi6.js | 52 ++ .../declarative/holistic/data/jsImports/msdsi7.js | 52 ++ .../declarative/holistic/data/jsImports/msdsi8.js | 52 ++ .../declarative/holistic/data/jsImports/msdsi9.js | 52 ++ .../declarative/holistic/data/jsImports/mssi.js | 84 +++ .../holistic/data/jsImports/pragmaBmOne.js | 50 ++ .../holistic/data/jsImports/pragmaBmTwo.js | 50 ++ .../holistic/data/jsImports/pragmaLib.js | 119 ++++ .../holistic/data/jsImports/pragmaModuleBm.js | 57 ++ .../declarative/holistic/data/jsImports/slsi.js | 108 ++++ .../declarative/holistic/data/jsImports/sssi.js | 52 ++ .../declarative/holistic/data/jsTargets/JsOne.qml | 61 ++ .../declarative/holistic/data/jsTargets/JsTwo.qml | 118 ++++ .../data/largeTargets/gridview-example.qml | 91 +++ .../holistic/data/largeTargets/layoutdirection.qml | 151 +++++ .../data/largeTargets/mousearea-example.qml | 112 ++++ .../holistic/data/resolutionTargets/ResolveOne.qml | 111 ++++ .../holistic/data/scopeSwitching/CppToJs.qml | 52 ++ .../holistic/data/scopeSwitching/CppToQml.qml | 48 ++ .../holistic/data/scopeSwitching/JsToCppEight.qml | 54 ++ .../holistic/data/scopeSwitching/JsToCppEleven.qml | 57 ++ .../holistic/data/scopeSwitching/JsToCppFive.qml | 54 ++ .../holistic/data/scopeSwitching/JsToCppFour.qml | 55 ++ .../holistic/data/scopeSwitching/JsToCppNine.qml | 56 ++ .../holistic/data/scopeSwitching/JsToCppOne.qml | 55 ++ .../holistic/data/scopeSwitching/JsToCppSeven.qml | 54 ++ .../holistic/data/scopeSwitching/JsToCppSix.qml | 54 ++ .../holistic/data/scopeSwitching/JsToCppTen.qml | 56 ++ .../holistic/data/scopeSwitching/JsToCppThree.qml | 55 ++ .../holistic/data/scopeSwitching/JsToCppTwo.qml | 55 ++ .../holistic/data/scopeSwitching/ScarceOne.qml | 57 ++ .../holistic/data/scopeSwitching/ScarceTwo.qml | 52 ++ .../holistic/data/scopeSwitching/cppToJs.js | 49 ++ .../holistic/data/smallTargets/SmallFour.qml | 49 ++ .../holistic/data/smallTargets/SmallOne.qml | 51 ++ .../holistic/data/smallTargets/SmallThree.qml | 51 ++ .../holistic/data/smallTargets/SmallTwo.qml | 51 ++ tests/benchmarks/declarative/holistic/holistic.pro | 19 + .../benchmarks/declarative/holistic/testtypes.cpp | 98 ++++ tests/benchmarks/declarative/holistic/testtypes.h | 355 ++++++++++++ .../declarative/holistic/tst_holistic.cpp | 612 +++++++++++++++++++++ tests/benchmarks/declarative/script/data/enums.qml | 51 ++ .../declarative/script/data/namespacedEnums.qml | 52 ++ tests/benchmarks/declarative/script/data/script.js | 1 + .../benchmarks/declarative/script/data/script2.js | 2 + .../declarative/script/data/scriptCall.qml | 54 ++ tests/benchmarks/declarative/script/tst_script.cpp | 107 +++- 125 files changed, 9799 insertions(+), 1 deletion(-) create mode 100644 tests/benchmarks/declarative/holistic/data/dynamicTargets/DynamicFour.qml create mode 100644 tests/benchmarks/declarative/holistic/data/dynamicTargets/DynamicOne.qml create mode 100644 tests/benchmarks/declarative/holistic/data/dynamicTargets/DynamicThree.qml create mode 100644 tests/benchmarks/declarative/holistic/data/dynamicTargets/DynamicTwo.qml create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/Mlbsi.qml create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/Mldsi.qml create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/Mlsi.qml create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/ModuleBm.qml create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/Msbsi.qml create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/Msdsi.qml create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/Mssi.qml create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/PragmaBm.qml create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/PragmaModuleBm.qml create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/Slsi.qml create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/Sssi.qml create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/mlbsi.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/mlbsi1.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/mlbsi10.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/mlbsi11.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/mlbsi12.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/mlbsi13.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/mlbsi14.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/mlbsi15.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/mlbsi2.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/mlbsi3.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/mlbsi4.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/mlbsi5.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/mlbsi6.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/mlbsi7.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/mlbsi8.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/mlbsi9.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/mldsi.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/mldsi1.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/mldsi10.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/mldsi11.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/mldsi12.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/mldsi13.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/mldsi14.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/mldsi15.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/mldsi2.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/mldsi3.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/mldsi4.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/mldsi5.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/mldsi6.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/mldsi7.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/mldsi8.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/mldsi9.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/mlsi.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/moduleBm.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/msbsi.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/msbsi1.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/msbsi10.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/msbsi11.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/msbsi12.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/msbsi13.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/msbsi14.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/msbsi15.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/msbsi2.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/msbsi3.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/msbsi4.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/msbsi5.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/msbsi6.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/msbsi7.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/msbsi8.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/msbsi9.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/msdsi.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/msdsi1.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/msdsi10.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/msdsi11.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/msdsi12.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/msdsi13.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/msdsi14.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/msdsi15.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/msdsi2.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/msdsi3.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/msdsi4.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/msdsi5.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/msdsi6.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/msdsi7.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/msdsi8.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/msdsi9.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/mssi.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/pragmaBmOne.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/pragmaBmTwo.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/pragmaLib.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/pragmaModuleBm.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/slsi.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsImports/sssi.js create mode 100644 tests/benchmarks/declarative/holistic/data/jsTargets/JsOne.qml create mode 100644 tests/benchmarks/declarative/holistic/data/jsTargets/JsTwo.qml create mode 100644 tests/benchmarks/declarative/holistic/data/largeTargets/gridview-example.qml create mode 100644 tests/benchmarks/declarative/holistic/data/largeTargets/layoutdirection.qml create mode 100644 tests/benchmarks/declarative/holistic/data/largeTargets/mousearea-example.qml create mode 100644 tests/benchmarks/declarative/holistic/data/resolutionTargets/ResolveOne.qml create mode 100644 tests/benchmarks/declarative/holistic/data/scopeSwitching/CppToJs.qml create mode 100644 tests/benchmarks/declarative/holistic/data/scopeSwitching/CppToQml.qml create mode 100644 tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppEight.qml create mode 100644 tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppEleven.qml create mode 100644 tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppFive.qml create mode 100644 tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppFour.qml create mode 100644 tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppNine.qml create mode 100644 tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppOne.qml create mode 100644 tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppSeven.qml create mode 100644 tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppSix.qml create mode 100644 tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppTen.qml create mode 100644 tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppThree.qml create mode 100644 tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppTwo.qml create mode 100644 tests/benchmarks/declarative/holistic/data/scopeSwitching/ScarceOne.qml create mode 100644 tests/benchmarks/declarative/holistic/data/scopeSwitching/ScarceTwo.qml create mode 100644 tests/benchmarks/declarative/holistic/data/scopeSwitching/cppToJs.js create mode 100644 tests/benchmarks/declarative/holistic/data/smallTargets/SmallFour.qml create mode 100644 tests/benchmarks/declarative/holistic/data/smallTargets/SmallOne.qml create mode 100644 tests/benchmarks/declarative/holistic/data/smallTargets/SmallThree.qml create mode 100644 tests/benchmarks/declarative/holistic/data/smallTargets/SmallTwo.qml create mode 100644 tests/benchmarks/declarative/holistic/holistic.pro create mode 100644 tests/benchmarks/declarative/holistic/testtypes.cpp create mode 100644 tests/benchmarks/declarative/holistic/testtypes.h create mode 100644 tests/benchmarks/declarative/holistic/tst_holistic.cpp create mode 100644 tests/benchmarks/declarative/script/data/enums.qml create mode 100644 tests/benchmarks/declarative/script/data/namespacedEnums.qml create mode 100644 tests/benchmarks/declarative/script/data/script.js create mode 100644 tests/benchmarks/declarative/script/data/script2.js create mode 100644 tests/benchmarks/declarative/script/data/scriptCall.qml (limited to 'tests/benchmarks') diff --git a/tests/benchmarks/declarative/declarative.pro b/tests/benchmarks/declarative/declarative.pro index cb02a35c27..a827978d63 100644 --- a/tests/benchmarks/declarative/declarative.pro +++ b/tests/benchmarks/declarative/declarative.pro @@ -3,6 +3,7 @@ TEMPLATE = subdirs SUBDIRS += \ binding \ creation \ + holistic \ pointers \ qdeclarativecomponent \ qdeclarativeimage \ diff --git a/tests/benchmarks/declarative/holistic/data/dynamicTargets/DynamicFour.qml b/tests/benchmarks/declarative/holistic/data/dynamicTargets/DynamicFour.qml new file mode 100644 index 0000000000..81a666bf47 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/dynamicTargets/DynamicFour.qml @@ -0,0 +1,78 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Item { + id: root + property int dynamicWidth: 100 + property int dynamicHeight: rect1.height + rect2.height + property int widthSignaledProperty: 10 + property int heightSignaledProperty: 10 + + Rectangle { + id: rect1 + width: root.dynamicWidth + 20 + height: width + (5*3) - 8 + (width/9) + color: "red" + border.color: "black" + border.width: 5 + radius: 10 + } + + Rectangle { + id: rect2 + width: rect1.width - 50 + height: width + (5*4) - 6 + (width/3) + color: "red" + border.color: "black" + border.width: 5 + radius: 10 + } + + onDynamicWidthChanged: { + widthSignaledProperty = widthSignaledProperty + (6*5) - 2; + } + + onDynamicHeightChanged: { + heightSignaledProperty = widthSignaledProperty + heightSignaledProperty + (5*3) - 7; + } +} diff --git a/tests/benchmarks/declarative/holistic/data/dynamicTargets/DynamicOne.qml b/tests/benchmarks/declarative/holistic/data/dynamicTargets/DynamicOne.qml new file mode 100644 index 0000000000..6e726b12d4 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/dynamicTargets/DynamicOne.qml @@ -0,0 +1,56 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Item { + id: root + property int dynamicWidth: 10 + + Rectangle { + width: 100 + height: root.dynamicWidth + (5*3) - 8 + (root.dynamicWidth/10) + color: "red" + border.color: "black" + border.width: 5 + radius: 10 + } +} diff --git a/tests/benchmarks/declarative/holistic/data/dynamicTargets/DynamicThree.qml b/tests/benchmarks/declarative/holistic/data/dynamicTargets/DynamicThree.qml new file mode 100644 index 0000000000..19000d78fa --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/dynamicTargets/DynamicThree.qml @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Item { + id: root + property int dynamicWidth: 10 + property int widthSignaledProperty: 20 + + Rectangle { + width: 100 + height: root.dynamicWidth + (5*3) - 8 + (root.dynamicWidth/10) + color: "red" + border.color: "black" + border.width: 5 + radius: 10 + } + + onDynamicWidthChanged: { + widthSignaledProperty = dynamicWidth + (20/4) + 7 - 1; + } +} diff --git a/tests/benchmarks/declarative/holistic/data/dynamicTargets/DynamicTwo.qml b/tests/benchmarks/declarative/holistic/data/dynamicTargets/DynamicTwo.qml new file mode 100644 index 0000000000..4f7340589b --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/dynamicTargets/DynamicTwo.qml @@ -0,0 +1,68 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Item { + id: root + property int dynamicWidth: 100 + property int dynamicHeight: rect1.height + rect2.height + + Rectangle { + id: rect1 + width: root.dynamicWidth + 20 + height: width + (5*3) - 8 + (width/9) + color: "red" + border.color: "black" + border.width: 5 + radius: 10 + } + + Rectangle { + id: rect2 + width: rect1.width - 50 + height: width + (5*4) - 6 + (width/3) + color: "red" + border.color: "black" + border.width: 5 + radius: 10 + } +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/Mlbsi.qml b/tests/benchmarks/declarative/holistic/data/jsImports/Mlbsi.qml new file mode 100644 index 0000000000..2ce9728d6a --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/Mlbsi.qml @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +import QtQuick 1.0 + +import "mlbsi.js" as MlbsiJs + +Item { + id: testQtObject + property int importedScriptFunctionValue: MlbsiJs.testFunc(20) +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/Mldsi.qml b/tests/benchmarks/declarative/holistic/data/jsImports/Mldsi.qml new file mode 100644 index 0000000000..c4455a46dc --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/Mldsi.qml @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +import QtQuick 1.0 + +import "mldsi.js" as MldsiJs + +Item { + id: testQtObject + property int importedScriptFunctionValue: MldsiJs.testFunc(20) +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/Mlsi.qml b/tests/benchmarks/declarative/holistic/data/jsImports/Mlsi.qml new file mode 100644 index 0000000000..99bb222e7a --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/Mlsi.qml @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +import QtQuick 1.0 + +import "mlsi.js" as MlsiJs + +Item { + id: testQtObject + property int importedScriptFunctionValue: MlsiJs.testFunc(20) +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/ModuleBm.qml b/tests/benchmarks/declarative/holistic/data/jsImports/ModuleBm.qml new file mode 100644 index 0000000000..bdae3564fc --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/ModuleBm.qml @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +import QtQuick 1.0 + +import "moduleBm.js" as ModuleBmJs + +Item { + id: testQtObject + property int importedScriptFunctionValue: ModuleBmJs.testFunc(20) +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/Msbsi.qml b/tests/benchmarks/declarative/holistic/data/jsImports/Msbsi.qml new file mode 100644 index 0000000000..05026cbf71 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/Msbsi.qml @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +import QtQuick 1.0 + +import "msbsi.js" as MsbsiJs + +Item { + id: testQtObject + property int importedScriptFunctionValue: MsbsiJs.testFunc(20) +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/Msdsi.qml b/tests/benchmarks/declarative/holistic/data/jsImports/Msdsi.qml new file mode 100644 index 0000000000..cd6ae72a56 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/Msdsi.qml @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +import QtQuick 1.0 + +import "msdsi.js" as MsdsiJs + +Item { + id: testQtObject + property int importedScriptFunctionValue: MsdsiJs.testFunc(20) +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/Mssi.qml b/tests/benchmarks/declarative/holistic/data/jsImports/Mssi.qml new file mode 100644 index 0000000000..604f2ebd6e --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/Mssi.qml @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +import QtQuick 1.0 + +import "mssi.js" as MssiJs + +Item { + id: testQtObject + property int importedScriptFunctionValue: MssiJs.testFunc(20) +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/PragmaBm.qml b/tests/benchmarks/declarative/holistic/data/jsImports/PragmaBm.qml new file mode 100644 index 0000000000..24709b93c2 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/PragmaBm.qml @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +import QtQuick 1.0 + +import "pragmaBmOne.js" as PragmaBmOneJs +import "pragmaBmTwo.js" as PragmaBmTwoJs + +Item { + id: testQtObject + + // value = 20 + 2 + 9 + (nbr times shared testFunc has been called previously == 0) + property int importedScriptFunctionValueOne: PragmaBmOneJs.testFuncOne(20) + + // value = 20 + 3 + 9 + (nbr times shared testFunc has been called previously == 1) + property int importedScriptFunctionValueTwo: PragmaBmTwoJs.testFuncTwo(20) +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/PragmaModuleBm.qml b/tests/benchmarks/declarative/holistic/data/jsImports/PragmaModuleBm.qml new file mode 100644 index 0000000000..cac23cf412 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/PragmaModuleBm.qml @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +import QtQuick 1.0 + +import "pragmaModuleBm.js" as PragmaModuleBmJs + +Item { + id: testQtObject + + // value = 20 + (Qt.test.Enum3 == 2) + 9 + (nbr times shared testFunc has been called previously = 0) + 9 + (nbr times shared testFunc has been called previously = 1) + property int importedScriptFunctionValue: PragmaModuleBmJs.testFuncThree(20) +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/Slsi.qml b/tests/benchmarks/declarative/holistic/data/jsImports/Slsi.qml new file mode 100644 index 0000000000..50d6de784e --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/Slsi.qml @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +import QtQuick 1.0 + +import "slsi.js" as SlsiJs + +Item { + id: testQtObject + property int importedScriptFunctionValue: SlsiJs.testFunc(20) +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/Sssi.qml b/tests/benchmarks/declarative/holistic/data/jsImports/Sssi.qml new file mode 100644 index 0000000000..b92a5a7cc9 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/Sssi.qml @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +import QtQuick 1.0 + +import "sssi.js" as SssiJs + +Item { + id: testQtObject + property int importedScriptFunctionValue: SssiJs.testFunc(20) +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi.js b/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi.js new file mode 100644 index 0000000000..c4ea363cb7 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi.js @@ -0,0 +1,133 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, small, imported script. +// It imports many other (non-nested) single, small, scripts. + +.import "mlbsi1.js" as Mlbsi1 +.import "mlbsi2.js" as Mlbsi2 +.import "mlbsi3.js" as Mlbsi3 +.import "mlbsi4.js" as Mlbsi4 +.import "mlbsi5.js" as Mlbsi5 +.import "mlbsi6.js" as Mlbsi6 +.import "mlbsi7.js" as Mlbsi7 +.import "mlbsi8.js" as Mlbsi8 +.import "mlbsi9.js" as Mlbsi9 +.import "mlbsi10.js" as Mlbsi10 +.import "mlbsi11.js" as Mlbsi11 +.import "mlbsi12.js" as Mlbsi12 +.import "mlbsi13.js" as Mlbsi13 +.import "mlbsi14.js" as Mlbsi14 +.import "mlbsi15.js" as Mlbsi15 + +function testFunc(seedValue) { + var firstFactor = calculateFirstFactor(seedValue); + var secondFactor = calculateSecondFactor(seedValue); + var modificationTerm = calculateModificationTerm(seedValue); + + // do some regexp matching + var someString = "This is a random string which we'll perform regular expression matching on to reduce considerably. This is meant to be part of a complex javascript expression whose evaluation takes considerably longer than the creation cost of QScriptValue."; + var regexpPattern = new RegExp("is", "i"); + var regexpOutputLength = 0; + var temp = regexpPattern.exec(someString); + while (temp == "is") { + regexpOutputLength += 4; + regexpOutputLength *= 2; + temp = regexpPattern.exec(someString); + if (regexpOutputLength > (seedValue * 3)) { + temp = "break"; + } + } + + // spin in a for loop for a while + var i = 0; + var j = 0; + var cumulativeTotal = 3; + for (i = 20; i > 1; i--) { + for (j = 31; j > 5; j--) { + var branchVariable = i + j; + if (branchVariable % 3 == 0) { + cumulativeTotal -= secondFactor; + } else { + cumulativeTotal += firstFactor; + } + + if (cumulativeTotal > (seedValue * 50)) { + break; + } + } + } + var retn = cumulativeTotal * 0.53; + retn += Mlbsi1.testFunc(seedValue); + retn += Mlbsi2.testFunc(seedValue); + retn += Mlbsi3.testFunc(seedValue); + retn += Mlbsi4.testFunc(seedValue); + retn += Mlbsi5.testFunc(seedValue); + retn += Mlbsi6.testFunc(retn); + retn += Mlbsi7.testFunc(seedValue); + retn += Mlbsi8.testFunc(seedValue); + retn += Mlbsi9.testFunc(retn); + retn += Mlbsi10.testFunc(seedValue); + retn += Mlbsi11.testFunc(seedValue); + retn += Mlbsi12.testFunc(seedValue); + retn += Mlbsi13.testFunc(seedValue); + retn += Mlbsi14.testFunc(seedValue); + retn += Mlbsi15.testFunc(seedValue); + return retn; +} + +function calculateFirstFactor(seedValue) { + var firstFactor = (0.45 * (9.3 / 3.1) - 0.90); + firstFactor *= (1 + (0.000017 / seedValue)); + return firstFactor; +} + +function calculateSecondFactor(seedValue) { + var secondFactor = 0.78 * (6.3 / 2.1) - (0.39 * 4); + secondFactor *= (1 + (0.000017 / seedValue)); + return secondFactor; +} + +function calculateModificationTerm(seedValue) { + var modificationTerm = (12 + (9*7) - 54 + 16 - ((calculateFirstFactor(seedValue) * seedValue) / 3) + (4*calculateSecondFactor(seedValue) * seedValue * 1.33)) + (calculateSecondFactor(seedValue) * seedValue); + modificationTerm = modificationTerm + (33/2) + 19 - (9*2) - (61*3) + 177; + return modificationTerm; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi1.js b/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi1.js new file mode 100644 index 0000000000..ad91dbf11e --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi1.js @@ -0,0 +1,108 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, large, imported script. +// It doesn't import any other scripts. +// It is imported from another script. + +function testFunc(seedValue) { + var retn = 5; + retn += (seedValue * 0.145); + var firstFactor = calculateFirstFactor(seedValue); + var secondFactor = calculateSecondFactor(seedValue); + var modificationTerm = calculateModificationTerm(seedValue); + + // do some regexp matching + var someString = "This is a random string which we'll perform regular expression matching on to reduce considerably. This is meant to be part of a complex javascript expression whose evaluation takes considerably longer than the creation cost of QScriptValue."; + var regexpPattern = new RegExp("is", "i"); + var regexpOutputLength = 0; + var temp = regexpPattern.exec(someString); + while (temp == "is") { + regexpOutputLength += 4; + regexpOutputLength *= 2; + temp = regexpPattern.exec(someString); + if (regexpOutputLength > (seedValue * 3)) { + temp = "break"; + } + } + + // spin in a for loop for a while + var i = 0; + var j = 0; + var cumulativeTotal = 3; + for (i = 20; i > 1; i--) { + for (j = 31; j > 5; j--) { + var branchVariable = i + j; + if (branchVariable % 3 == 0) { + cumulativeTotal -= secondFactor; + } else { + cumulativeTotal += firstFactor; + } + + if (cumulativeTotal > (seedValue * 50)) { + break; + } + } + } + retn *= (1 + (cumulativeTotal * 0.001)); + retn *= (1 + (3.1415962 / seedValue)); + retn /= 2.41497; + retn -= (seedValue * -1); + return retn; +} + +function calculateFirstFactor(seedValue) { + var firstFactor = (0.45 * (9.3 / 3.1) - 0.90); + firstFactor *= (1 + (0.00001 / seedValue)); + return firstFactor; +} + +function calculateSecondFactor(seedValue) { + var secondFactor = 0.78 * (6.3 / 2.1) - (0.39 * 4); + secondFactor *= (1 + (0.00001 / seedValue)); + return secondFactor; +} + +function calculateModificationTerm(seedValue) { + var modificationTerm = (12 + (9*7) - 54 + 16 - ((calculateFirstFactor(seedValue) * seedValue) / 3) + (4*calculateSecondFactor(seedValue) * seedValue * 1.33)) + (calculateSecondFactor(seedValue) * seedValue); + modificationTerm = modificationTerm + (33/2) + 19 - (9*2) - (61*3) + 177; + return modificationTerm; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi10.js b/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi10.js new file mode 100644 index 0000000000..ce67b15163 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi10.js @@ -0,0 +1,108 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, large, imported script. +// It doesn't import any other scripts. +// It is imported from another script. + +function testFunc(seedValue) { + var retn = 5; + retn += (seedValue * 0.1045); + var firstFactor = calculateFirstFactor(seedValue); + var secondFactor = calculateSecondFactor(seedValue); + var modificationTerm = calculateModificationTerm(seedValue); + + // do some regexp matching + var someString = "This is a random string which we'll perform regular expression matching on to reduce considerably. This is meant to be part of a complex javascript expression whose evaluation takes considerably longer than the creation cost of QScriptValue."; + var regexpPattern = new RegExp("is", "i"); + var regexpOutputLength = 0; + var temp = regexpPattern.exec(someString); + while (temp == "is") { + regexpOutputLength += 4; + regexpOutputLength *= 2; + temp = regexpPattern.exec(someString); + if (regexpOutputLength > (seedValue * 3)) { + temp = "break"; + } + } + + // spin in a for loop for a while + var i = 0; + var j = 0; + var cumulativeTotal = 3; + for (i = 20; i > 1; i--) { + for (j = 31; j > 5; j--) { + var branchVariable = i + j; + if (branchVariable % 3 == 0) { + cumulativeTotal -= secondFactor; + } else { + cumulativeTotal += firstFactor; + } + + if (cumulativeTotal > (seedValue * 50)) { + break; + } + } + } + retn *= (1 + (cumulativeTotal * 0.001)); + retn *= (1 + (3.1415962 / seedValue)); + retn /= 2.41497; + retn -= (seedValue * -1); + return retn; +} + +function calculateFirstFactor(seedValue) { + var firstFactor = (0.45 * (9.3 / 3.1) - 0.90); + firstFactor *= (1 + (0.000010 / seedValue)); + return firstFactor; +} + +function calculateSecondFactor(seedValue) { + var secondFactor = 0.78 * (6.3 / 2.1) - (0.39 * 4); + secondFactor *= (1 + (0.000010 / seedValue)); + return secondFactor; +} + +function calculateModificationTerm(seedValue) { + var modificationTerm = (12 + (9*7) - 54 + 16 - ((calculateFirstFactor(seedValue) * seedValue) / 3) + (4*calculateSecondFactor(seedValue) * seedValue * 1.33)) + (calculateSecondFactor(seedValue) * seedValue); + modificationTerm = modificationTerm + (33/2) + 19 - (9*2) - (61*3) + 177; + return modificationTerm; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi11.js b/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi11.js new file mode 100644 index 0000000000..54836c520c --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi11.js @@ -0,0 +1,108 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, large, imported script. +// It doesn't import any other scripts. +// It is imported from another script. + +function testFunc(seedValue) { + var retn = 5; + retn += (seedValue * 0.1145); + var firstFactor = calculateFirstFactor(seedValue); + var secondFactor = calculateSecondFactor(seedValue); + var modificationTerm = calculateModificationTerm(seedValue); + + // do some regexp matching + var someString = "This is a random string which we'll perform regular expression matching on to reduce considerably. This is meant to be part of a complex javascript expression whose evaluation takes considerably longer than the creation cost of QScriptValue."; + var regexpPattern = new RegExp("is", "i"); + var regexpOutputLength = 0; + var temp = regexpPattern.exec(someString); + while (temp == "is") { + regexpOutputLength += 4; + regexpOutputLength *= 2; + temp = regexpPattern.exec(someString); + if (regexpOutputLength > (seedValue * 3)) { + temp = "break"; + } + } + + // spin in a for loop for a while + var i = 0; + var j = 0; + var cumulativeTotal = 3; + for (i = 20; i > 1; i--) { + for (j = 31; j > 5; j--) { + var branchVariable = i + j; + if (branchVariable % 3 == 0) { + cumulativeTotal -= secondFactor; + } else { + cumulativeTotal += firstFactor; + } + + if (cumulativeTotal > (seedValue * 50)) { + break; + } + } + } + retn *= (1 + (cumulativeTotal * 0.001)); + retn *= (1 + (3.1415962 / seedValue)); + retn /= 2.41497; + retn -= (seedValue * -1); + return retn; +} + +function calculateFirstFactor(seedValue) { + var firstFactor = (0.45 * (9.3 / 3.1) - 0.90); + firstFactor *= (1 + (0.000011 / seedValue)); + return firstFactor; +} + +function calculateSecondFactor(seedValue) { + var secondFactor = 0.78 * (6.3 / 2.1) - (0.39 * 4); + secondFactor *= (1 + (0.000011 / seedValue)); + return secondFactor; +} + +function calculateModificationTerm(seedValue) { + var modificationTerm = (12 + (9*7) - 54 + 16 - ((calculateFirstFactor(seedValue) * seedValue) / 3) + (4*calculateSecondFactor(seedValue) * seedValue * 1.33)) + (calculateSecondFactor(seedValue) * seedValue); + modificationTerm = modificationTerm + (33/2) + 19 - (9*2) - (61*3) + 177; + return modificationTerm; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi12.js b/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi12.js new file mode 100644 index 0000000000..c48a81854c --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi12.js @@ -0,0 +1,108 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, large, imported script. +// It doesn't import any other scripts. +// It is imported from another script. + +function testFunc(seedValue) { + var retn = 5; + retn += (seedValue * 0.1245); + var firstFactor = calculateFirstFactor(seedValue); + var secondFactor = calculateSecondFactor(seedValue); + var modificationTerm = calculateModificationTerm(seedValue); + + // do some regexp matching + var someString = "This is a random string which we'll perform regular expression matching on to reduce considerably. This is meant to be part of a complex javascript expression whose evaluation takes considerably longer than the creation cost of QScriptValue."; + var regexpPattern = new RegExp("is", "i"); + var regexpOutputLength = 0; + var temp = regexpPattern.exec(someString); + while (temp == "is") { + regexpOutputLength += 4; + regexpOutputLength *= 2; + temp = regexpPattern.exec(someString); + if (regexpOutputLength > (seedValue * 3)) { + temp = "break"; + } + } + + // spin in a for loop for a while + var i = 0; + var j = 0; + var cumulativeTotal = 3; + for (i = 20; i > 1; i--) { + for (j = 31; j > 5; j--) { + var branchVariable = i + j; + if (branchVariable % 3 == 0) { + cumulativeTotal -= secondFactor; + } else { + cumulativeTotal += firstFactor; + } + + if (cumulativeTotal > (seedValue * 50)) { + break; + } + } + } + retn *= (1 + (cumulativeTotal * 0.001)); + retn *= (1 + (3.1415962 / seedValue)); + retn /= 2.41497; + retn -= (seedValue * -1); + return retn; +} + +function calculateFirstFactor(seedValue) { + var firstFactor = (0.45 * (9.3 / 3.1) - 0.90); + firstFactor *= (1 + (0.000012 / seedValue)); + return firstFactor; +} + +function calculateSecondFactor(seedValue) { + var secondFactor = 0.78 * (6.3 / 2.1) - (0.39 * 4); + secondFactor *= (1 + (0.000012 / seedValue)); + return secondFactor; +} + +function calculateModificationTerm(seedValue) { + var modificationTerm = (12 + (9*7) - 54 + 16 - ((calculateFirstFactor(seedValue) * seedValue) / 3) + (4*calculateSecondFactor(seedValue) * seedValue * 1.33)) + (calculateSecondFactor(seedValue) * seedValue); + modificationTerm = modificationTerm + (33/2) + 19 - (9*2) - (61*3) + 177; + return modificationTerm; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi13.js b/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi13.js new file mode 100644 index 0000000000..f228e129fd --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi13.js @@ -0,0 +1,108 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, large, imported script. +// It doesn't import any other scripts. +// It is imported from another script. + +function testFunc(seedValue) { + var retn = 5; + retn += (seedValue * 0.1345); + var firstFactor = calculateFirstFactor(seedValue); + var secondFactor = calculateSecondFactor(seedValue); + var modificationTerm = calculateModificationTerm(seedValue); + + // do some regexp matching + var someString = "This is a random string which we'll perform regular expression matching on to reduce considerably. This is meant to be part of a complex javascript expression whose evaluation takes considerably longer than the creation cost of QScriptValue."; + var regexpPattern = new RegExp("is", "i"); + var regexpOutputLength = 0; + var temp = regexpPattern.exec(someString); + while (temp == "is") { + regexpOutputLength += 4; + regexpOutputLength *= 2; + temp = regexpPattern.exec(someString); + if (regexpOutputLength > (seedValue * 3)) { + temp = "break"; + } + } + + // spin in a for loop for a while + var i = 0; + var j = 0; + var cumulativeTotal = 3; + for (i = 20; i > 1; i--) { + for (j = 31; j > 5; j--) { + var branchVariable = i + j; + if (branchVariable % 3 == 0) { + cumulativeTotal -= secondFactor; + } else { + cumulativeTotal += firstFactor; + } + + if (cumulativeTotal > (seedValue * 50)) { + break; + } + } + } + retn *= (1 + (cumulativeTotal * 0.001)); + retn *= (1 + (3.1415962 / seedValue)); + retn /= 2.41497; + retn -= (seedValue * -1); + return retn; +} + +function calculateFirstFactor(seedValue) { + var firstFactor = (0.45 * (9.3 / 3.1) - 0.90); + firstFactor *= (1 + (0.000013 / seedValue)); + return firstFactor; +} + +function calculateSecondFactor(seedValue) { + var secondFactor = 0.78 * (6.3 / 2.1) - (0.39 * 4); + secondFactor *= (1 + (0.000013 / seedValue)); + return secondFactor; +} + +function calculateModificationTerm(seedValue) { + var modificationTerm = (12 + (9*7) - 54 + 16 - ((calculateFirstFactor(seedValue) * seedValue) / 3) + (4*calculateSecondFactor(seedValue) * seedValue * 1.33)) + (calculateSecondFactor(seedValue) * seedValue); + modificationTerm = modificationTerm + (33/2) + 19 - (9*2) - (61*3) + 177; + return modificationTerm; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi14.js b/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi14.js new file mode 100644 index 0000000000..e97c58ad90 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi14.js @@ -0,0 +1,108 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, large, imported script. +// It doesn't import any other scripts. +// It is imported from another script. + +function testFunc(seedValue) { + var retn = 5; + retn += (seedValue * 0.1445); + var firstFactor = calculateFirstFactor(seedValue); + var secondFactor = calculateSecondFactor(seedValue); + var modificationTerm = calculateModificationTerm(seedValue); + + // do some regexp matching + var someString = "This is a random string which we'll perform regular expression matching on to reduce considerably. This is meant to be part of a complex javascript expression whose evaluation takes considerably longer than the creation cost of QScriptValue."; + var regexpPattern = new RegExp("is", "i"); + var regexpOutputLength = 0; + var temp = regexpPattern.exec(someString); + while (temp == "is") { + regexpOutputLength += 4; + regexpOutputLength *= 2; + temp = regexpPattern.exec(someString); + if (regexpOutputLength > (seedValue * 3)) { + temp = "break"; + } + } + + // spin in a for loop for a while + var i = 0; + var j = 0; + var cumulativeTotal = 3; + for (i = 20; i > 1; i--) { + for (j = 31; j > 5; j--) { + var branchVariable = i + j; + if (branchVariable % 3 == 0) { + cumulativeTotal -= secondFactor; + } else { + cumulativeTotal += firstFactor; + } + + if (cumulativeTotal > (seedValue * 50)) { + break; + } + } + } + retn *= (1 + (cumulativeTotal * 0.001)); + retn *= (1 + (3.1415962 / seedValue)); + retn /= 2.41497; + retn -= (seedValue * -1); + return retn; +} + +function calculateFirstFactor(seedValue) { + var firstFactor = (0.45 * (9.3 / 3.1) - 0.90); + firstFactor *= (1 + (0.000014 / seedValue)); + return firstFactor; +} + +function calculateSecondFactor(seedValue) { + var secondFactor = 0.78 * (6.3 / 2.1) - (0.39 * 4); + secondFactor *= (1 + (0.000014 / seedValue)); + return secondFactor; +} + +function calculateModificationTerm(seedValue) { + var modificationTerm = (12 + (9*7) - 54 + 16 - ((calculateFirstFactor(seedValue) * seedValue) / 3) + (4*calculateSecondFactor(seedValue) * seedValue * 1.33)) + (calculateSecondFactor(seedValue) * seedValue); + modificationTerm = modificationTerm + (33/2) + 19 - (9*2) - (61*3) + 177; + return modificationTerm; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi15.js b/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi15.js new file mode 100644 index 0000000000..7c08c62f82 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi15.js @@ -0,0 +1,108 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, large, imported script. +// It doesn't import any other scripts. +// It is imported from another script. + +function testFunc(seedValue) { + var retn = 5; + retn += (seedValue * 0.1545); + var firstFactor = calculateFirstFactor(seedValue); + var secondFactor = calculateSecondFactor(seedValue); + var modificationTerm = calculateModificationTerm(seedValue); + + // do some regexp matching + var someString = "This is a random string which we'll perform regular expression matching on to reduce considerably. This is meant to be part of a complex javascript expression whose evaluation takes considerably longer than the creation cost of QScriptValue."; + var regexpPattern = new RegExp("is", "i"); + var regexpOutputLength = 0; + var temp = regexpPattern.exec(someString); + while (temp == "is") { + regexpOutputLength += 4; + regexpOutputLength *= 2; + temp = regexpPattern.exec(someString); + if (regexpOutputLength > (seedValue * 3)) { + temp = "break"; + } + } + + // spin in a for loop for a while + var i = 0; + var j = 0; + var cumulativeTotal = 3; + for (i = 20; i > 1; i--) { + for (j = 31; j > 5; j--) { + var branchVariable = i + j; + if (branchVariable % 3 == 0) { + cumulativeTotal -= secondFactor; + } else { + cumulativeTotal += firstFactor; + } + + if (cumulativeTotal > (seedValue * 50)) { + break; + } + } + } + retn *= (1 + (cumulativeTotal * 0.001)); + retn *= (1 + (3.1415962 / seedValue)); + retn /= 2.41497; + retn -= (seedValue * -1); + return retn; +} + +function calculateFirstFactor(seedValue) { + var firstFactor = (0.45 * (9.3 / 3.1) - 0.90); + firstFactor *= (1 + (0.000015 / seedValue)); + return firstFactor; +} + +function calculateSecondFactor(seedValue) { + var secondFactor = 0.78 * (6.3 / 2.1) - (0.39 * 4); + secondFactor *= (1 + (0.000015 / seedValue)); + return secondFactor; +} + +function calculateModificationTerm(seedValue) { + var modificationTerm = (12 + (9*7) - 54 + 16 - ((calculateFirstFactor(seedValue) * seedValue) / 3) + (4*calculateSecondFactor(seedValue) * seedValue * 1.33)) + (calculateSecondFactor(seedValue) * seedValue); + modificationTerm = modificationTerm + (33/2) + 19 - (9*2) - (61*3) + 177; + return modificationTerm; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi2.js b/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi2.js new file mode 100644 index 0000000000..19154f0580 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi2.js @@ -0,0 +1,108 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, large, imported script. +// It doesn't import any other scripts. +// It is imported from another script. + +function testFunc(seedValue) { + var retn = 5; + retn += (seedValue * 0.245); + var firstFactor = calculateFirstFactor(seedValue); + var secondFactor = calculateSecondFactor(seedValue); + var modificationTerm = calculateModificationTerm(seedValue); + + // do some regexp matching + var someString = "This is a random string which we'll perform regular expression matching on to reduce considerably. This is meant to be part of a complex javascript expression whose evaluation takes considerably longer than the creation cost of QScriptValue."; + var regexpPattern = new RegExp("is", "i"); + var regexpOutputLength = 0; + var temp = regexpPattern.exec(someString); + while (temp == "is") { + regexpOutputLength += 4; + regexpOutputLength *= 2; + temp = regexpPattern.exec(someString); + if (regexpOutputLength > (seedValue * 3)) { + temp = "break"; + } + } + + // spin in a for loop for a while + var i = 0; + var j = 0; + var cumulativeTotal = 3; + for (i = 20; i > 1; i--) { + for (j = 31; j > 5; j--) { + var branchVariable = i + j; + if (branchVariable % 3 == 0) { + cumulativeTotal -= secondFactor; + } else { + cumulativeTotal += firstFactor; + } + + if (cumulativeTotal > (seedValue * 50)) { + break; + } + } + } + retn *= (1 + (cumulativeTotal * 0.001)); + retn *= (1 + (3.1415962 / seedValue)); + retn /= 2.41497; + retn -= (seedValue * -1); + return retn; +} + +function calculateFirstFactor(seedValue) { + var firstFactor = (0.45 * (9.3 / 3.1) - 0.90); + firstFactor *= (1 + (0.00002 / seedValue)); + return firstFactor; +} + +function calculateSecondFactor(seedValue) { + var secondFactor = 0.78 * (6.3 / 2.1) - (0.39 * 4); + secondFactor *= (1 + (0.00002 / seedValue)); + return secondFactor; +} + +function calculateModificationTerm(seedValue) { + var modificationTerm = (12 + (9*7) - 54 + 16 - ((calculateFirstFactor(seedValue) * seedValue) / 3) + (4*calculateSecondFactor(seedValue) * seedValue * 1.33)) + (calculateSecondFactor(seedValue) * seedValue); + modificationTerm = modificationTerm + (33/2) + 19 - (9*2) - (61*3) + 177; + return modificationTerm; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi3.js b/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi3.js new file mode 100644 index 0000000000..473a8b1145 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi3.js @@ -0,0 +1,108 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, large, imported script. +// It doesn't import any other scripts. +// It is imported from another script. + +function testFunc(seedValue) { + var retn = 5; + retn += (seedValue * 0.345); + var firstFactor = calculateFirstFactor(seedValue); + var secondFactor = calculateSecondFactor(seedValue); + var modificationTerm = calculateModificationTerm(seedValue); + + // do some regexp matching + var someString = "This is a random string which we'll perform regular expression matching on to reduce considerably. This is meant to be part of a complex javascript expression whose evaluation takes considerably longer than the creation cost of QScriptValue."; + var regexpPattern = new RegExp("is", "i"); + var regexpOutputLength = 0; + var temp = regexpPattern.exec(someString); + while (temp == "is") { + regexpOutputLength += 4; + regexpOutputLength *= 2; + temp = regexpPattern.exec(someString); + if (regexpOutputLength > (seedValue * 3)) { + temp = "break"; + } + } + + // spin in a for loop for a while + var i = 0; + var j = 0; + var cumulativeTotal = 3; + for (i = 20; i > 1; i--) { + for (j = 31; j > 5; j--) { + var branchVariable = i + j; + if (branchVariable % 3 == 0) { + cumulativeTotal -= secondFactor; + } else { + cumulativeTotal += firstFactor; + } + + if (cumulativeTotal > (seedValue * 50)) { + break; + } + } + } + retn *= (1 + (cumulativeTotal * 0.001)); + retn *= (1 + (3.1415962 / seedValue)); + retn /= 2.41497; + retn -= (seedValue * -1); + return retn; +} + +function calculateFirstFactor(seedValue) { + var firstFactor = (0.45 * (9.3 / 3.1) - 0.90); + firstFactor *= (1 + (0.00003 / seedValue)); + return firstFactor; +} + +function calculateSecondFactor(seedValue) { + var secondFactor = 0.78 * (6.3 / 2.1) - (0.39 * 4); + secondFactor *= (1 + (0.00003 / seedValue)); + return secondFactor; +} + +function calculateModificationTerm(seedValue) { + var modificationTerm = (12 + (9*7) - 54 + 16 - ((calculateFirstFactor(seedValue) * seedValue) / 3) + (4*calculateSecondFactor(seedValue) * seedValue * 1.33)) + (calculateSecondFactor(seedValue) * seedValue); + modificationTerm = modificationTerm + (33/2) + 19 - (9*2) - (61*3) + 177; + return modificationTerm; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi4.js b/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi4.js new file mode 100644 index 0000000000..96f8851226 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi4.js @@ -0,0 +1,108 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, large, imported script. +// It doesn't import any other scripts. +// It is imported from another script. + +function testFunc(seedValue) { + var retn = 5; + retn += (seedValue * 0.445); + var firstFactor = calculateFirstFactor(seedValue); + var secondFactor = calculateSecondFactor(seedValue); + var modificationTerm = calculateModificationTerm(seedValue); + + // do some regexp matching + var someString = "This is a random string which we'll perform regular expression matching on to reduce considerably. This is meant to be part of a complex javascript expression whose evaluation takes considerably longer than the creation cost of QScriptValue."; + var regexpPattern = new RegExp("is", "i"); + var regexpOutputLength = 0; + var temp = regexpPattern.exec(someString); + while (temp == "is") { + regexpOutputLength += 4; + regexpOutputLength *= 2; + temp = regexpPattern.exec(someString); + if (regexpOutputLength > (seedValue * 3)) { + temp = "break"; + } + } + + // spin in a for loop for a while + var i = 0; + var j = 0; + var cumulativeTotal = 3; + for (i = 20; i > 1; i--) { + for (j = 31; j > 5; j--) { + var branchVariable = i + j; + if (branchVariable % 3 == 0) { + cumulativeTotal -= secondFactor; + } else { + cumulativeTotal += firstFactor; + } + + if (cumulativeTotal > (seedValue * 50)) { + break; + } + } + } + retn *= (1 + (cumulativeTotal * 0.001)); + retn *= (1 + (3.1415962 / seedValue)); + retn /= 2.41497; + retn -= (seedValue * -1); + return retn; +} + +function calculateFirstFactor(seedValue) { + var firstFactor = (0.45 * (9.3 / 3.1) - 0.90); + firstFactor *= (1 + (0.00004 / seedValue)); + return firstFactor; +} + +function calculateSecondFactor(seedValue) { + var secondFactor = 0.78 * (6.3 / 2.1) - (0.39 * 4); + secondFactor *= (1 + (0.00004 / seedValue)); + return secondFactor; +} + +function calculateModificationTerm(seedValue) { + var modificationTerm = (12 + (9*7) - 54 + 16 - ((calculateFirstFactor(seedValue) * seedValue) / 3) + (4*calculateSecondFactor(seedValue) * seedValue * 1.33)) + (calculateSecondFactor(seedValue) * seedValue); + modificationTerm = modificationTerm + (33/2) + 19 - (9*2) - (61*3) + 177; + return modificationTerm; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi5.js b/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi5.js new file mode 100644 index 0000000000..0aa4a3b4de --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi5.js @@ -0,0 +1,108 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, large, imported script. +// It doesn't import any other scripts. +// It is imported from another script. + +function testFunc(seedValue) { + var retn = 5; + retn += (seedValue * 0.545); + var firstFactor = calculateFirstFactor(seedValue); + var secondFactor = calculateSecondFactor(seedValue); + var modificationTerm = calculateModificationTerm(seedValue); + + // do some regexp matching + var someString = "This is a random string which we'll perform regular expression matching on to reduce considerably. This is meant to be part of a complex javascript expression whose evaluation takes considerably longer than the creation cost of QScriptValue."; + var regexpPattern = new RegExp("is", "i"); + var regexpOutputLength = 0; + var temp = regexpPattern.exec(someString); + while (temp == "is") { + regexpOutputLength += 4; + regexpOutputLength *= 2; + temp = regexpPattern.exec(someString); + if (regexpOutputLength > (seedValue * 3)) { + temp = "break"; + } + } + + // spin in a for loop for a while + var i = 0; + var j = 0; + var cumulativeTotal = 3; + for (i = 20; i > 1; i--) { + for (j = 31; j > 5; j--) { + var branchVariable = i + j; + if (branchVariable % 3 == 0) { + cumulativeTotal -= secondFactor; + } else { + cumulativeTotal += firstFactor; + } + + if (cumulativeTotal > (seedValue * 50)) { + break; + } + } + } + retn *= (1 + (cumulativeTotal * 0.001)); + retn *= (1 + (3.1415962 / seedValue)); + retn /= 2.41497; + retn -= (seedValue * -1); + return retn; +} + +function calculateFirstFactor(seedValue) { + var firstFactor = (0.45 * (9.3 / 3.1) - 0.90); + firstFactor *= (1 + (0.00005 / seedValue)); + return firstFactor; +} + +function calculateSecondFactor(seedValue) { + var secondFactor = 0.78 * (6.3 / 2.1) - (0.39 * 4); + secondFactor *= (1 + (0.00005 / seedValue)); + return secondFactor; +} + +function calculateModificationTerm(seedValue) { + var modificationTerm = (12 + (9*7) - 54 + 16 - ((calculateFirstFactor(seedValue) * seedValue) / 3) + (4*calculateSecondFactor(seedValue) * seedValue * 1.33)) + (calculateSecondFactor(seedValue) * seedValue); + modificationTerm = modificationTerm + (33/2) + 19 - (9*2) - (61*3) + 177; + return modificationTerm; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi6.js b/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi6.js new file mode 100644 index 0000000000..550e4054f7 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi6.js @@ -0,0 +1,108 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, large, imported script. +// It doesn't import any other scripts. +// It is imported from another script. + +function testFunc(seedValue) { + var retn = 5; + retn += (seedValue * 0.645); + var firstFactor = calculateFirstFactor(seedValue); + var secondFactor = calculateSecondFactor(seedValue); + var modificationTerm = calculateModificationTerm(seedValue); + + // do some regexp matching + var someString = "This is a random string which we'll perform regular expression matching on to reduce considerably. This is meant to be part of a complex javascript expression whose evaluation takes considerably longer than the creation cost of QScriptValue."; + var regexpPattern = new RegExp("is", "i"); + var regexpOutputLength = 0; + var temp = regexpPattern.exec(someString); + while (temp == "is") { + regexpOutputLength += 4; + regexpOutputLength *= 2; + temp = regexpPattern.exec(someString); + if (regexpOutputLength > (seedValue * 3)) { + temp = "break"; + } + } + + // spin in a for loop for a while + var i = 0; + var j = 0; + var cumulativeTotal = 3; + for (i = 20; i > 1; i--) { + for (j = 31; j > 5; j--) { + var branchVariable = i + j; + if (branchVariable % 3 == 0) { + cumulativeTotal -= secondFactor; + } else { + cumulativeTotal += firstFactor; + } + + if (cumulativeTotal > (seedValue * 50)) { + break; + } + } + } + retn *= (1 + (cumulativeTotal * 0.001)); + retn *= (1 + (3.1415962 / seedValue)); + retn /= 2.41497; + retn -= (seedValue * -1); + return retn; +} + +function calculateFirstFactor(seedValue) { + var firstFactor = (0.45 * (9.3 / 3.1) - 0.90); + firstFactor *= (1 + (0.00006 / seedValue)); + return firstFactor; +} + +function calculateSecondFactor(seedValue) { + var secondFactor = 0.78 * (6.3 / 2.1) - (0.39 * 4); + secondFactor *= (1 + (0.00006 / seedValue)); + return secondFactor; +} + +function calculateModificationTerm(seedValue) { + var modificationTerm = (12 + (9*7) - 54 + 16 - ((calculateFirstFactor(seedValue) * seedValue) / 3) + (4*calculateSecondFactor(seedValue) * seedValue * 1.33)) + (calculateSecondFactor(seedValue) * seedValue); + modificationTerm = modificationTerm + (33/2) + 19 - (9*2) - (61*3) + 177; + return modificationTerm; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi7.js b/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi7.js new file mode 100644 index 0000000000..a3502c2bdb --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi7.js @@ -0,0 +1,108 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, large, imported script. +// It doesn't import any other scripts. +// It is imported from another script. + +function testFunc(seedValue) { + var retn = 5; + retn += (seedValue * 0.745); + var firstFactor = calculateFirstFactor(seedValue); + var secondFactor = calculateSecondFactor(seedValue); + var modificationTerm = calculateModificationTerm(seedValue); + + // do some regexp matching + var someString = "This is a random string which we'll perform regular expression matching on to reduce considerably. This is meant to be part of a complex javascript expression whose evaluation takes considerably longer than the creation cost of QScriptValue."; + var regexpPattern = new RegExp("is", "i"); + var regexpOutputLength = 0; + var temp = regexpPattern.exec(someString); + while (temp == "is") { + regexpOutputLength += 4; + regexpOutputLength *= 2; + temp = regexpPattern.exec(someString); + if (regexpOutputLength > (seedValue * 3)) { + temp = "break"; + } + } + + // spin in a for loop for a while + var i = 0; + var j = 0; + var cumulativeTotal = 3; + for (i = 20; i > 1; i--) { + for (j = 31; j > 5; j--) { + var branchVariable = i + j; + if (branchVariable % 3 == 0) { + cumulativeTotal -= secondFactor; + } else { + cumulativeTotal += firstFactor; + } + + if (cumulativeTotal > (seedValue * 50)) { + break; + } + } + } + retn *= (1 + (cumulativeTotal * 0.001)); + retn *= (1 + (3.1415962 / seedValue)); + retn /= 2.41497; + retn -= (seedValue * -1); + return retn; +} + +function calculateFirstFactor(seedValue) { + var firstFactor = (0.45 * (9.3 / 3.1) - 0.90); + firstFactor *= (1 + (0.00007 / seedValue)); + return firstFactor; +} + +function calculateSecondFactor(seedValue) { + var secondFactor = 0.78 * (6.3 / 2.1) - (0.39 * 4); + secondFactor *= (1 + (0.00007 / seedValue)); + return secondFactor; +} + +function calculateModificationTerm(seedValue) { + var modificationTerm = (12 + (9*7) - 54 + 16 - ((calculateFirstFactor(seedValue) * seedValue) / 3) + (4*calculateSecondFactor(seedValue) * seedValue * 1.33)) + (calculateSecondFactor(seedValue) * seedValue); + modificationTerm = modificationTerm + (33/2) + 19 - (9*2) - (61*3) + 177; + return modificationTerm; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi8.js b/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi8.js new file mode 100644 index 0000000000..af9c574e7c --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi8.js @@ -0,0 +1,108 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, large, imported script. +// It doesn't import any other scripts. +// It is imported from another script. + +function testFunc(seedValue) { + var retn = 5; + retn += (seedValue * 0.845); + var firstFactor = calculateFirstFactor(seedValue); + var secondFactor = calculateSecondFactor(seedValue); + var modificationTerm = calculateModificationTerm(seedValue); + + // do some regexp matching + var someString = "This is a random string which we'll perform regular expression matching on to reduce considerably. This is meant to be part of a complex javascript expression whose evaluation takes considerably longer than the creation cost of QScriptValue."; + var regexpPattern = new RegExp("is", "i"); + var regexpOutputLength = 0; + var temp = regexpPattern.exec(someString); + while (temp == "is") { + regexpOutputLength += 4; + regexpOutputLength *= 2; + temp = regexpPattern.exec(someString); + if (regexpOutputLength > (seedValue * 3)) { + temp = "break"; + } + } + + // spin in a for loop for a while + var i = 0; + var j = 0; + var cumulativeTotal = 3; + for (i = 20; i > 1; i--) { + for (j = 31; j > 5; j--) { + var branchVariable = i + j; + if (branchVariable % 3 == 0) { + cumulativeTotal -= secondFactor; + } else { + cumulativeTotal += firstFactor; + } + + if (cumulativeTotal > (seedValue * 50)) { + break; + } + } + } + retn *= (1 + (cumulativeTotal * 0.001)); + retn *= (1 + (3.1415962 / seedValue)); + retn /= 2.41497; + retn -= (seedValue * -1); + return retn; +} + +function calculateFirstFactor(seedValue) { + var firstFactor = (0.45 * (9.3 / 3.1) - 0.90); + firstFactor *= (1 + (0.00008 / seedValue)); + return firstFactor; +} + +function calculateSecondFactor(seedValue) { + var secondFactor = 0.78 * (6.3 / 2.1) - (0.39 * 4); + secondFactor *= (1 + (0.00008 / seedValue)); + return secondFactor; +} + +function calculateModificationTerm(seedValue) { + var modificationTerm = (12 + (9*7) - 54 + 16 - ((calculateFirstFactor(seedValue) * seedValue) / 3) + (4*calculateSecondFactor(seedValue) * seedValue * 1.33)) + (calculateSecondFactor(seedValue) * seedValue); + modificationTerm = modificationTerm + (33/2) + 19 - (9*2) - (61*3) + 177; + return modificationTerm; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi9.js b/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi9.js new file mode 100644 index 0000000000..1f233a6eed --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/mlbsi9.js @@ -0,0 +1,108 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, large, imported script. +// It doesn't import any other scripts. +// It is imported from another script. + +function testFunc(seedValue) { + var retn = 5; + retn += (seedValue * 0.945); + var firstFactor = calculateFirstFactor(seedValue); + var secondFactor = calculateSecondFactor(seedValue); + var modificationTerm = calculateModificationTerm(seedValue); + + // do some regexp matching + var someString = "This is a random string which we'll perform regular expression matching on to reduce considerably. This is meant to be part of a complex javascript expression whose evaluation takes considerably longer than the creation cost of QScriptValue."; + var regexpPattern = new RegExp("is", "i"); + var regexpOutputLength = 0; + var temp = regexpPattern.exec(someString); + while (temp == "is") { + regexpOutputLength += 4; + regexpOutputLength *= 2; + temp = regexpPattern.exec(someString); + if (regexpOutputLength > (seedValue * 3)) { + temp = "break"; + } + } + + // spin in a for loop for a while + var i = 0; + var j = 0; + var cumulativeTotal = 3; + for (i = 20; i > 1; i--) { + for (j = 31; j > 5; j--) { + var branchVariable = i + j; + if (branchVariable % 3 == 0) { + cumulativeTotal -= secondFactor; + } else { + cumulativeTotal += firstFactor; + } + + if (cumulativeTotal > (seedValue * 50)) { + break; + } + } + } + retn *= (1 + (cumulativeTotal * 0.001)); + retn *= (1 + (3.1415962 / seedValue)); + retn /= 2.41497; + retn -= (seedValue * -1); + return retn; +} + +function calculateFirstFactor(seedValue) { + var firstFactor = (0.45 * (9.3 / 3.1) - 0.90); + firstFactor *= (1 + (0.00009 / seedValue)); + return firstFactor; +} + +function calculateSecondFactor(seedValue) { + var secondFactor = 0.78 * (6.3 / 2.1) - (0.39 * 4); + secondFactor *= (1 + (0.00009 / seedValue)); + return secondFactor; +} + +function calculateModificationTerm(seedValue) { + var modificationTerm = (12 + (9*7) - 54 + 16 - ((calculateFirstFactor(seedValue) * seedValue) / 3) + (4*calculateSecondFactor(seedValue) * seedValue * 1.33)) + (calculateSecondFactor(seedValue) * seedValue); + modificationTerm = modificationTerm + (33/2) + 19 - (9*2) - (61*3) + 177; + return modificationTerm; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/mldsi.js b/tests/benchmarks/declarative/holistic/data/jsImports/mldsi.js new file mode 100644 index 0000000000..59df07c1c9 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/mldsi.js @@ -0,0 +1,105 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, small, imported script. +// It imports other small scripts which are deeply nested. + +.import "mldsi1.js" as Mldsi1 + +function testFunc(seedValue) { + var firstFactor = calculateFirstFactor(seedValue); + var secondFactor = calculateSecondFactor(seedValue); + var modificationTerm = calculateModificationTerm(seedValue); + + // do some regexp matching + var someString = "This is a random string which we'll perform regular expression matching on to reduce considerably. This is meant to be part of a complex javascript expression whose evaluation takes considerably longer than the creation cost of QScriptValue."; + var regexpPattern = new RegExp("is", "i"); + var regexpOutputLength = 0; + var temp = regexpPattern.exec(someString); + while (temp == "is") { + regexpOutputLength += 4; + regexpOutputLength *= 2; + temp = regexpPattern.exec(someString); + if (regexpOutputLength > (seedValue * 3)) { + temp = "break"; + } + } + + // spin in a for loop for a while + var i = 0; + var j = 0; + var cumulativeTotal = 3; + for (i = 20; i > 1; i--) { + for (j = 31; j > 5; j--) { + var branchVariable = i + j; + if (branchVariable % 3 == 0) { + cumulativeTotal -= secondFactor; + } else { + cumulativeTotal += firstFactor; + } + + if (cumulativeTotal > (seedValue * 50)) { + break; + } + } + } + var retn = cumulativeTotal * 0.5; + retn *= Mldsi1.testFunc(seedValue + retn); + return retn; +} + +function calculateFirstFactor(seedValue) { + var firstFactor = (0.45 * (9.3 / 3.1) - 0.90); + firstFactor *= (1 + (0.000017 / seedValue)); + return firstFactor; +} + +function calculateSecondFactor(seedValue) { + var secondFactor = 0.78 * (6.3 / 2.1) - (0.39 * 4); + secondFactor *= (1 + (0.000017 / seedValue)); + return secondFactor; +} + +function calculateModificationTerm(seedValue) { + var modificationTerm = (12 + (9*7) - 54 + 16 - ((calculateFirstFactor(seedValue) * seedValue) / 3) + (4*calculateSecondFactor(seedValue) * seedValue * 1.33)) + (calculateSecondFactor(seedValue) * seedValue); + modificationTerm = modificationTerm + (33/2) + 19 - (9*2) - (61*3) + 177; + return modificationTerm; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/mldsi1.js b/tests/benchmarks/declarative/holistic/data/jsImports/mldsi1.js new file mode 100644 index 0000000000..94d186b88c --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/mldsi1.js @@ -0,0 +1,107 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, large, imported script. +// It imports other large scripts which are deeply nested. +// It is imported by another script. + +.import "msdsi2.js" as Msdsi2 + +function testFunc(seedValue) { + var retn = 0.15; + var firstFactor = calculateFirstFactor(seedValue); + var secondFactor = calculateSecondFactor(seedValue); + var modificationTerm = calculateModificationTerm(seedValue); + + // do some regexp matching + var someString = "This is a random string which we'll perform regular expression matching on to reduce considerably. This is meant to be part of a complex javascript expression whose evaluation takes considerably longer than the creation cost of QScriptValue."; + var regexpPattern = new RegExp("is", "i"); + var regexpOutputLength = 0; + var temp = regexpPattern.exec(someString); + while (temp == "is") { + regexpOutputLength += 4; + regexpOutputLength *= 2; + temp = regexpPattern.exec(someString); + if (regexpOutputLength > (seedValue * 3)) { + temp = "break"; + } + } + + // spin in a for loop for a while + var i = 0; + var j = 0; + var cumulativeTotal = 3; + for (i = 20; i > 1; i--) { + for (j = 31; j > 5; j--) { + var branchVariable = i + j; + if (branchVariable % 3 == 0) { + cumulativeTotal -= secondFactor; + } else { + cumulativeTotal += firstFactor; + } + + if (cumulativeTotal > (seedValue * 50)) { + break; + } + } + } + retn *= (1 + (cumulativeTotal * 0.001)); + retn *= Msdsi2.testFunc(seedValue + retn); + return retn; +} + +function calculateFirstFactor(seedValue) { + var firstFactor = (0.45 * (9.3 / 3.1) - 0.90); + firstFactor *= (1 + (0.00001 / seedValue)); + return firstFactor; +} + +function calculateSecondFactor(seedValue) { + var secondFactor = 0.78 * (6.3 / 2.1) - (0.39 * 4); + secondFactor *= (1 + (0.00001 / seedValue)); + return secondFactor; +} + +function calculateModificationTerm(seedValue) { + var modificationTerm = (12 + (9*7) - 54 + 16 - ((calculateFirstFactor(seedValue) * seedValue) / 3) + (4*calculateSecondFactor(seedValue) * seedValue * 1.33)) + (calculateSecondFactor(seedValue) * seedValue); + modificationTerm = modificationTerm + (33/2) + 19 - (9*2) - (61*3) + 177; + return modificationTerm; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/mldsi10.js b/tests/benchmarks/declarative/holistic/data/jsImports/mldsi10.js new file mode 100644 index 0000000000..5a60306209 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/mldsi10.js @@ -0,0 +1,107 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, large, imported script. +// It imports other large scripts which are deeply nested. +// It is imported by another script. + +.import "msdsi11.js" as Msdsi11 + +function testFunc(seedValue) { + var retn = 0.105; + var firstFactor = calculateFirstFactor(seedValue); + var secondFactor = calculateSecondFactor(seedValue); + var modificationTerm = calculateModificationTerm(seedValue); + + // do some regexp matching + var someString = "This is a random string which we'll perform regular expression matching on to reduce considerably. This is meant to be part of a complex javascript expression whose evaluation takes considerably longer than the creation cost of QScriptValue."; + var regexpPattern = new RegExp("is", "i"); + var regexpOutputLength = 0; + var temp = regexpPattern.exec(someString); + while (temp == "is") { + regexpOutputLength += 4; + regexpOutputLength *= 2; + temp = regexpPattern.exec(someString); + if (regexpOutputLength > (seedValue * 3)) { + temp = "break"; + } + } + + // spin in a for loop for a while + var i = 0; + var j = 0; + var cumulativeTotal = 3; + for (i = 20; i > 1; i--) { + for (j = 31; j > 5; j--) { + var branchVariable = i + j; + if (branchVariable % 3 == 0) { + cumulativeTotal -= secondFactor; + } else { + cumulativeTotal += firstFactor; + } + + if (cumulativeTotal > (seedValue * 50)) { + break; + } + } + } + retn *= (1 + (cumulativeTotal * 0.001)); + retn *= Msdsi11.testFunc(seedValue + retn); + return retn; +} + +function calculateFirstFactor(seedValue) { + var firstFactor = (0.45 * (9.3 / 3.1) - 0.90); + firstFactor *= (1 + (0.000010 / seedValue)); + return firstFactor; +} + +function calculateSecondFactor(seedValue) { + var secondFactor = 0.78 * (6.3 / 2.1) - (0.39 * 4); + secondFactor *= (1 + (0.000010 / seedValue)); + return secondFactor; +} + +function calculateModificationTerm(seedValue) { + var modificationTerm = (12 + (9*7) - 54 + 16 - ((calculateFirstFactor(seedValue) * seedValue) / 3) + (4*calculateSecondFactor(seedValue) * seedValue * 1.33)) + (calculateSecondFactor(seedValue) * seedValue); + modificationTerm = modificationTerm + (33/2) + 19 - (9*2) - (61*3) + 177; + return modificationTerm; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/mldsi11.js b/tests/benchmarks/declarative/holistic/data/jsImports/mldsi11.js new file mode 100644 index 0000000000..8a7b95304c --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/mldsi11.js @@ -0,0 +1,107 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, large, imported script. +// It imports other large scripts which are deeply nested. +// It is imported by another script. + +.import "msdsi12.js" as Msdsi12 + +function testFunc(seedValue) { + var retn = 0.115; + var firstFactor = calculateFirstFactor(seedValue); + var secondFactor = calculateSecondFactor(seedValue); + var modificationTerm = calculateModificationTerm(seedValue); + + // do some regexp matching + var someString = "This is a random string which we'll perform regular expression matching on to reduce considerably. This is meant to be part of a complex javascript expression whose evaluation takes considerably longer than the creation cost of QScriptValue."; + var regexpPattern = new RegExp("is", "i"); + var regexpOutputLength = 0; + var temp = regexpPattern.exec(someString); + while (temp == "is") { + regexpOutputLength += 4; + regexpOutputLength *= 2; + temp = regexpPattern.exec(someString); + if (regexpOutputLength > (seedValue * 3)) { + temp = "break"; + } + } + + // spin in a for loop for a while + var i = 0; + var j = 0; + var cumulativeTotal = 3; + for (i = 20; i > 1; i--) { + for (j = 31; j > 5; j--) { + var branchVariable = i + j; + if (branchVariable % 3 == 0) { + cumulativeTotal -= secondFactor; + } else { + cumulativeTotal += firstFactor; + } + + if (cumulativeTotal > (seedValue * 50)) { + break; + } + } + } + retn *= (1 + (cumulativeTotal * 0.001)); + retn *= Msdsi12.testFunc(seedValue + retn); + return retn; +} + +function calculateFirstFactor(seedValue) { + var firstFactor = (0.45 * (9.3 / 3.1) - 0.90); + firstFactor *= (1 + (0.000011 / seedValue)); + return firstFactor; +} + +function calculateSecondFactor(seedValue) { + var secondFactor = 0.78 * (6.3 / 2.1) - (0.39 * 4); + secondFactor *= (1 + (0.000011 / seedValue)); + return secondFactor; +} + +function calculateModificationTerm(seedValue) { + var modificationTerm = (12 + (9*7) - 54 + 16 - ((calculateFirstFactor(seedValue) * seedValue) / 3) + (4*calculateSecondFactor(seedValue) * seedValue * 1.33)) + (calculateSecondFactor(seedValue) * seedValue); + modificationTerm = modificationTerm + (33/2) + 19 - (9*2) - (61*3) + 177; + return modificationTerm; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/mldsi12.js b/tests/benchmarks/declarative/holistic/data/jsImports/mldsi12.js new file mode 100644 index 0000000000..30f371649f --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/mldsi12.js @@ -0,0 +1,107 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, large, imported script. +// It imports other large scripts which are deeply nested. +// It is imported by another script. + +.import "msdsi13.js" as Msdsi13 + +function testFunc(seedValue) { + var retn = 0.125; + var firstFactor = calculateFirstFactor(seedValue); + var secondFactor = calculateSecondFactor(seedValue); + var modificationTerm = calculateModificationTerm(seedValue); + + // do some regexp matching + var someString = "This is a random string which we'll perform regular expression matching on to reduce considerably. This is meant to be part of a complex javascript expression whose evaluation takes considerably longer than the creation cost of QScriptValue."; + var regexpPattern = new RegExp("is", "i"); + var regexpOutputLength = 0; + var temp = regexpPattern.exec(someString); + while (temp == "is") { + regexpOutputLength += 4; + regexpOutputLength *= 2; + temp = regexpPattern.exec(someString); + if (regexpOutputLength > (seedValue * 3)) { + temp = "break"; + } + } + + // spin in a for loop for a while + var i = 0; + var j = 0; + var cumulativeTotal = 3; + for (i = 20; i > 1; i--) { + for (j = 31; j > 5; j--) { + var branchVariable = i + j; + if (branchVariable % 3 == 0) { + cumulativeTotal -= secondFactor; + } else { + cumulativeTotal += firstFactor; + } + + if (cumulativeTotal > (seedValue * 50)) { + break; + } + } + } + retn *= (1 + (cumulativeTotal * 0.001)); + retn *= Msdsi13.testFunc(seedValue + retn); + return retn; +} + +function calculateFirstFactor(seedValue) { + var firstFactor = (0.45 * (9.3 / 3.1) - 0.90); + firstFactor *= (1 + (0.000012 / seedValue)); + return firstFactor; +} + +function calculateSecondFactor(seedValue) { + var secondFactor = 0.78 * (6.3 / 2.1) - (0.39 * 4); + secondFactor *= (1 + (0.000012 / seedValue)); + return secondFactor; +} + +function calculateModificationTerm(seedValue) { + var modificationTerm = (12 + (9*7) - 54 + 16 - ((calculateFirstFactor(seedValue) * seedValue) / 3) + (4*calculateSecondFactor(seedValue) * seedValue * 1.33)) + (calculateSecondFactor(seedValue) * seedValue); + modificationTerm = modificationTerm + (33/2) + 19 - (9*2) - (61*3) + 177; + return modificationTerm; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/mldsi13.js b/tests/benchmarks/declarative/holistic/data/jsImports/mldsi13.js new file mode 100644 index 0000000000..65f3e4a952 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/mldsi13.js @@ -0,0 +1,107 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, large, imported script. +// It imports other large scripts which are deeply nested. +// It is imported by another script. + +.import "msdsi14.js" as Msdsi14 + +function testFunc(seedValue) { + var retn = 0.135; + var firstFactor = calculateFirstFactor(seedValue); + var secondFactor = calculateSecondFactor(seedValue); + var modificationTerm = calculateModificationTerm(seedValue); + + // do some regexp matching + var someString = "This is a random string which we'll perform regular expression matching on to reduce considerably. This is meant to be part of a complex javascript expression whose evaluation takes considerably longer than the creation cost of QScriptValue."; + var regexpPattern = new RegExp("is", "i"); + var regexpOutputLength = 0; + var temp = regexpPattern.exec(someString); + while (temp == "is") { + regexpOutputLength += 4; + regexpOutputLength *= 2; + temp = regexpPattern.exec(someString); + if (regexpOutputLength > (seedValue * 3)) { + temp = "break"; + } + } + + // spin in a for loop for a while + var i = 0; + var j = 0; + var cumulativeTotal = 3; + for (i = 20; i > 1; i--) { + for (j = 31; j > 5; j--) { + var branchVariable = i + j; + if (branchVariable % 3 == 0) { + cumulativeTotal -= secondFactor; + } else { + cumulativeTotal += firstFactor; + } + + if (cumulativeTotal > (seedValue * 50)) { + break; + } + } + } + retn *= (1 + (cumulativeTotal * 0.001)); + retn *= Msdsi14.testFunc(seedValue + retn); + return retn; +} + +function calculateFirstFactor(seedValue) { + var firstFactor = (0.45 * (9.3 / 3.1) - 0.90); + firstFactor *= (1 + (0.000013 / seedValue)); + return firstFactor; +} + +function calculateSecondFactor(seedValue) { + var secondFactor = 0.78 * (6.3 / 2.1) - (0.39 * 4); + secondFactor *= (1 + (0.000013 / seedValue)); + return secondFactor; +} + +function calculateModificationTerm(seedValue) { + var modificationTerm = (12 + (9*7) - 54 + 16 - ((calculateFirstFactor(seedValue) * seedValue) / 3) + (4*calculateSecondFactor(seedValue) * seedValue * 1.33)) + (calculateSecondFactor(seedValue) * seedValue); + modificationTerm = modificationTerm + (33/2) + 19 - (9*2) - (61*3) + 177; + return modificationTerm; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/mldsi14.js b/tests/benchmarks/declarative/holistic/data/jsImports/mldsi14.js new file mode 100644 index 0000000000..5dd6dcfe49 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/mldsi14.js @@ -0,0 +1,107 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, large, imported script. +// It imports other large scripts which are deeply nested. +// It is imported by another script. + +.import "msdsi15.js" as Msdsi15 + +function testFunc(seedValue) { + var retn = 0.145; + var firstFactor = calculateFirstFactor(seedValue); + var secondFactor = calculateSecondFactor(seedValue); + var modificationTerm = calculateModificationTerm(seedValue); + + // do some regexp matching + var someString = "This is a random string which we'll perform regular expression matching on to reduce considerably. This is meant to be part of a complex javascript expression whose evaluation takes considerably longer than the creation cost of QScriptValue."; + var regexpPattern = new RegExp("is", "i"); + var regexpOutputLength = 0; + var temp = regexpPattern.exec(someString); + while (temp == "is") { + regexpOutputLength += 4; + regexpOutputLength *= 2; + temp = regexpPattern.exec(someString); + if (regexpOutputLength > (seedValue * 3)) { + temp = "break"; + } + } + + // spin in a for loop for a while + var i = 0; + var j = 0; + var cumulativeTotal = 3; + for (i = 20; i > 1; i--) { + for (j = 31; j > 5; j--) { + var branchVariable = i + j; + if (branchVariable % 3 == 0) { + cumulativeTotal -= secondFactor; + } else { + cumulativeTotal += firstFactor; + } + + if (cumulativeTotal > (seedValue * 50)) { + break; + } + } + } + retn *= (1 + (cumulativeTotal * 0.001)); + retn *= Msdsi15.testFunc(seedValue + retn); + return retn; +} + +function calculateFirstFactor(seedValue) { + var firstFactor = (0.45 * (9.3 / 3.1) - 0.90); + firstFactor *= (1 + (0.000014 / seedValue)); + return firstFactor; +} + +function calculateSecondFactor(seedValue) { + var secondFactor = 0.78 * (6.3 / 2.1) - (0.39 * 4); + secondFactor *= (1 + (0.000014 / seedValue)); + return secondFactor; +} + +function calculateModificationTerm(seedValue) { + var modificationTerm = (12 + (9*7) - 54 + 16 - ((calculateFirstFactor(seedValue) * seedValue) / 3) + (4*calculateSecondFactor(seedValue) * seedValue * 1.33)) + (calculateSecondFactor(seedValue) * seedValue); + modificationTerm = modificationTerm + (33/2) + 19 - (9*2) - (61*3) + 177; + return modificationTerm; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/mldsi15.js b/tests/benchmarks/declarative/holistic/data/jsImports/mldsi15.js new file mode 100644 index 0000000000..c6873d8e72 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/mldsi15.js @@ -0,0 +1,104 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, large, imported script. +// It is imported by another script. + +function testFunc(seedValue) { + var retn = 0.155; + var firstFactor = calculateFirstFactor(seedValue); + var secondFactor = calculateSecondFactor(seedValue); + var modificationTerm = calculateModificationTerm(seedValue); + + // do some regexp matching + var someString = "This is a random string which we'll perform regular expression matching on to reduce considerably. This is meant to be part of a complex javascript expression whose evaluation takes considerably longer than the creation cost of QScriptValue."; + var regexpPattern = new RegExp("is", "i"); + var regexpOutputLength = 0; + var temp = regexpPattern.exec(someString); + while (temp == "is") { + regexpOutputLength += 4; + regexpOutputLength *= 2; + temp = regexpPattern.exec(someString); + if (regexpOutputLength > (seedValue * 3)) { + temp = "break"; + } + } + + // spin in a for loop for a while + var i = 0; + var j = 0; + var cumulativeTotal = 3; + for (i = 20; i > 1; i--) { + for (j = 31; j > 5; j--) { + var branchVariable = i + j; + if (branchVariable % 3 == 0) { + cumulativeTotal -= secondFactor; + } else { + cumulativeTotal += firstFactor; + } + + if (cumulativeTotal > (seedValue * 50)) { + break; + } + } + } + retn *= (1 + (cumulativeTotal * 0.001)); + retn *= (seedValue + retn); + return retn; +} + +function calculateFirstFactor(seedValue) { + var firstFactor = (0.45 * (9.3 / 3.1) - 0.90); + firstFactor *= (1 + (0.000015 / seedValue)); + return firstFactor; +} + +function calculateSecondFactor(seedValue) { + var secondFactor = 0.78 * (6.3 / 2.1) - (0.39 * 4); + secondFactor *= (1 + (0.000015 / seedValue)); + return secondFactor; +} + +function calculateModificationTerm(seedValue) { + var modificationTerm = (12 + (9*7) - 54 + 16 - ((calculateFirstFactor(seedValue) * seedValue) / 3) + (4*calculateSecondFactor(seedValue) * seedValue * 1.33)) + (calculateSecondFactor(seedValue) * seedValue); + modificationTerm = modificationTerm + (33/2) + 19 - (9*2) - (61*3) + 177; + return modificationTerm; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/mldsi2.js b/tests/benchmarks/declarative/holistic/data/jsImports/mldsi2.js new file mode 100644 index 0000000000..a876ebee7d --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/mldsi2.js @@ -0,0 +1,107 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, large, imported script. +// It imports other large scripts which are deeply nested. +// It is imported by another script. + +.import "msdsi3.js" as Msdsi3 + +function testFunc(seedValue) { + var retn = 0.25; + var firstFactor = calculateFirstFactor(seedValue); + var secondFactor = calculateSecondFactor(seedValue); + var modificationTerm = calculateModificationTerm(seedValue); + + // do some regexp matching + var someString = "This is a random string which we'll perform regular expression matching on to reduce considerably. This is meant to be part of a complex javascript expression whose evaluation takes considerably longer than the creation cost of QScriptValue."; + var regexpPattern = new RegExp("is", "i"); + var regexpOutputLength = 0; + var temp = regexpPattern.exec(someString); + while (temp == "is") { + regexpOutputLength += 4; + regexpOutputLength *= 2; + temp = regexpPattern.exec(someString); + if (regexpOutputLength > (seedValue * 3)) { + temp = "break"; + } + } + + // spin in a for loop for a while + var i = 0; + var j = 0; + var cumulativeTotal = 3; + for (i = 20; i > 1; i--) { + for (j = 31; j > 5; j--) { + var branchVariable = i + j; + if (branchVariable % 3 == 0) { + cumulativeTotal -= secondFactor; + } else { + cumulativeTotal += firstFactor; + } + + if (cumulativeTotal > (seedValue * 50)) { + break; + } + } + } + retn *= (1 + (cumulativeTotal * 0.001)); + retn *= Msdsi3.testFunc(seedValue + retn); + return retn; +} + +function calculateFirstFactor(seedValue) { + var firstFactor = (0.45 * (9.3 / 3.1) - 0.90); + firstFactor *= (1 + (0.00002 / seedValue)); + return firstFactor; +} + +function calculateSecondFactor(seedValue) { + var secondFactor = 0.78 * (6.3 / 2.1) - (0.39 * 4); + secondFactor *= (1 + (0.00002 / seedValue)); + return secondFactor; +} + +function calculateModificationTerm(seedValue) { + var modificationTerm = (12 + (9*7) - 54 + 16 - ((calculateFirstFactor(seedValue) * seedValue) / 3) + (4*calculateSecondFactor(seedValue) * seedValue * 1.33)) + (calculateSecondFactor(seedValue) * seedValue); + modificationTerm = modificationTerm + (33/2) + 19 - (9*2) - (61*3) + 177; + return modificationTerm; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/mldsi3.js b/tests/benchmarks/declarative/holistic/data/jsImports/mldsi3.js new file mode 100644 index 0000000000..cab8b2662d --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/mldsi3.js @@ -0,0 +1,107 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, large, imported script. +// It imports other large scripts which are deeply nested. +// It is imported by another script. + +.import "msdsi4.js" as Msdsi4 + +function testFunc(seedValue) { + var retn = 0.35; + var firstFactor = calculateFirstFactor(seedValue); + var secondFactor = calculateSecondFactor(seedValue); + var modificationTerm = calculateModificationTerm(seedValue); + + // do some regexp matching + var someString = "This is a random string which we'll perform regular expression matching on to reduce considerably. This is meant to be part of a complex javascript expression whose evaluation takes considerably longer than the creation cost of QScriptValue."; + var regexpPattern = new RegExp("is", "i"); + var regexpOutputLength = 0; + var temp = regexpPattern.exec(someString); + while (temp == "is") { + regexpOutputLength += 4; + regexpOutputLength *= 2; + temp = regexpPattern.exec(someString); + if (regexpOutputLength > (seedValue * 3)) { + temp = "break"; + } + } + + // spin in a for loop for a while + var i = 0; + var j = 0; + var cumulativeTotal = 3; + for (i = 20; i > 1; i--) { + for (j = 31; j > 5; j--) { + var branchVariable = i + j; + if (branchVariable % 3 == 0) { + cumulativeTotal -= secondFactor; + } else { + cumulativeTotal += firstFactor; + } + + if (cumulativeTotal > (seedValue * 50)) { + break; + } + } + } + retn *= (1 + (cumulativeTotal * 0.001)); + retn *= Msdsi4.testFunc(seedValue + retn); + return retn; +} + +function calculateFirstFactor(seedValue) { + var firstFactor = (0.45 * (9.3 / 3.1) - 0.90); + firstFactor *= (1 + (0.00003 / seedValue)); + return firstFactor; +} + +function calculateSecondFactor(seedValue) { + var secondFactor = 0.78 * (6.3 / 2.1) - (0.39 * 4); + secondFactor *= (1 + (0.00003 / seedValue)); + return secondFactor; +} + +function calculateModificationTerm(seedValue) { + var modificationTerm = (12 + (9*7) - 54 + 16 - ((calculateFirstFactor(seedValue) * seedValue) / 3) + (4*calculateSecondFactor(seedValue) * seedValue * 1.33)) + (calculateSecondFactor(seedValue) * seedValue); + modificationTerm = modificationTerm + (33/2) + 19 - (9*2) - (61*3) + 177; + return modificationTerm; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/mldsi4.js b/tests/benchmarks/declarative/holistic/data/jsImports/mldsi4.js new file mode 100644 index 0000000000..69c14a0278 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/mldsi4.js @@ -0,0 +1,107 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, large, imported script. +// It imports other large scripts which are deeply nested. +// It is imported by another script. + +.import "msdsi5.js" as Msdsi5 + +function testFunc(seedValue) { + var retn = 0.45; + var firstFactor = calculateFirstFactor(seedValue); + var secondFactor = calculateSecondFactor(seedValue); + var modificationTerm = calculateModificationTerm(seedValue); + + // do some regexp matching + var someString = "This is a random string which we'll perform regular expression matching on to reduce considerably. This is meant to be part of a complex javascript expression whose evaluation takes considerably longer than the creation cost of QScriptValue."; + var regexpPattern = new RegExp("is", "i"); + var regexpOutputLength = 0; + var temp = regexpPattern.exec(someString); + while (temp == "is") { + regexpOutputLength += 4; + regexpOutputLength *= 2; + temp = regexpPattern.exec(someString); + if (regexpOutputLength > (seedValue * 3)) { + temp = "break"; + } + } + + // spin in a for loop for a while + var i = 0; + var j = 0; + var cumulativeTotal = 3; + for (i = 20; i > 1; i--) { + for (j = 31; j > 5; j--) { + var branchVariable = i + j; + if (branchVariable % 3 == 0) { + cumulativeTotal -= secondFactor; + } else { + cumulativeTotal += firstFactor; + } + + if (cumulativeTotal > (seedValue * 50)) { + break; + } + } + } + retn *= (1 + (cumulativeTotal * 0.001)); + retn *= Msdsi5.testFunc(seedValue + retn); + return retn; +} + +function calculateFirstFactor(seedValue) { + var firstFactor = (0.45 * (9.3 / 3.1) - 0.90); + firstFactor *= (1 + (0.00004 / seedValue)); + return firstFactor; +} + +function calculateSecondFactor(seedValue) { + var secondFactor = 0.78 * (6.3 / 2.1) - (0.39 * 4); + secondFactor *= (1 + (0.00004 / seedValue)); + return secondFactor; +} + +function calculateModificationTerm(seedValue) { + var modificationTerm = (12 + (9*7) - 54 + 16 - ((calculateFirstFactor(seedValue) * seedValue) / 3) + (4*calculateSecondFactor(seedValue) * seedValue * 1.33)) + (calculateSecondFactor(seedValue) * seedValue); + modificationTerm = modificationTerm + (33/2) + 19 - (9*2) - (61*3) + 177; + return modificationTerm; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/mldsi5.js b/tests/benchmarks/declarative/holistic/data/jsImports/mldsi5.js new file mode 100644 index 0000000000..889766f3ce --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/mldsi5.js @@ -0,0 +1,107 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, large, imported script. +// It imports other large scripts which are deeply nested. +// It is imported by another script. + +.import "msdsi6.js" as Msdsi6 + +function testFunc(seedValue) { + var retn = 0.55; + var firstFactor = calculateFirstFactor(seedValue); + var secondFactor = calculateSecondFactor(seedValue); + var modificationTerm = calculateModificationTerm(seedValue); + + // do some regexp matching + var someString = "This is a random string which we'll perform regular expression matching on to reduce considerably. This is meant to be part of a complex javascript expression whose evaluation takes considerably longer than the creation cost of QScriptValue."; + var regexpPattern = new RegExp("is", "i"); + var regexpOutputLength = 0; + var temp = regexpPattern.exec(someString); + while (temp == "is") { + regexpOutputLength += 4; + regexpOutputLength *= 2; + temp = regexpPattern.exec(someString); + if (regexpOutputLength > (seedValue * 3)) { + temp = "break"; + } + } + + // spin in a for loop for a while + var i = 0; + var j = 0; + var cumulativeTotal = 3; + for (i = 20; i > 1; i--) { + for (j = 31; j > 5; j--) { + var branchVariable = i + j; + if (branchVariable % 3 == 0) { + cumulativeTotal -= secondFactor; + } else { + cumulativeTotal += firstFactor; + } + + if (cumulativeTotal > (seedValue * 50)) { + break; + } + } + } + retn *= (1 + (cumulativeTotal * 0.001)); + retn *= Msdsi6.testFunc(seedValue + retn); + return retn; +} + +function calculateFirstFactor(seedValue) { + var firstFactor = (0.45 * (9.3 / 3.1) - 0.90); + firstFactor *= (1 + (0.00005 / seedValue)); + return firstFactor; +} + +function calculateSecondFactor(seedValue) { + var secondFactor = 0.78 * (6.3 / 2.1) - (0.39 * 4); + secondFactor *= (1 + (0.00005 / seedValue)); + return secondFactor; +} + +function calculateModificationTerm(seedValue) { + var modificationTerm = (12 + (9*7) - 54 + 16 - ((calculateFirstFactor(seedValue) * seedValue) / 3) + (4*calculateSecondFactor(seedValue) * seedValue * 1.33)) + (calculateSecondFactor(seedValue) * seedValue); + modificationTerm = modificationTerm + (33/2) + 19 - (9*2) - (61*3) + 177; + return modificationTerm; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/mldsi6.js b/tests/benchmarks/declarative/holistic/data/jsImports/mldsi6.js new file mode 100644 index 0000000000..332b60679e --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/mldsi6.js @@ -0,0 +1,107 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, large, imported script. +// It imports other large scripts which are deeply nested. +// It is imported by another script. + +.import "msdsi7.js" as Msdsi7 + +function testFunc(seedValue) { + var retn = 0.65; + var firstFactor = calculateFirstFactor(seedValue); + var secondFactor = calculateSecondFactor(seedValue); + var modificationTerm = calculateModificationTerm(seedValue); + + // do some regexp matching + var someString = "This is a random string which we'll perform regular expression matching on to reduce considerably. This is meant to be part of a complex javascript expression whose evaluation takes considerably longer than the creation cost of QScriptValue."; + var regexpPattern = new RegExp("is", "i"); + var regexpOutputLength = 0; + var temp = regexpPattern.exec(someString); + while (temp == "is") { + regexpOutputLength += 4; + regexpOutputLength *= 2; + temp = regexpPattern.exec(someString); + if (regexpOutputLength > (seedValue * 3)) { + temp = "break"; + } + } + + // spin in a for loop for a while + var i = 0; + var j = 0; + var cumulativeTotal = 3; + for (i = 20; i > 1; i--) { + for (j = 31; j > 5; j--) { + var branchVariable = i + j; + if (branchVariable % 3 == 0) { + cumulativeTotal -= secondFactor; + } else { + cumulativeTotal += firstFactor; + } + + if (cumulativeTotal > (seedValue * 50)) { + break; + } + } + } + retn *= (1 + (cumulativeTotal * 0.001)); + retn *= Msdsi7.testFunc(seedValue + retn); + return retn; +} + +function calculateFirstFactor(seedValue) { + var firstFactor = (0.45 * (9.3 / 3.1) - 0.90); + firstFactor *= (1 + (0.00006 / seedValue)); + return firstFactor; +} + +function calculateSecondFactor(seedValue) { + var secondFactor = 0.78 * (6.3 / 2.1) - (0.39 * 4); + secondFactor *= (1 + (0.00006 / seedValue)); + return secondFactor; +} + +function calculateModificationTerm(seedValue) { + var modificationTerm = (12 + (9*7) - 54 + 16 - ((calculateFirstFactor(seedValue) * seedValue) / 3) + (4*calculateSecondFactor(seedValue) * seedValue * 1.33)) + (calculateSecondFactor(seedValue) * seedValue); + modificationTerm = modificationTerm + (33/2) + 19 - (9*2) - (61*3) + 177; + return modificationTerm; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/mldsi7.js b/tests/benchmarks/declarative/holistic/data/jsImports/mldsi7.js new file mode 100644 index 0000000000..0b1ef645b0 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/mldsi7.js @@ -0,0 +1,107 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, large, imported script. +// It imports other large scripts which are deeply nested. +// It is imported by another script. + +.import "msdsi8.js" as Msdsi8 + +function testFunc(seedValue) { + var retn = 0.75; + var firstFactor = calculateFirstFactor(seedValue); + var secondFactor = calculateSecondFactor(seedValue); + var modificationTerm = calculateModificationTerm(seedValue); + + // do some regexp matching + var someString = "This is a random string which we'll perform regular expression matching on to reduce considerably. This is meant to be part of a complex javascript expression whose evaluation takes considerably longer than the creation cost of QScriptValue."; + var regexpPattern = new RegExp("is", "i"); + var regexpOutputLength = 0; + var temp = regexpPattern.exec(someString); + while (temp == "is") { + regexpOutputLength += 4; + regexpOutputLength *= 2; + temp = regexpPattern.exec(someString); + if (regexpOutputLength > (seedValue * 3)) { + temp = "break"; + } + } + + // spin in a for loop for a while + var i = 0; + var j = 0; + var cumulativeTotal = 3; + for (i = 20; i > 1; i--) { + for (j = 31; j > 5; j--) { + var branchVariable = i + j; + if (branchVariable % 3 == 0) { + cumulativeTotal -= secondFactor; + } else { + cumulativeTotal += firstFactor; + } + + if (cumulativeTotal > (seedValue * 50)) { + break; + } + } + } + retn *= (1 + (cumulativeTotal * 0.001)); + retn *= Msdsi8.testFunc(seedValue + retn); + return retn; +} + +function calculateFirstFactor(seedValue) { + var firstFactor = (0.45 * (9.3 / 3.1) - 0.90); + firstFactor *= (1 + (0.00007 / seedValue)); + return firstFactor; +} + +function calculateSecondFactor(seedValue) { + var secondFactor = 0.78 * (6.3 / 2.1) - (0.39 * 4); + secondFactor *= (1 + (0.00007 / seedValue)); + return secondFactor; +} + +function calculateModificationTerm(seedValue) { + var modificationTerm = (12 + (9*7) - 54 + 16 - ((calculateFirstFactor(seedValue) * seedValue) / 3) + (4*calculateSecondFactor(seedValue) * seedValue * 1.33)) + (calculateSecondFactor(seedValue) * seedValue); + modificationTerm = modificationTerm + (33/2) + 19 - (9*2) - (61*3) + 177; + return modificationTerm; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/mldsi8.js b/tests/benchmarks/declarative/holistic/data/jsImports/mldsi8.js new file mode 100644 index 0000000000..2f4145aba9 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/mldsi8.js @@ -0,0 +1,107 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, large, imported script. +// It imports other large scripts which are deeply nested. +// It is imported by another script. + +.import "msdsi9.js" as Msdsi9 + +function testFunc(seedValue) { + var retn = 0.85; + var firstFactor = calculateFirstFactor(seedValue); + var secondFactor = calculateSecondFactor(seedValue); + var modificationTerm = calculateModificationTerm(seedValue); + + // do some regexp matching + var someString = "This is a random string which we'll perform regular expression matching on to reduce considerably. This is meant to be part of a complex javascript expression whose evaluation takes considerably longer than the creation cost of QScriptValue."; + var regexpPattern = new RegExp("is", "i"); + var regexpOutputLength = 0; + var temp = regexpPattern.exec(someString); + while (temp == "is") { + regexpOutputLength += 4; + regexpOutputLength *= 2; + temp = regexpPattern.exec(someString); + if (regexpOutputLength > (seedValue * 3)) { + temp = "break"; + } + } + + // spin in a for loop for a while + var i = 0; + var j = 0; + var cumulativeTotal = 3; + for (i = 20; i > 1; i--) { + for (j = 31; j > 5; j--) { + var branchVariable = i + j; + if (branchVariable % 3 == 0) { + cumulativeTotal -= secondFactor; + } else { + cumulativeTotal += firstFactor; + } + + if (cumulativeTotal > (seedValue * 50)) { + break; + } + } + } + retn *= (1 + (cumulativeTotal * 0.001)); + retn *= Msdsi9.testFunc(seedValue + retn); + return retn; +} + +function calculateFirstFactor(seedValue) { + var firstFactor = (0.45 * (9.3 / 3.1) - 0.90); + firstFactor *= (1 + (0.00008 / seedValue)); + return firstFactor; +} + +function calculateSecondFactor(seedValue) { + var secondFactor = 0.78 * (6.3 / 2.1) - (0.39 * 4); + secondFactor *= (1 + (0.00008 / seedValue)); + return secondFactor; +} + +function calculateModificationTerm(seedValue) { + var modificationTerm = (12 + (9*7) - 54 + 16 - ((calculateFirstFactor(seedValue) * seedValue) / 3) + (4*calculateSecondFactor(seedValue) * seedValue * 1.33)) + (calculateSecondFactor(seedValue) * seedValue); + modificationTerm = modificationTerm + (33/2) + 19 - (9*2) - (61*3) + 177; + return modificationTerm; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/mldsi9.js b/tests/benchmarks/declarative/holistic/data/jsImports/mldsi9.js new file mode 100644 index 0000000000..d06a00d31c --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/mldsi9.js @@ -0,0 +1,107 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, large, imported script. +// It imports other large scripts which are deeply nested. +// It is imported by another script. + +.import "msdsi10.js" as Msdsi10 + +function testFunc(seedValue) { + var retn = 0.95; + var firstFactor = calculateFirstFactor(seedValue); + var secondFactor = calculateSecondFactor(seedValue); + var modificationTerm = calculateModificationTerm(seedValue); + + // do some regexp matching + var someString = "This is a random string which we'll perform regular expression matching on to reduce considerably. This is meant to be part of a complex javascript expression whose evaluation takes considerably longer than the creation cost of QScriptValue."; + var regexpPattern = new RegExp("is", "i"); + var regexpOutputLength = 0; + var temp = regexpPattern.exec(someString); + while (temp == "is") { + regexpOutputLength += 4; + regexpOutputLength *= 2; + temp = regexpPattern.exec(someString); + if (regexpOutputLength > (seedValue * 3)) { + temp = "break"; + } + } + + // spin in a for loop for a while + var i = 0; + var j = 0; + var cumulativeTotal = 3; + for (i = 20; i > 1; i--) { + for (j = 31; j > 5; j--) { + var branchVariable = i + j; + if (branchVariable % 3 == 0) { + cumulativeTotal -= secondFactor; + } else { + cumulativeTotal += firstFactor; + } + + if (cumulativeTotal > (seedValue * 50)) { + break; + } + } + } + retn *= (1 + (cumulativeTotal * 0.001)); + retn *= Msdsi10.testFunc(seedValue + retn); + return retn; +} + +function calculateFirstFactor(seedValue) { + var firstFactor = (0.45 * (9.3 / 3.1) - 0.90); + firstFactor *= (1 + (0.00009 / seedValue)); + return firstFactor; +} + +function calculateSecondFactor(seedValue) { + var secondFactor = 0.78 * (6.3 / 2.1) - (0.39 * 4); + secondFactor *= (1 + (0.00009 / seedValue)); + return secondFactor; +} + +function calculateModificationTerm(seedValue) { + var modificationTerm = (12 + (9*7) - 54 + 16 - ((calculateFirstFactor(seedValue) * seedValue) / 3) + (4*calculateSecondFactor(seedValue) * seedValue * 1.33)) + (calculateSecondFactor(seedValue) * seedValue); + modificationTerm = modificationTerm + (33/2) + 19 - (9*2) - (61*3) + 177; + return modificationTerm; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/mlsi.js b/tests/benchmarks/declarative/holistic/data/jsImports/mlsi.js new file mode 100644 index 0000000000..fbc9b41882 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/mlsi.js @@ -0,0 +1,138 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, large, imported script. +// It imports many other (non-nested) single, large, scripts, +// and also imports many other nested, large scripts. + +.import "mldsi4.js" as Mldsi4 +.import "mldsi9.js" as Mldsi9 +.import "mlbsi1.js" as Mlbsi1 +.import "mlbsi2.js" as Mlbsi2 +.import "mlbsi3.js" as Mlbsi3 +.import "mlbsi4.js" as Mlbsi4 +.import "mlbsi5.js" as Mlbsi5 +.import "mlbsi6.js" as Mlbsi6 +.import "mlbsi7.js" as Mlbsi7 +.import "mlbsi8.js" as Mlbsi8 +.import "mlbsi9.js" as Mlbsi9 +.import "mlbsi10.js" as Mlbsi10 +.import "mlbsi11.js" as Mlbsi11 +.import "mlbsi12.js" as Mlbsi12 +.import "mlbsi13.js" as Mlbsi13 +.import "mlbsi14.js" as Mlbsi14 +.import "mlbsi15.js" as Mlbsi15 + +function testFunc(seedValue) { + var firstFactor = calculateFirstFactor(seedValue); + var secondFactor = calculateSecondFactor(seedValue); + var modificationTerm = calculateModificationTerm(seedValue); + + // do some regexp matching + var someString = "This is a random string which we'll perform regular expression matching on to reduce considerably. This is meant to be part of a complex javascript expression whose evaluation takes considerably longer than the creation cost of QScriptValue."; + var regexpPattern = new RegExp("is", "i"); + var regexpOutputLength = 0; + var temp = regexpPattern.exec(someString); + while (temp == "is") { + regexpOutputLength += 4; + regexpOutputLength *= 2; + temp = regexpPattern.exec(someString); + if (regexpOutputLength > (seedValue * 3)) { + temp = "break"; + } + } + + // spin in a for loop for a while + var i = 0; + var j = 0; + var cumulativeTotal = 3; + for (i = 20; i > 1; i--) { + for (j = 31; j > 5; j--) { + var branchVariable = i + j; + if (branchVariable % 3 == 0) { + cumulativeTotal -= secondFactor; + } else { + cumulativeTotal += firstFactor; + } + + if (cumulativeTotal > (seedValue * 50)) { + break; + } + } + } + var retn = cumulativeTotal; + retn += Mlbsi1.testFunc(seedValue); + retn += Mlbsi2.testFunc(seedValue); + retn += Mlbsi3.testFunc(retn); + retn += Mlbsi4.testFunc(seedValue); + retn += Mlbsi5.testFunc(seedValue); + retn += Mlbsi6.testFunc(seedValue); + retn *= Mldsi9.testFunc(retn); + retn += Mlbsi7.testFunc(seedValue); + retn += Mlbsi8.testFunc(retn); + retn += Mlbsi9.testFunc(seedValue); + retn += Mlbsi10.testFunc(seedValue); + retn += Mlbsi11.testFunc(seedValue); + retn *= Mldsi4.testFunc(retn); + retn += Mlbsi12.testFunc(seedValue); + retn += Mlbsi13.testFunc(retn); + retn += Mlbsi14.testFunc(seedValue); + retn += Mlbsi15.testFunc(seedValue); + return retn; +} + +function calculateFirstFactor(seedValue) { + var firstFactor = (0.45 * (9.3 / 3.1) - 0.90); + firstFactor *= (1 + (0.00001 / seedValue)); + return firstFactor; +} + +function calculateSecondFactor(seedValue) { + var secondFactor = 0.78 * (6.3 / 2.1) - (0.39 * 4); + secondFactor *= (1 + (0.00001 / seedValue)); + return secondFactor; +} + +function calculateModificationTerm(seedValue) { + var modificationTerm = (12 + (9*7) - 54 + 16 - ((calculateFirstFactor(seedValue) * seedValue) / 3) + (4*calculateSecondFactor(seedValue) * seedValue * 1.33)) + (calculateSecondFactor(seedValue) * seedValue); + modificationTerm = modificationTerm + (33/2) + 19 - (9*2) - (61*3) + 177; + return modificationTerm; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/moduleBm.js b/tests/benchmarks/declarative/holistic/data/jsImports/moduleBm.js new file mode 100644 index 0000000000..7de7e89b9a --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/moduleBm.js @@ -0,0 +1,109 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, large, imported script. +// It doesn't import any other scripts. +.import Qt.test 1.0 as QtTest + +function testFunc(seedValue) { + var retn = QtTest.EnumValue3; + var firstFactor = calculateFirstFactor(seedValue); + var secondFactor = calculateSecondFactor(seedValue); + var modificationTerm = calculateModificationTerm(seedValue); + + // do some regexp matching + var someString = "This is a random string which we'll perform regular expression matching on to reduce considerably. This is meant to be part of a complex javascript expression whose evaluation takes considerably longer than the creation cost of QScriptValue."; + var regexpPattern = new RegExp("is", "i"); + var regexpOutputLength = 0; + var temp = regexpPattern.exec(someString); + while (temp == "is") { + regexpOutputLength += 4; + regexpOutputLength *= 2; + temp = regexpPattern.exec(someString); + if (regexpOutputLength > (seedValue * 3)) { + temp = "break"; + } + } + + // spin in a for loop for a while + var i = 0; + var j = 0; + var cumulativeTotal = 3; + for (i = 20; i > 1; i--) { + for (j = 31; j > 5; j--) { + var branchVariable = i + j; + if (branchVariable % 3 == 0) { + cumulativeTotal -= secondFactor; + } else { + cumulativeTotal += firstFactor; + } + + if (cumulativeTotal > (seedValue * 50)) { + break; + } + } + } + retn += (cumulativeTotal * 0.45); + retn *= (1 + (3.1415962 / seedValue)); + retn /= 2.41497; + retn -= (seedValue * -1); + return retn; +} + +function calculateFirstFactor(seedValue) { + var firstFactor = (0.45 * (9.3 / 3.1) - 0.90); + firstFactor *= (1 + (0.00001 / seedValue)); + return firstFactor; +} + +function calculateSecondFactor(seedValue) { + var secondFactor = 0.78 * (6.3 / 2.1) - (0.39 * 4); + secondFactor *= (1 + (0.00001 / seedValue)); + return secondFactor; +} + +function calculateModificationTerm(seedValue) { + var modificationTerm = (12 + (9*7) - 54 + 16 - ((calculateFirstFactor(seedValue) * seedValue) / 3) + (4*calculateSecondFactor(seedValue) * seedValue * 1.33)) + (calculateSecondFactor(seedValue) * seedValue); + modificationTerm = modificationTerm + (33/2) + 19 - (9*2) - (61*3) + 177; + return modificationTerm; +} + + diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/msbsi.js b/tests/benchmarks/declarative/holistic/data/jsImports/msbsi.js new file mode 100644 index 0000000000..c60ce88dd9 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/msbsi.js @@ -0,0 +1,79 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, small, imported script. +// It imports many other (non-nested) single, small, scripts. + +.import "msbsi1.js" as Msbsi1 +.import "msbsi2.js" as Msbsi2 +.import "msbsi3.js" as Msbsi3 +.import "msbsi4.js" as Msbsi4 +.import "msbsi5.js" as Msbsi5 +.import "msbsi6.js" as Msbsi6 +.import "msbsi7.js" as Msbsi7 +.import "msbsi8.js" as Msbsi8 +.import "msbsi9.js" as Msbsi9 +.import "msbsi10.js" as Msbsi10 +.import "msbsi11.js" as Msbsi11 +.import "msbsi12.js" as Msbsi12 +.import "msbsi13.js" as Msbsi13 +.import "msbsi14.js" as Msbsi14 +.import "msbsi15.js" as Msbsi15 + +function testFunc(seedValue) { + var retn = 10 * (seedValue * 0.45); + retn += Msbsi1.testFunc(seedValue); + retn += Msbsi2.testFunc(seedValue); + retn += Msbsi3.testFunc(seedValue); + retn += Msbsi4.testFunc(seedValue); + retn += Msbsi5.testFunc(seedValue); + retn += Msbsi6.testFunc(seedValue); + retn += Msbsi7.testFunc(seedValue); + retn += Msbsi8.testFunc(seedValue); + retn += Msbsi9.testFunc(seedValue); + retn += Msbsi10.testFunc(seedValue); + retn += Msbsi11.testFunc(seedValue); + retn += Msbsi12.testFunc(seedValue); + retn += Msbsi13.testFunc(seedValue); + retn += Msbsi14.testFunc(seedValue); + retn += Msbsi15.testFunc(seedValue); + return retn; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/msbsi1.js b/tests/benchmarks/declarative/holistic/data/jsImports/msbsi1.js new file mode 100644 index 0000000000..422558121d --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/msbsi1.js @@ -0,0 +1,53 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, small, imported script. +// It doesn't import any other scripts. +// It is imported from another script. + +function testFunc(seedValue) { + var retn = 5; + retn += (seedValue * 0.145); + retn *= (1 + (3.1415962 / seedValue)); + retn /= 2.41497; + retn -= (seedValue * -1); + return retn; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/msbsi10.js b/tests/benchmarks/declarative/holistic/data/jsImports/msbsi10.js new file mode 100644 index 0000000000..0ee3a369d6 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/msbsi10.js @@ -0,0 +1,53 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, small, imported script. +// It doesn't import any other scripts. +// It is imported from another script. + +function testFunc(seedValue) { + var retn = 5; + retn += (seedValue * 0.1045); + retn *= (1 + (3.1415962 / seedValue)); + retn /= 2.41497; + retn -= (seedValue * -1); + return retn; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/msbsi11.js b/tests/benchmarks/declarative/holistic/data/jsImports/msbsi11.js new file mode 100644 index 0000000000..40e993c9bd --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/msbsi11.js @@ -0,0 +1,53 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, small, imported script. +// It doesn't import any other scripts. +// It is imported from another script. + +function testFunc(seedValue) { + var retn = 5; + retn += (seedValue * 0.1145); + retn *= (1 + (3.1415962 / seedValue)); + retn /= 2.41497; + retn -= (seedValue * -1); + return retn; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/msbsi12.js b/tests/benchmarks/declarative/holistic/data/jsImports/msbsi12.js new file mode 100644 index 0000000000..ba8d9d6bda --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/msbsi12.js @@ -0,0 +1,53 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, small, imported script. +// It doesn't import any other scripts. +// It is imported from another script. + +function testFunc(seedValue) { + var retn = 5; + retn += (seedValue * 0.1245); + retn *= (1 + (3.1415962 / seedValue)); + retn /= 2.41497; + retn -= (seedValue * -1); + return retn; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/msbsi13.js b/tests/benchmarks/declarative/holistic/data/jsImports/msbsi13.js new file mode 100644 index 0000000000..9544c9fe74 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/msbsi13.js @@ -0,0 +1,53 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, small, imported script. +// It doesn't import any other scripts. +// It is imported from another script. + +function testFunc(seedValue) { + var retn = 5; + retn += (seedValue * 0.1345); + retn *= (1 + (3.1415962 / seedValue)); + retn /= 2.41497; + retn -= (seedValue * -1); + return retn; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/msbsi14.js b/tests/benchmarks/declarative/holistic/data/jsImports/msbsi14.js new file mode 100644 index 0000000000..df70f05452 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/msbsi14.js @@ -0,0 +1,53 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, small, imported script. +// It doesn't import any other scripts. +// It is imported from another script. + +function testFunc(seedValue) { + var retn = 5; + retn += (seedValue * 0.1445); + retn *= (1 + (3.1415962 / seedValue)); + retn /= 2.41497; + retn -= (seedValue * -1); + return retn; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/msbsi15.js b/tests/benchmarks/declarative/holistic/data/jsImports/msbsi15.js new file mode 100644 index 0000000000..82c1ac581d --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/msbsi15.js @@ -0,0 +1,53 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, small, imported script. +// It doesn't import any other scripts. +// It is imported from another script. + +function testFunc(seedValue) { + var retn = 5; + retn += (seedValue * 0.1545); + retn *= (1 + (3.1415962 / seedValue)); + retn /= 2.41497; + retn -= (seedValue * -1); + return retn; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/msbsi2.js b/tests/benchmarks/declarative/holistic/data/jsImports/msbsi2.js new file mode 100644 index 0000000000..cf10dcb52e --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/msbsi2.js @@ -0,0 +1,53 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, small, imported script. +// It doesn't import any other scripts. +// It is imported from another script. + +function testFunc(seedValue) { + var retn = 5; + retn += (seedValue * 0.245); + retn *= (1 + (3.1415962 / seedValue)); + retn /= 2.41497; + retn -= (seedValue * -1); + return retn; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/msbsi3.js b/tests/benchmarks/declarative/holistic/data/jsImports/msbsi3.js new file mode 100644 index 0000000000..d743c44f6a --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/msbsi3.js @@ -0,0 +1,53 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, small, imported script. +// It doesn't import any other scripts. +// It is imported from another script. + +function testFunc(seedValue) { + var retn = 5; + retn += (seedValue * 0.345); + retn *= (1 + (3.1415962 / seedValue)); + retn /= 2.41497; + retn -= (seedValue * -1); + return retn; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/msbsi4.js b/tests/benchmarks/declarative/holistic/data/jsImports/msbsi4.js new file mode 100644 index 0000000000..df8f977ba5 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/msbsi4.js @@ -0,0 +1,53 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, small, imported script. +// It doesn't import any other scripts. +// It is imported from another script. + +function testFunc(seedValue) { + var retn = 5; + retn += (seedValue * 0.445); + retn *= (1 + (3.1415962 / seedValue)); + retn /= 2.41497; + retn -= (seedValue * -1); + return retn; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/msbsi5.js b/tests/benchmarks/declarative/holistic/data/jsImports/msbsi5.js new file mode 100644 index 0000000000..3c00c1cdf0 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/msbsi5.js @@ -0,0 +1,53 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, small, imported script. +// It doesn't import any other scripts. +// It is imported from another script. + +function testFunc(seedValue) { + var retn = 5; + retn += (seedValue * 0.545); + retn *= (1 + (3.1415962 / seedValue)); + retn /= 2.41497; + retn -= (seedValue * -1); + return retn; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/msbsi6.js b/tests/benchmarks/declarative/holistic/data/jsImports/msbsi6.js new file mode 100644 index 0000000000..0aa0e93dbd --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/msbsi6.js @@ -0,0 +1,53 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, small, imported script. +// It doesn't import any other scripts. +// It is imported from another script. + +function testFunc(seedValue) { + var retn = 5; + retn += (seedValue * 0.645); + retn *= (1 + (3.1415962 / seedValue)); + retn /= 2.41497; + retn -= (seedValue * -1); + return retn; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/msbsi7.js b/tests/benchmarks/declarative/holistic/data/jsImports/msbsi7.js new file mode 100644 index 0000000000..933fca8a72 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/msbsi7.js @@ -0,0 +1,53 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, small, imported script. +// It doesn't import any other scripts. +// It is imported from another script. + +function testFunc(seedValue) { + var retn = 5; + retn += (seedValue * 0.745); + retn *= (1 + (3.1415962 / seedValue)); + retn /= 2.41497; + retn -= (seedValue * -1); + return retn; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/msbsi8.js b/tests/benchmarks/declarative/holistic/data/jsImports/msbsi8.js new file mode 100644 index 0000000000..4f76257e72 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/msbsi8.js @@ -0,0 +1,53 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, small, imported script. +// It doesn't import any other scripts. +// It is imported from another script. + +function testFunc(seedValue) { + var retn = 5; + retn += (seedValue * 0.845); + retn *= (1 + (3.1415962 / seedValue)); + retn /= 2.41497; + retn -= (seedValue * -1); + return retn; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/msbsi9.js b/tests/benchmarks/declarative/holistic/data/jsImports/msbsi9.js new file mode 100644 index 0000000000..3b2433e076 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/msbsi9.js @@ -0,0 +1,53 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, small, imported script. +// It doesn't import any other scripts. +// It is imported from another script. + +function testFunc(seedValue) { + var retn = 5; + retn += (seedValue * 0.945); + retn *= (1 + (3.1415962 / seedValue)); + retn /= 2.41497; + retn -= (seedValue * -1); + return retn; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/msdsi.js b/tests/benchmarks/declarative/holistic/data/jsImports/msdsi.js new file mode 100644 index 0000000000..13182480c6 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/msdsi.js @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, small, imported script. +// It imports other small scripts which are deeply nested. + +.import "msdsi1.js" as Msdsi1 + +function testFunc(seedValue) { + var retn = 0.5; + retn *= Msdsi1.testFunc(seedValue + retn); + return retn; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/msdsi1.js b/tests/benchmarks/declarative/holistic/data/jsImports/msdsi1.js new file mode 100644 index 0000000000..1d987567cc --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/msdsi1.js @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, small, imported script. +// It imports other small scripts which are deeply nested. +// It is imported by another script. + +.import "msdsi2.js" as Msdsi2 + +function testFunc(seedValue) { + var retn = 0.15; + retn *= Msdsi2.testFunc(seedValue + retn); + return retn; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/msdsi10.js b/tests/benchmarks/declarative/holistic/data/jsImports/msdsi10.js new file mode 100644 index 0000000000..90b3e8173b --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/msdsi10.js @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, small, imported script. +// It imports other small scripts which are deeply nested. +// It is imported by another script. + +.import "msdsi11.js" as Msdsi11 + +function testFunc(seedValue) { + var retn = 0.105; + retn *= Msdsi11.testFunc(seedValue + retn); + return retn; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/msdsi11.js b/tests/benchmarks/declarative/holistic/data/jsImports/msdsi11.js new file mode 100644 index 0000000000..1df1dae7e0 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/msdsi11.js @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, small, imported script. +// It imports other small scripts which are deeply nested. +// It is imported by another script. + +.import "msdsi12.js" as Msdsi12 + +function testFunc(seedValue) { + var retn = 0.115; + retn *= Msdsi12.testFunc(seedValue + retn); + return retn; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/msdsi12.js b/tests/benchmarks/declarative/holistic/data/jsImports/msdsi12.js new file mode 100644 index 0000000000..4c5d6bcdb4 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/msdsi12.js @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, small, imported script. +// It imports other small scripts which are deeply nested. +// It is imported by another script. + +.import "msdsi13.js" as Msdsi13 + +function testFunc(seedValue) { + var retn = 0.125; + retn *= Msdsi13.testFunc(seedValue + retn); + return retn; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/msdsi13.js b/tests/benchmarks/declarative/holistic/data/jsImports/msdsi13.js new file mode 100644 index 0000000000..858233dec7 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/msdsi13.js @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, small, imported script. +// It imports other small scripts which are deeply nested. +// It is imported by another script. + +.import "msdsi14.js" as Msdsi14 + +function testFunc(seedValue) { + var retn = 0.135; + retn *= Msdsi14.testFunc(seedValue + retn); + return retn; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/msdsi14.js b/tests/benchmarks/declarative/holistic/data/jsImports/msdsi14.js new file mode 100644 index 0000000000..bafceb0931 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/msdsi14.js @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, small, imported script. +// It imports other small scripts which are deeply nested. +// It is imported by another script. + +.import "msdsi15.js" as Msdsi15 + +function testFunc(seedValue) { + var retn = 0.145; + retn *= Msdsi15.testFunc(seedValue + retn); + return retn; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/msdsi15.js b/tests/benchmarks/declarative/holistic/data/jsImports/msdsi15.js new file mode 100644 index 0000000000..c3d2c0ba01 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/msdsi15.js @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, small, imported script. +// It is imported by another script. + +function testFunc(seedValue) { + var retn = 0.155; + retn *= (seedValue + retn); + return retn; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/msdsi2.js b/tests/benchmarks/declarative/holistic/data/jsImports/msdsi2.js new file mode 100644 index 0000000000..2d63a9d0a8 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/msdsi2.js @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, small, imported script. +// It imports other small scripts which are deeply nested. +// It is imported by another script. + +.import "msdsi3.js" as Msdsi3 + +function testFunc(seedValue) { + var retn = 0.25; + retn *= Msdsi3.testFunc(seedValue + retn); + return retn; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/msdsi3.js b/tests/benchmarks/declarative/holistic/data/jsImports/msdsi3.js new file mode 100644 index 0000000000..c281240f15 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/msdsi3.js @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, small, imported script. +// It imports other small scripts which are deeply nested. +// It is imported by another script. + +.import "msdsi4.js" as Msdsi4 + +function testFunc(seedValue) { + var retn = 0.35; + retn *= Msdsi4.testFunc(seedValue + retn); + return retn; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/msdsi4.js b/tests/benchmarks/declarative/holistic/data/jsImports/msdsi4.js new file mode 100644 index 0000000000..eb44d0f5e2 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/msdsi4.js @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, small, imported script. +// It imports other small scripts which are deeply nested. +// It is imported by another script. + +.import "msdsi5.js" as Msdsi5 + +function testFunc(seedValue) { + var retn = 0.45; + retn *= Msdsi5.testFunc(seedValue + retn); + return retn; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/msdsi5.js b/tests/benchmarks/declarative/holistic/data/jsImports/msdsi5.js new file mode 100644 index 0000000000..fd3abc3a7a --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/msdsi5.js @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, small, imported script. +// It imports other small scripts which are deeply nested. +// It is imported by another script. + +.import "msdsi6.js" as Msdsi6 + +function testFunc(seedValue) { + var retn = 0.55; + retn *= Msdsi6.testFunc(seedValue + retn); + return retn; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/msdsi6.js b/tests/benchmarks/declarative/holistic/data/jsImports/msdsi6.js new file mode 100644 index 0000000000..eb5adde3ca --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/msdsi6.js @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, small, imported script. +// It imports other small scripts which are deeply nested. +// It is imported by another script. + +.import "msdsi7.js" as Msdsi7 + +function testFunc(seedValue) { + var retn = 0.65; + retn *= Msdsi7.testFunc(seedValue + retn); + return retn; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/msdsi7.js b/tests/benchmarks/declarative/holistic/data/jsImports/msdsi7.js new file mode 100644 index 0000000000..32e41dc642 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/msdsi7.js @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, small, imported script. +// It imports other small scripts which are deeply nested. +// It is imported by another script. + +.import "msdsi8.js" as Msdsi8 + +function testFunc(seedValue) { + var retn = 0.75; + retn *= Msdsi8.testFunc(seedValue + retn); + return retn; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/msdsi8.js b/tests/benchmarks/declarative/holistic/data/jsImports/msdsi8.js new file mode 100644 index 0000000000..ecdb97f5b2 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/msdsi8.js @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, small, imported script. +// It imports other small scripts which are deeply nested. +// It is imported by another script. + +.import "msdsi9.js" as Msdsi9 + +function testFunc(seedValue) { + var retn = 0.85; + retn *= Msdsi9.testFunc(seedValue + retn); + return retn; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/msdsi9.js b/tests/benchmarks/declarative/holistic/data/jsImports/msdsi9.js new file mode 100644 index 0000000000..9082cddd3e --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/msdsi9.js @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, small, imported script. +// It imports other small scripts which are deeply nested. +// It is imported by another script. + +.import "msdsi10.js" as Msdsi10 + +function testFunc(seedValue) { + var retn = 0.95; + retn *= Msdsi10.testFunc(seedValue + retn); + return retn; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/mssi.js b/tests/benchmarks/declarative/holistic/data/jsImports/mssi.js new file mode 100644 index 0000000000..2254c5c585 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/mssi.js @@ -0,0 +1,84 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, small, imported script. +// It imports many other (non-nested) single, small, scripts, +// and also imports many other nested, small scripts. + +.import "msdsi4.js" as Msdsi4 +.import "msdsi9.js" as Msdsi9 +.import "msbsi1.js" as Msbsi1 +.import "msbsi2.js" as Msbsi2 +.import "msbsi3.js" as Msbsi3 +.import "msbsi4.js" as Msbsi4 +.import "msbsi5.js" as Msbsi5 +.import "msbsi6.js" as Msbsi6 +.import "msbsi7.js" as Msbsi7 +.import "msbsi8.js" as Msbsi8 +.import "msbsi9.js" as Msbsi9 +.import "msbsi10.js" as Msbsi10 +.import "msbsi11.js" as Msbsi11 +.import "msbsi12.js" as Msbsi12 +.import "msbsi13.js" as Msbsi13 +.import "msbsi14.js" as Msbsi14 +.import "msbsi15.js" as Msbsi15 + +function testFunc(seedValue) { + var retn = 10 * (seedValue * 0.85); + retn += Msbsi1.testFunc(seedValue); + retn += Msbsi2.testFunc(seedValue); + retn += Msbsi3.testFunc(retn); + retn += Msbsi4.testFunc(seedValue); + retn += Msbsi5.testFunc(seedValue); + retn += Msbsi6.testFunc(seedValue); + retn *= Msdsi9.testFunc(retn); + retn += Msbsi7.testFunc(seedValue); + retn += Msbsi8.testFunc(retn); + retn += Msbsi9.testFunc(seedValue); + retn += Msbsi10.testFunc(seedValue); + retn += Msbsi11.testFunc(seedValue); + retn *= Msdsi4.testFunc(retn); + retn += Msbsi12.testFunc(seedValue); + retn += Msbsi13.testFunc(retn); + retn += Msbsi14.testFunc(seedValue); + retn += Msbsi15.testFunc(seedValue); + return retn; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/pragmaBmOne.js b/tests/benchmarks/declarative/holistic/data/jsImports/pragmaBmOne.js new file mode 100644 index 0000000000..e3c54000bb --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/pragmaBmOne.js @@ -0,0 +1,50 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, large, imported script. +// It imports a shared library script. +.import "pragmaLib.js" as PragmaLibJs + +function testFuncOne(seedValue) { + var retn = seedValue + 2; + retn += PragmaLibJs.testFunc(); + return retn; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/pragmaBmTwo.js b/tests/benchmarks/declarative/holistic/data/jsImports/pragmaBmTwo.js new file mode 100644 index 0000000000..9a28fafbca --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/pragmaBmTwo.js @@ -0,0 +1,50 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, large, imported script. +// It imports a shared library script. +.import "pragmaLib.js" as PragmaLibJs + +function testFuncTwo(seedValue) { + var retn = seedValue + 3; + retn += PragmaLibJs.testFunc(); + return retn; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/pragmaLib.js b/tests/benchmarks/declarative/holistic/data/jsImports/pragmaLib.js new file mode 100644 index 0000000000..a247d75ed1 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/pragmaLib.js @@ -0,0 +1,119 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, large, imported script. +// It doesn't import any other scripts. +// It is a shared script, with data which should be shared. +.pragma library + +var sharedValue = 9; + +function testFunc() { + var retn = sharedValue; + sharedValue += 1; // increment the shared value + return retn; +} + +function testFuncBig(seedValue) { + var retn = sharedValue; + var firstFactor = calculateFirstFactor(seedValue); + var secondFactor = calculateSecondFactor(seedValue); + var modificationTerm = calculateModificationTerm(seedValue); + + // do some regexp matching + var someString = "This is a random string which we'll perform regular expression matching on to reduce considerably. This is meant to be part of a complex javascript expression whose evaluation takes considerably longer than the creation cost of QScriptValue."; + var regexpPattern = new RegExp("is", "i"); + var regexpOutputLength = 0; + var temp = regexpPattern.exec(someString); + while (temp == "is") { + regexpOutputLength += 4; + regexpOutputLength *= 2; + temp = regexpPattern.exec(someString); + if (regexpOutputLength > (seedValue * 3)) { + temp = "break"; + } + } + + // spin in a for loop for a while + var i = 0; + var j = 0; + var cumulativeTotal = 3; + for (i = 20; i > 1; i--) { + for (j = 31; j > 5; j--) { + var branchVariable = i + j; + if (branchVariable % 3 == 0) { + cumulativeTotal -= secondFactor; + } else { + cumulativeTotal += firstFactor; + } + + if (cumulativeTotal > (seedValue * 50)) { + break; + } + } + } + retn += (cumulativeTotal * 0.45); + retn *= (1 + (3.1415962 / seedValue)); + retn /= 2.41497; + retn -= (seedValue * -1); + sharedValue += 1; // increment the shared value + return retn; +} + +function calculateFirstFactor(seedValue) { + var firstFactor = (0.45 * (9.3 / 3.1) - 0.90); + firstFactor *= (1 + (0.00001 / seedValue)); + return firstFactor; +} + +function calculateSecondFactor(seedValue) { + var secondFactor = 0.78 * (6.3 / 2.1) - (0.39 * 4); + secondFactor *= (1 + (0.00001 / seedValue)); + return secondFactor; +} + +function calculateModificationTerm(seedValue) { + var modificationTerm = (12 + (9*7) - 54 + 16 - ((calculateFirstFactor(seedValue) * seedValue) / 3) + (4*calculateSecondFactor(seedValue) * seedValue * 1.33)) + (calculateSecondFactor(seedValue) * seedValue); + modificationTerm = modificationTerm + (33/2) + 19 - (9*2) - (61*3) + 177; + return modificationTerm; +} + + diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/pragmaModuleBm.js b/tests/benchmarks/declarative/holistic/data/jsImports/pragmaModuleBm.js new file mode 100644 index 0000000000..6f363082da --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/pragmaModuleBm.js @@ -0,0 +1,57 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, large, imported script. +// It imports a QML module and two other scripts. +// Each of those two other scripts imports a single script, +// which is a .pragma library script (shared between the two). + +.import Qt.test 1.0 as QtTest +.import "pragmaBmOne.js" as PragmaBmOneJs +.import "pragmaBmTwo.js" as PragmaBmTwoJs + +function testFuncThree(seedValue) { + var retn = seedValue + QtTest.EnumValue3; + retn += PragmaBmOneJs.testFuncOne(seedValue); + retn += PragmaBmTwoJs.testFuncTwo(seedValue); + return retn; +} + diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/slsi.js b/tests/benchmarks/declarative/holistic/data/jsImports/slsi.js new file mode 100644 index 0000000000..c1741087fa --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/slsi.js @@ -0,0 +1,108 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, large, imported script. +// It doesn't import any other scripts. + +function testFunc(seedValue) { + var retn = 5; + var firstFactor = calculateFirstFactor(seedValue); + var secondFactor = calculateSecondFactor(seedValue); + var modificationTerm = calculateModificationTerm(seedValue); + + // do some regexp matching + var someString = "This is a random string which we'll perform regular expression matching on to reduce considerably. This is meant to be part of a complex javascript expression whose evaluation takes considerably longer than the creation cost of QScriptValue."; + var regexpPattern = new RegExp("is", "i"); + var regexpOutputLength = 0; + var temp = regexpPattern.exec(someString); + while (temp == "is") { + regexpOutputLength += 4; + regexpOutputLength *= 2; + temp = regexpPattern.exec(someString); + if (regexpOutputLength > (seedValue * 3)) { + temp = "break"; + } + } + + // spin in a for loop for a while + var i = 0; + var j = 0; + var cumulativeTotal = 3; + for (i = 20; i > 1; i--) { + for (j = 31; j > 5; j--) { + var branchVariable = i + j; + if (branchVariable % 3 == 0) { + cumulativeTotal -= secondFactor; + } else { + cumulativeTotal += firstFactor; + } + + if (cumulativeTotal > (seedValue * 50)) { + break; + } + } + } + retn += (cumulativeTotal * 0.45); + retn *= (1 + (3.1415962 / seedValue)); + retn /= 2.41497; + retn -= (seedValue * -1); + return retn; +} + +function calculateFirstFactor(seedValue) { + var firstFactor = (0.45 * (9.3 / 3.1) - 0.90); + firstFactor *= (1 + (0.00001 / seedValue)); + return firstFactor; +} + +function calculateSecondFactor(seedValue) { + var secondFactor = 0.78 * (6.3 / 2.1) - (0.39 * 4); + secondFactor *= (1 + (0.00001 / seedValue)); + return secondFactor; +} + +function calculateModificationTerm(seedValue) { + var modificationTerm = (12 + (9*7) - 54 + 16 - ((calculateFirstFactor(seedValue) * seedValue) / 3) + (4*calculateSecondFactor(seedValue) * seedValue * 1.33)) + (calculateSecondFactor(seedValue) * seedValue); + modificationTerm = modificationTerm + (33/2) + 19 - (9*2) - (61*3) + 177; + return modificationTerm; +} + + diff --git a/tests/benchmarks/declarative/holistic/data/jsImports/sssi.js b/tests/benchmarks/declarative/holistic/data/jsImports/sssi.js new file mode 100644 index 0000000000..b52e88dc53 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsImports/sssi.js @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This JavaScript file is a single, small, imported script. +// It doesn't import any other scripts. + +function testFunc(seedValue) { + var retn = 5; + retn += (seedValue * 0.45); + retn *= (1 + (3.1415962 / seedValue)); + retn /= 2.41497; + retn -= (seedValue * -1); + return retn; +} diff --git a/tests/benchmarks/declarative/holistic/data/jsTargets/JsOne.qml b/tests/benchmarks/declarative/holistic/data/jsTargets/JsOne.qml new file mode 100644 index 0000000000..fcdd0819d1 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsTargets/JsOne.qml @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Item { + id: root + property int dynamicWidth: 10 + property int widthSignaledProperty: 20 + + Rectangle { + width: 100 + height: 50 + color: "red" + border.color: "black" + border.width: 5 + radius: 10 + } + + onDynamicWidthChanged: { + widthSignaledProperty = dynamicWidth + (20/4) + 7 - 1; + } +} diff --git a/tests/benchmarks/declarative/holistic/data/jsTargets/JsTwo.qml b/tests/benchmarks/declarative/holistic/data/jsTargets/JsTwo.qml new file mode 100644 index 0000000000..980c76f21e --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/jsTargets/JsTwo.qml @@ -0,0 +1,118 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Item { + id: root + property int dynamicWidth: 10 + property int widthSignaledProperty: 20 + + Rectangle { + width: 100 + height: 50 + color: "red" + border.color: "black" + border.width: 5 + radius: 10 + } + + function calculateFirstFactor(seedValue) { + var firstFactor = (0.45 * (9.3 / 3.1) - 0.90); + firstFactor *= (1 + (0.00001 / seedValue)); + return firstFactor; + } + + function calculateSecondFactor(seedValue) { + var secondFactor = 0.78 * (6.3 / 2.1) - (0.39 * 4); + secondFactor *= (1 + (0.00001 / seedValue)); + return secondFactor; + } + + function calculateModificationTerm(seedValue) { + var modificationTerm = (12 + (9*7) - 54 + 16 - ((root.calculateFirstFactor(seedValue + 0.3) * seedValue) / 3) + (4*root.calculateSecondFactor(seedValue+2) * seedValue * 1.33)) + (root.calculateSecondFactor(seedValue+1) * seedValue); + modificationTerm = modificationTerm + (33/2) + 19 - (9*2) - (61*3) + 177; + return modificationTerm; + } + + onDynamicWidthChanged: { + // do a bit of maths + var firstFactor = root.calculateFirstFactor(8); + var secondFactor = root.calculateSecondFactor(dynamicWidth / firstFactor); + var modificationTerm = root.calculateModificationTerm(dynamicWidth / secondFactor); + + // do some regexp matching + var someString = "This is a random string which we'll perform regular expression matching on to reduce considerably. This is meant to be part of a complex javascript expression whose evaluation takes considerably longer than the creation cost of QScriptValue."; + var regexpPattern = new RegExp("is", "i"); + var regexpOutputLength = 0; + var temp = regexpPattern.exec(someString); + while (temp == "is") { + regexpOutputLength += 4; + regexpOutputLength *= 2; + temp = regexpPattern.exec(someString); + if (regexpOutputLength > (dynamicWidth * 3)) { + temp = "break"; + } + } + + // spin in a for loop for a while + var i = 0; + var j = 0; + var cumulativeTotal = 3; + for (i = 20; i > 1; i--) { + for (j = 31; j > 5; j--) { + var branchVariable = i + j; + if (branchVariable % 3 == 0) { + cumulativeTotal -= secondFactor; + } else { + cumulativeTotal += firstFactor; + } + + if (cumulativeTotal > (dynamicWidth * 50)) { + break; + } + } + } + + // and update the property + widthSignaledProperty = (dynamicWidth + (20/4) + 7 - 1) * modificationTerm + regexpOutputLength - (cumulativeTotal / 73); + } +} diff --git a/tests/benchmarks/declarative/holistic/data/largeTargets/gridview-example.qml b/tests/benchmarks/declarative/holistic/data/largeTargets/gridview-example.qml new file mode 100644 index 0000000000..e904c0a647 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/largeTargets/gridview-example.qml @@ -0,0 +1,91 @@ +/**************************************************************************** +** +** 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 examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Rectangle { + width: 300; height: 400 + color: "white" + + ListModel { + id: appModel + ListElement { name: "Music"; shade: "blue" } + ListElement { name: "Movies"; shade: "red" } + ListElement { name: "Camera"; shade: "green" } + ListElement { name: "Calendar"; shade: "yellow" } + ListElement { name: "Messaging"; shade: "cyan" } + ListElement { name: "Todo List"; shade: "magenta" } + ListElement { name: "Contacts"; shade: "black" } + } + + Component { + id: appDelegate + + Item { + width: 100; height: 100 + + Rectangle { + id: myColoredIcon + width: 20 + height: 20 + y: 20; anchors.horizontalCenter: parent.horizontalCenter + color: shade + } + Text { + anchors { top: myColoredIcon.bottom; horizontalCenter: parent.horizontalCenter } + text: name + } + } + } + + Component { + id: appHighlight + Rectangle { width: 80; height: 80; color: "lightsteelblue" } + } + + GridView { + anchors.fill: parent + cellWidth: 100; cellHeight: 100 + highlight: appHighlight + focus: true + model: appModel + delegate: appDelegate + } +} diff --git a/tests/benchmarks/declarative/holistic/data/largeTargets/layoutdirection.qml b/tests/benchmarks/declarative/holistic/data/largeTargets/layoutdirection.qml new file mode 100644 index 0000000000..9b6a652c14 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/largeTargets/layoutdirection.qml @@ -0,0 +1,151 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.1 + +Rectangle { + + width: column.width + 100 + height: column.height + 100 + property int direction: Qt.application.layoutDirection + + Column { + id: column + spacing: 10 + anchors.centerIn: parent + width: 230 + + Text { + text: "Row" + anchors.horizontalCenter: parent.horizontalCenter + } + Row { + layoutDirection: direction + spacing: 10 + move: Transition { + NumberAnimation { + properties: "x" + } + } + Repeater { + model: 4 + Loader { + property int value: index + sourceComponent: delegate + } + } + } + Text { + text: "Grid" + anchors.horizontalCenter: parent.horizontalCenter + } + Grid { + layoutDirection: direction + spacing: 10; columns: 4 + move: Transition { + NumberAnimation { + properties: "x" + } + } + Repeater { + model: 11 + Loader { + property int value: index + sourceComponent: delegate + } + } + } + Text { + text: "Flow" + anchors.horizontalCenter: parent.horizontalCenter + } + Flow { + layoutDirection: direction + spacing: 10; width: parent.width + move: Transition { + NumberAnimation { + properties: "x" + } + } + Repeater { + model: 10 + Loader { + property int value: index + sourceComponent: delegate + } + } + } + Rectangle { + height: 50; width: parent.width + color: mouseArea.pressed ? "black" : "gray" + Text { + text: direction ? "Right to left" : "Left to right" + color: "white" + font.pixelSize: 16 + anchors.centerIn: parent + } + MouseArea { + id: mouseArea + onClicked: { + if (direction == Qt.LeftToRight) { + direction = Qt.RightToLeft; + } else { + direction = Qt.LeftToRight; + } + } + anchors.fill: parent + } + } + } + + Component { + id: delegate + Rectangle { + width: 50; height: 50 + color: Qt.rgba(0.8/(parent.value+1),0.8/(parent.value+1),0.8/(parent.value+1),1.0) + Text { + text: parent.parent.value+1 + color: "white" + font.pixelSize: 20 + anchors.centerIn: parent + } + } + } +} diff --git a/tests/benchmarks/declarative/holistic/data/largeTargets/mousearea-example.qml b/tests/benchmarks/declarative/holistic/data/largeTargets/mousearea-example.qml new file mode 100644 index 0000000000..9bca78ff60 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/largeTargets/mousearea-example.qml @@ -0,0 +1,112 @@ +/**************************************************************************** +** +** 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 examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Rectangle { + id: box + width: 350; height: 250 + + Rectangle { + id: redSquare + width: 80; height: 80 + anchors.top: parent.top; anchors.left: parent.left; anchors.margins: 10 + color: "red" + + Text { text: "Click"; font.pixelSize: 16; anchors.centerIn: parent } + + MouseArea { + anchors.fill: parent + hoverEnabled: true + acceptedButtons: Qt.LeftButton | Qt.RightButton + + onEntered: info.text = 'Entered' + onExited: info.text = 'Exited (pressed=' + pressed + ')' + + onPressed: { + info.text = 'Pressed (button=' + (mouse.button == Qt.RightButton ? 'right' : 'left') + + ' shift=' + (mouse.modifiers & Qt.ShiftModifier ? 'true' : 'false') + ')' + var posInBox = redSquare.mapToItem(box, mouse.x, mouse.y) + posInfo.text = + mouse.x + ',' + mouse.y + ' in square' + + ' (' + posInBox.x + ',' + posInBox.y + ' in window)' + } + + onReleased: { + info.text = 'Released (isClick=' + mouse.isClick + ' wasHeld=' + mouse.wasHeld + ')' + posInfo.text = '' + } + + onPressAndHold: info.text = 'Press and hold' + onClicked: info.text = 'Clicked (wasHeld=' + mouse.wasHeld + ')' + onDoubleClicked: info.text = 'Double clicked' + } + } + + Rectangle { + id: blueSquare + width: 80; height: 80 + x: box.width - width - 10; y: 10 // making this item draggable, so don't use anchors + color: "blue" + + Text { text: "Drag"; font.pixelSize: 16; color: "white"; anchors.centerIn: parent } + + MouseArea { + anchors.fill: parent + drag.target: blueSquare + drag.axis: Drag.XandYAxis + drag.minimumX: 0 + drag.maximumX: box.width - parent.width + drag.minimumY: 0 + drag.maximumY: box.height - parent.width + } + } + + Text { + id: info + anchors.bottom: posInfo.top; anchors.horizontalCenter: parent.horizontalCenter; anchors.margins: 30 + + onTextChanged: console.log(text) + } + + Text { + id: posInfo + anchors.bottom: parent.bottom; anchors.horizontalCenter: parent.horizontalCenter; anchors.margins: 30 + } +} diff --git a/tests/benchmarks/declarative/holistic/data/resolutionTargets/ResolveOne.qml b/tests/benchmarks/declarative/holistic/data/resolutionTargets/ResolveOne.qml new file mode 100644 index 0000000000..7a5ea39fff --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/resolutionTargets/ResolveOne.qml @@ -0,0 +1,111 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This file has some nested items and does a lot of id resolution. +// This will allow us to benchmark the cost of resolving names in +// bindings. + +import QtQuick 1.0 + +Item { + id: root + property int baseWidth: 500 + property int baseHeight: 600 + property string baseColor: "red" + + Item { + id: childOne + property int baseWidth: root.baseWidth - 1 + property int baseHeight: root.baseHeight - 1 + property string baseColor: root.baseColor + + Item { + id: childTwo + property int baseWidth: root.baseWidth - 2 + property int baseHeight: childOne.baseHeight - 1 + property string baseColor: childOne.baseColor + + Item { + id: childThree + property int baseWidth: childOne.baseWidth - 2 + property int baseHeight: root.baseHeight - 3 + property string baseColor: "blue" + + Item { + id: childFour + property int baseWidth: childTwo.baseWidth - 2 + property int baseHeight: childThree.baseHeight - 1 + property string baseColor: "earthy " + root.baseColor + + Item { + id: childFive + property int baseWidth: root.baseWidth - 5 + property int baseHeight: childFour.baseHeight - 1 + property string baseColor: "carnelian " + childTwo.baseColor + } + } + + Item { + id: childSix + property int baseWidth: parent.baseWidth - 3 + property int baseHeight: root.baseHeight - 6 + property string baseColor: "rust " + root.baseColor + + Item { + id: childSeven + property int baseWidth: childOne.baseWidth - 6 + property int baseHeight: childTwo.baseHeight - 5 + property string baseColor: "sky " + childThree.baseColor + } + } + } + } + } + + Rectangle { + width: childOne.baseWidth + height: childOne.baseHeight + color: parent.baseColor + border.color: "black" + border.width: 5 + radius: 10 + } +} diff --git a/tests/benchmarks/declarative/holistic/data/scopeSwitching/CppToJs.qml b/tests/benchmarks/declarative/holistic/data/scopeSwitching/CppToJs.qml new file mode 100644 index 0000000000..11c6b37f05 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/scopeSwitching/CppToJs.qml @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +import QtQuick 1.0 +import "cppToJs.js" as CppToJs + +Item { + id: jsConsumer + property int sideEffect: 10 + + function callJsFunction() { + jsConsumer.sideEffect = jsConsumer.sideEffect + CppToJs.nextValue; + } +} diff --git a/tests/benchmarks/declarative/holistic/data/scopeSwitching/CppToQml.qml b/tests/benchmarks/declarative/holistic/data/scopeSwitching/CppToQml.qml new file mode 100644 index 0000000000..23adcd957b --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/scopeSwitching/CppToQml.qml @@ -0,0 +1,48 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Item { + id: root + property int arbitrary: 10 + property int dependent: arbitrary + 5 +} diff --git a/tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppEight.qml b/tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppEight.qml new file mode 100644 index 0000000000..1379f62771 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppEight.qml @@ -0,0 +1,54 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +import QtQuick 1.0 +import Qt.test 1.0 + +Item { + id: arbitraryVariantConsumer + property MyArbitraryVariantProvider a: MyArbitraryVariantProvider { id: arbitraryVariantProvider } + property int sideEffect: 10 + + function callCppFunction() { + // in this case, we call a nonconst CPP function with an integer return value and an integer argument. + arbitraryVariantConsumer.sideEffect = arbitraryVariantConsumer.sideEffect + arbitraryVariantProvider.modifyVariantChangeCount(arbitraryVariantConsumer.sideEffect); + } +} diff --git a/tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppEleven.qml b/tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppEleven.qml new file mode 100644 index 0000000000..53479e9cb6 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppEleven.qml @@ -0,0 +1,57 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +import QtQuick 1.0 +import Qt.test 1.0 + +Item { + id: arbitraryVariantConsumer + property MyArbitraryVariantProvider a: MyArbitraryVariantProvider { id: arbitraryVariantProvider } + property variant someVariant; + property int sideEffect: 10 + + function callCppFunction() { + // in this case, we call a nonconst CPP function with variant return value and variant + integer arguments. + arbitraryVariantConsumer.sideEffect = arbitraryVariantConsumer.sideEffect + 3; + var tempVariant = arbitraryVariantProvider.setVariantToFilledPixmap(sideEffect + 183, sideEffect + 134, sideEffect + 38, sideEffect + 77, sideEffect + 21); + someVariant = arbitraryVariantProvider.setVariantAddCount(sideEffect, tempVariant); + } +} diff --git a/tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppFive.qml b/tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppFive.qml new file mode 100644 index 0000000000..52320eb91e --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppFive.qml @@ -0,0 +1,54 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +import QtQuick 1.0 +import Qt.test 1.0 + +Item { + id: arbitraryVariantConsumer + property MyArbitraryVariantProvider a: MyArbitraryVariantProvider { id: arbitraryVariantProvider } + property int sideEffect: 10 + + function callCppFunction() { + // in this case, we call a const CPP function with an integer return value and no arguments. + arbitraryVariantConsumer.sideEffect = arbitraryVariantConsumer.sideEffect + arbitraryVariantProvider.variantChangeCount(); + } +} diff --git a/tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppFour.qml b/tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppFour.qml new file mode 100644 index 0000000000..ab567012e3 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppFour.qml @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +import QtQuick 1.0 +import Qt.test 1.0 + +Item { + id: arbitraryVariantConsumer + property MyArbitraryVariantProvider a: MyArbitraryVariantProvider { id: arbitraryVariantProvider } + property int sideEffect: 10 + + function callCppFunction() { + // in this case, we call a nonconst CPP function with no return value and an integer argument. + arbitraryVariantConsumer.sideEffect = arbitraryVariantConsumer.sideEffect + 2; + arbitraryVariantProvider.setVariantChangeCount(arbitraryVariantConsumer.sideEffect); + } +} diff --git a/tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppNine.qml b/tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppNine.qml new file mode 100644 index 0000000000..d8f99f4623 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppNine.qml @@ -0,0 +1,56 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +import QtQuick 1.0 +import Qt.test 1.0 + +Item { + id: arbitraryVariantConsumer + property MyArbitraryVariantProvider a: MyArbitraryVariantProvider { id: arbitraryVariantProvider } + property variant someVariant; + property int sideEffect: 10 + + function callCppFunction() { + // in this case, we call a const CPP function with variant return value and integer arguments. + arbitraryVariantConsumer.sideEffect = arbitraryVariantConsumer.sideEffect + 3; + someVariant = arbitraryVariantProvider.possibleVariant(sideEffect, sideEffect * 2, sideEffect * 5); + } +} diff --git a/tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppOne.qml b/tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppOne.qml new file mode 100644 index 0000000000..057b50c8ec --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppOne.qml @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +import QtQuick 1.0 +import Qt.test 1.0 + +Item { + id: arbitraryVariantConsumer + property MyArbitraryVariantProvider a: MyArbitraryVariantProvider { id: arbitraryVariantProvider } + property int sideEffect: 10 + + function callCppFunction() { + // in this case, we call a const CPP function with no return value and no arguments. + arbitraryVariantConsumer.sideEffect = arbitraryVariantConsumer.sideEffect + 2; + arbitraryVariantProvider.doNothing(); + } +} diff --git a/tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppSeven.qml b/tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppSeven.qml new file mode 100644 index 0000000000..9f9735bf36 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppSeven.qml @@ -0,0 +1,54 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +import QtQuick 1.0 +import Qt.test 1.0 + +Item { + id: arbitraryVariantConsumer + property MyArbitraryVariantProvider a: MyArbitraryVariantProvider { id: arbitraryVariantProvider } + property int sideEffect: 10 + + function callCppFunction() { + // in this case, we call a const CPP function with an integer return value and an integer argument. + arbitraryVariantConsumer.sideEffect = arbitraryVariantConsumer.sideEffect + arbitraryVariantProvider.countPlus(arbitraryVariantConsumer.sideEffect); + } +} diff --git a/tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppSix.qml b/tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppSix.qml new file mode 100644 index 0000000000..f5cd9bf722 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppSix.qml @@ -0,0 +1,54 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +import QtQuick 1.0 +import Qt.test 1.0 + +Item { + id: arbitraryVariantConsumer + property MyArbitraryVariantProvider a: MyArbitraryVariantProvider { id: arbitraryVariantProvider } + property int sideEffect: 10 + + function callCppFunction() { + // in this case, we call a nonconst CPP function with an integer return value and no arguments. + arbitraryVariantConsumer.sideEffect = arbitraryVariantConsumer.sideEffect + arbitraryVariantProvider.modifyVariantChangeCount(); + } +} diff --git a/tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppTen.qml b/tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppTen.qml new file mode 100644 index 0000000000..b9f90e0596 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppTen.qml @@ -0,0 +1,56 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +import QtQuick 1.0 +import Qt.test 1.0 + +Item { + id: arbitraryVariantConsumer + property MyArbitraryVariantProvider a: MyArbitraryVariantProvider { id: arbitraryVariantProvider } + property variant someVariant; + property int sideEffect: 10 + + function callCppFunction() { + // in this case, we call a nonconst CPP function with variant return value and integer arguments. + arbitraryVariantConsumer.sideEffect = arbitraryVariantConsumer.sideEffect + 3; + someVariant = arbitraryVariantProvider.setVariantToFilledPixmap(sideEffect + 183, sideEffect + 134, sideEffect + 38, sideEffect + 77, sideEffect + 21); + } +} diff --git a/tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppThree.qml b/tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppThree.qml new file mode 100644 index 0000000000..65ed8b9925 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppThree.qml @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +import QtQuick 1.0 +import Qt.test 1.0 + +Item { + id: arbitraryVariantConsumer + property MyArbitraryVariantProvider a: MyArbitraryVariantProvider { id: arbitraryVariantProvider } + property int sideEffect: 10 + + function callCppFunction() { + // in this case, we call a const CPP function with no return value and an integer argument. + arbitraryVariantConsumer.sideEffect = arbitraryVariantConsumer.sideEffect + 2; + arbitraryVariantProvider.doNothing(arbitraryVariantConsumer.sideEffect); + } +} diff --git a/tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppTwo.qml b/tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppTwo.qml new file mode 100644 index 0000000000..221e196eb8 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppTwo.qml @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +import QtQuick 1.0 +import Qt.test 1.0 + +Item { + id: arbitraryVariantConsumer + property MyArbitraryVariantProvider a: MyArbitraryVariantProvider { id: arbitraryVariantProvider } + property int sideEffect: 10 + + function callCppFunction() { + // in this case, we call a nonconst CPP function with no return value and no arguments. + arbitraryVariantConsumer.sideEffect = arbitraryVariantConsumer.sideEffect + 2; + arbitraryVariantProvider.incrementVariantChangeCount(); + } +} diff --git a/tests/benchmarks/declarative/holistic/data/scopeSwitching/ScarceOne.qml b/tests/benchmarks/declarative/holistic/data/scopeSwitching/ScarceOne.qml new file mode 100644 index 0000000000..531849dcce --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/scopeSwitching/ScarceOne.qml @@ -0,0 +1,57 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +import QtQuick 1.0 +import Qt.test 1.0 + +Item { + id: scarceResourceConsumer + + property MyScarceResourceProvider a: MyScarceResourceProvider { id: scarceResourceProvider } + + property variant ssr; + property variant lsr; + + function copyScarceResources() { + ssr = scarceResourceProvider.smallScarceResource; + lsr = scarceResourceProvider.largeScarceResource; + } +} diff --git a/tests/benchmarks/declarative/holistic/data/scopeSwitching/ScarceTwo.qml b/tests/benchmarks/declarative/holistic/data/scopeSwitching/ScarceTwo.qml new file mode 100644 index 0000000000..a9ef7e355d --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/scopeSwitching/ScarceTwo.qml @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +import QtQuick 1.0 +import Qt.test 1.0 + +Item { + id: scarceResourceConsumer + + property MyScarceResourceProvider a: MyScarceResourceProvider { id: scarceResourceProvider } + + property variant ssr: scarceResourceProvider.smallScarceResource + property variant lsr: scarceResourceProvider.largeScarceResource +} diff --git a/tests/benchmarks/declarative/holistic/data/scopeSwitching/cppToJs.js b/tests/benchmarks/declarative/holistic/data/scopeSwitching/cppToJs.js new file mode 100644 index 0000000000..ace7ec5f5e --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/scopeSwitching/cppToJs.js @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +.pragma library + +var generatedValue = 5; + +function generateNextValue() { + generatedValue += 1; + return generatedValue; +} diff --git a/tests/benchmarks/declarative/holistic/data/smallTargets/SmallFour.qml b/tests/benchmarks/declarative/holistic/data/smallTargets/SmallFour.qml new file mode 100644 index 0000000000..fac4966d41 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/smallTargets/SmallFour.qml @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Text { + text: "Hello World!" + font.family: "Helvetica" + font.pointSize: 24 + color: "red" +} diff --git a/tests/benchmarks/declarative/holistic/data/smallTargets/SmallOne.qml b/tests/benchmarks/declarative/holistic/data/smallTargets/SmallOne.qml new file mode 100644 index 0000000000..e055fd94f7 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/smallTargets/SmallOne.qml @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Rectangle { + width: 100 + height: 100 + color: "red" + border.color: "black" + border.width: 5 + radius: 10 +} diff --git a/tests/benchmarks/declarative/holistic/data/smallTargets/SmallThree.qml b/tests/benchmarks/declarative/holistic/data/smallTargets/SmallThree.qml new file mode 100644 index 0000000000..70ed0ef046 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/smallTargets/SmallThree.qml @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Rectangle { + width: 100; height: 100 + gradient: Gradient { + GradientStop { position: 0.0; color: "red" } + GradientStop { position: 0.33; color: "yellow" } + GradientStop { position: 1.0; color: "green" } + } +} diff --git a/tests/benchmarks/declarative/holistic/data/smallTargets/SmallTwo.qml b/tests/benchmarks/declarative/holistic/data/smallTargets/SmallTwo.qml new file mode 100644 index 0000000000..c473ce53a6 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/data/smallTargets/SmallTwo.qml @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Rectangle { + width: 100 + height: 100 + color: "blue" + border.color: "black" + border.width: 5 + radius: 10 +} diff --git a/tests/benchmarks/declarative/holistic/holistic.pro b/tests/benchmarks/declarative/holistic/holistic.pro new file mode 100644 index 0000000000..7f27696d60 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/holistic.pro @@ -0,0 +1,19 @@ +load(qttest_p4) +TEMPLATE = app +TARGET = tst_holistic +QT += declarative script network +macx:CONFIG -= app_bundle + +CONFIG += release + +SOURCES += tst_holistic.cpp \ + testtypes.cpp +HEADERS += testtypes.h + +symbian { + data.files += data + data.path = . + DEPLOYMENT += data +} else { + DEFINES += SRCDIR=\\\"$$PWD\\\" +} diff --git a/tests/benchmarks/declarative/holistic/testtypes.cpp b/tests/benchmarks/declarative/holistic/testtypes.cpp new file mode 100644 index 0000000000..5c232430f7 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/testtypes.cpp @@ -0,0 +1,98 @@ +/**************************************************************************** +** +** 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 "testtypes.h" +#include +#include +#include +#include + +static QScriptValue script_api(QDeclarativeEngine *engine, QScriptEngine *scriptEngine) +{ + Q_UNUSED(engine) + Q_UNUSED(scriptEngine) + + static int testProperty = 13; + QScriptValue v = scriptEngine->newObject(); + v.setProperty("scriptTestProperty", testProperty++); + return v; +} + +static QObject *qobject_api(QDeclarativeEngine *engine, QScriptEngine *scriptEngine) +{ + Q_UNUSED(engine) + Q_UNUSED(scriptEngine) + + testQObjectApi *o = new testQObjectApi(); + o->setQObjectTestProperty(20); + return o; +} + +static QObject *qobject_api_engine_parent(QDeclarativeEngine *engine, QScriptEngine *scriptEngine) +{ + Q_UNUSED(scriptEngine) + + static int testProperty = 26; + testQObjectApi *o = new testQObjectApi(engine); + o->setQObjectTestProperty(testProperty++); + return o; +} + +void registerTypes() +{ + qmlRegisterType("Qt.test", 1,0, "MyQmlObjectAlias"); + qmlRegisterType("Qt.test", 1,0, "MyQmlObject"); + + qmlRegisterType("Qt.test",1,0,"QPlainTextEdit"); + qRegisterMetaType("MyQmlObject::MyType"); + + qmlRegisterType("Qt.test", 1,0, "MyScarceResourceProvider"); + qmlRegisterType("Qt.test", 1,0, "MyArbitraryVariantProvider"); + + qmlRegisterModuleApi("Qt.test",1,0,script_api); // register (script) module API for an existing uri which contains elements + qmlRegisterModuleApi("Qt.test",1,0,qobject_api); // register (qobject) for an existing uri for which another module API was previously regd. Should replace! + qmlRegisterModuleApi("Qt.test.scriptApi",1,0,script_api); // register (script) module API for a uri which doesn't contain elements + qmlRegisterModuleApi("Qt.test.qobjectApi",1,0,qobject_api); // register (qobject) module API for a uri which doesn't contain elements + qmlRegisterModuleApi("Qt.test.qobjectApi",1,3,qobject_api); // register (qobject) module API for a uri which doesn't contain elements, minor version set + qmlRegisterModuleApi("Qt.test.qobjectApi",2,0,qobject_api); // register (qobject) module API for a uri which doesn't contain elements, major version set + qmlRegisterModuleApi("Qt.test.qobjectApiParented",1,0,qobject_api_engine_parent); // register (parented qobject) module API for a uri which doesn't contain elements +} + +//#include "testtypes.moc" diff --git a/tests/benchmarks/declarative/holistic/testtypes.h b/tests/benchmarks/declarative/holistic/testtypes.h new file mode 100644 index 0000000000..e3e0ffa482 --- /dev/null +++ b/tests/benchmarks/declarative/holistic/testtypes.h @@ -0,0 +1,355 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ +#ifndef TESTTYPES_H +#define TESTTYPES_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class MyQmlAttachedObject : public QObject +{ + Q_OBJECT + Q_PROPERTY(int value READ value CONSTANT) + Q_PROPERTY(int value2 READ value2 WRITE setValue2) +public: + MyQmlAttachedObject(QObject *parent) : QObject(parent), m_value2(0) {} + + int value() const { return 19; } + int value2() const { return m_value2; } + void setValue2(int v) { m_value2 = v; } + + void emitMySignal() { emit mySignal(); } + +signals: + void mySignal(); + +private: + int m_value2; +}; + +class MyQmlObject : public QObject +{ + Q_OBJECT + Q_ENUMS(MyEnum) + Q_ENUMS(MyEnum2) + Q_PROPERTY(int deleteOnSet READ deleteOnSet WRITE setDeleteOnSet) + Q_PROPERTY(bool trueProperty READ trueProperty CONSTANT) + Q_PROPERTY(bool falseProperty READ falseProperty CONSTANT) + Q_PROPERTY(int value READ value WRITE setValue) + Q_PROPERTY(int console READ console CONSTANT) + Q_PROPERTY(QString stringProperty READ stringProperty WRITE setStringProperty NOTIFY stringChanged) + Q_PROPERTY(QObject *objectProperty READ objectProperty WRITE setObjectProperty NOTIFY objectChanged) + Q_PROPERTY(QDeclarativeListProperty objectListProperty READ objectListProperty CONSTANT) + Q_PROPERTY(int resettableProperty READ resettableProperty WRITE setResettableProperty RESET resetProperty) + Q_PROPERTY(QRegExp regExp READ regExp WRITE setRegExp) + Q_PROPERTY(int nonscriptable READ nonscriptable WRITE setNonscriptable SCRIPTABLE false) + +public: + MyQmlObject(): myinvokableObject(0), m_methodCalled(false), m_methodIntCalled(false), m_object(0), m_value(0), m_resetProperty(13) {} + + enum MyEnum { EnumValue1 = 0, EnumValue2 = 1 }; + enum MyEnum2 { EnumValue3 = 2, EnumValue4 = 3 }; + + bool trueProperty() const { return true; } + bool falseProperty() const { return false; } + + QString stringProperty() const { return m_string; } + void setStringProperty(const QString &s) + { + if (s == m_string) + return; + m_string = s; + emit stringChanged(); + } + + QObject *objectProperty() const { return m_object; } + void setObjectProperty(QObject *obj) { + if (obj == m_object) + return; + m_object = obj; + emit objectChanged(); + } + + QDeclarativeListProperty objectListProperty() { return QDeclarativeListProperty(this, m_objectQList); } + + bool methodCalled() const { return m_methodCalled; } + bool methodIntCalled() const { return m_methodIntCalled; } + + QString string() const { return m_string; } + + static MyQmlAttachedObject *qmlAttachedProperties(QObject *o) { + return new MyQmlAttachedObject(o); + } + + int deleteOnSet() const { return 1; } + void setDeleteOnSet(int v) { if(v) delete this; } + + int value() const { return m_value; } + void setValue(int v) { m_value = v; } + + int resettableProperty() const { return m_resetProperty; } + void setResettableProperty(int v) { m_resetProperty = v; } + void resetProperty() { m_resetProperty = 13; } + + QRegExp regExp() { return m_regExp; } + void setRegExp(const QRegExp ®Exp) { m_regExp = regExp; } + + int console() const { return 11; } + + int nonscriptable() const { return 0; } + void setNonscriptable(int) {} + + MyQmlObject *myinvokableObject; + Q_INVOKABLE MyQmlObject *returnme() { return this; } + + struct MyType { + int value; + }; + QVariant variant() const { return m_variant; } + +signals: + void basicSignal(); + void argumentSignal(int a, QString b, qreal c); + void stringChanged(); + void objectChanged(); + void anotherBasicSignal(); + void thirdBasicSignal(); + void signalWithUnknownType(const MyQmlObject::MyType &arg); + +public slots: + void deleteMe() { delete this; } + void methodNoArgs() { m_methodCalled = true; } + void method(int a) { if(a == 163) m_methodIntCalled = true; } + void setString(const QString &s) { m_string = s; } + void myinvokable(MyQmlObject *o) { myinvokableObject = o; } + void variantMethod(const QVariant &v) { m_variant = v; } + +private: + friend class tst_qdeclarativeecmascript; + bool m_methodCalled; + bool m_methodIntCalled; + + QObject *m_object; + QString m_string; + QList m_objectQList; + int m_value; + int m_resetProperty; + QRegExp m_regExp; + QVariant m_variant; +}; + +QML_DECLARE_TYPEINFO(MyQmlObject, QML_HAS_ATTACHED_PROPERTIES) +Q_DECLARE_METATYPE(MyQmlObject::MyType) + +class testQObjectApi : public QObject +{ + Q_OBJECT + Q_PROPERTY (int qobjectTestProperty READ qobjectTestProperty NOTIFY qobjectTestPropertyChanged) + +public: + testQObjectApi(QObject* parent = 0) + : QObject(parent), m_testProperty(0) + { + } + + ~testQObjectApi() {} + + int qobjectTestProperty() const { return m_testProperty; } + void setQObjectTestProperty(int tp) { m_testProperty = tp; emit qobjectTestPropertyChanged(tp); } + +signals: + void qobjectTestPropertyChanged(int testProperty); + +private: + int m_testProperty; +}; + +class ArbitraryVariantProvider : public QObject +{ + Q_OBJECT + Q_PROPERTY(QVariant arbitraryVariant READ arbitraryVariant WRITE setArbitraryVariant NOTIFY arbitraryVariantChanged) + +public: + ArbitraryVariantProvider(QObject *parent = 0) + : QObject(parent), m_value(QVariant(QString(QLatin1String("random string value")))), m_count(1) + { + } + + ~ArbitraryVariantProvider() {} + + // the variant provided by the provider + QVariant arbitraryVariant() const { return m_value; } + void setArbitraryVariant(const QVariant& value) { m_value = value; emit arbitraryVariantChanged(); } + Q_INVOKABLE int changeVariant() + { + QPixmap pv(150, 150); + pv.fill(Qt::green); + int choice = qrand() % 4; + switch (choice) { + case 0: setArbitraryVariant(QVariant(QString(QLatin1String("string variant value")))); break; + case 1: setArbitraryVariant(QVariant(QColor(110, 120, 130))); break; + case 2: setArbitraryVariant(QVariant(55)); break; + default: setArbitraryVariant(QVariant(pv)); break; + } + + m_count += 1; + return m_count; + } + Q_INVOKABLE QVariant setVariantToFilledPixmap(int width, int height, int r, int g, int b) + { + QPixmap pv(width % 300, height % 300); + pv.fill(QColor(r % 256, g % 256, b % 256)); + m_value = pv; + m_count += 1; + return m_value; + } + Q_INVOKABLE QVariant setVariantAddCount(int addToCount, const QVariant& newValue) + { + m_value = newValue; + m_count += addToCount; + return m_value; + } + Q_INVOKABLE QVariant possibleVariant(int randomFactorOne, int randomFactorTwo, int randomFactorThree) const + { + QVariant retn; + QPixmap pv(randomFactorOne % 300, randomFactorTwo % 300); + pv.fill(QColor(randomFactorOne % 256, randomFactorTwo % 256, randomFactorThree % 256)); + int choice = qrand() % 4; + switch (choice) { + case 0: retn = QVariant(QString(QLatin1String("string variant value"))); break; + case 1: retn = QVariant(QColor(randomFactorThree % 256, randomFactorTwo % 256, randomFactorOne % 256)); break; + case 2: retn = QVariant((55 + randomFactorThree)); break; + default: retn = QVariant(pv); break; + } + return retn; + } + + // the following functions cover permutations of return value and arguments. + // functions with no return value: + Q_INVOKABLE void doNothing() const { /* does nothing */ } // no args, const + Q_INVOKABLE void incrementVariantChangeCount() { m_count = m_count + 1; } // no args, nonconst + Q_INVOKABLE void doNothing(int) const { /* does nothing. */ } // arg, const + Q_INVOKABLE void setVariantChangeCount(int newCount) { m_count = newCount; } // arg, nonconst + // functions with return value: + Q_INVOKABLE int variantChangeCount() const { return m_count; } // no args, const + Q_INVOKABLE int modifyVariantChangeCount() { m_count += 3; return m_count; } // no args, nonconst + Q_INVOKABLE int countPlus(int value) const { return m_count + value; } // arg, const + Q_INVOKABLE int modifyVariantChangeCount(int modifier) { m_count += modifier; return m_count; } // arg, nonconst. + +signals: + void arbitraryVariantChanged(); + +private: + QVariant m_value; + int m_count; +}; + +class ScarceResourceProvider : public QObject +{ + Q_OBJECT + Q_PROPERTY(QPixmap smallScarceResource READ smallScarceResource WRITE setSmallScarceResource NOTIFY smallScarceResourceChanged) + Q_PROPERTY(QPixmap largeScarceResource READ largeScarceResource WRITE setLargeScarceResource NOTIFY largeScarceResourceChanged) + +public: + ScarceResourceProvider(QObject *parent = 0) + : QObject(parent), m_small(100, 100), m_large(1000, 1000), m_colour(1) + { + m_small.fill(Qt::blue); + m_large.fill(Qt::blue); + } + + ~ScarceResourceProvider() {} + + QPixmap smallScarceResource() const { return m_small; } + void setSmallScarceResource(QPixmap v) { m_small = v; emit smallScarceResourceChanged(); } + bool smallScarceResourceIsDetached() const { return m_small.isDetached(); } + + QPixmap largeScarceResource() const { return m_large; } + void setLargeScarceResource(QPixmap v) { m_large = v; emit largeScarceResourceChanged(); } + bool largeScarceResourceIsDetached() const { return m_large.isDetached(); } + + Q_INVOKABLE void changeResources() + { + QPixmap newSmall(100, 100); + QPixmap newLarge(1000, 1000); + + if (m_colour == 1) { + m_colour = 2; + newSmall.fill(Qt::red); + newLarge.fill(Qt::red); + } else { + m_colour = 1; + newSmall.fill(Qt::blue); + newLarge.fill(Qt::blue); + } + + setSmallScarceResource(newSmall); + setLargeScarceResource(newLarge); + } + +signals: + void smallScarceResourceChanged(); + void largeScarceResourceChanged(); + +private: + QPixmap m_small; + QPixmap m_large; + + int m_colour; +}; + +void registerTypes(); + +#endif // TESTTYPES_H + diff --git a/tests/benchmarks/declarative/holistic/tst_holistic.cpp b/tests/benchmarks/declarative/holistic/tst_holistic.cpp new file mode 100644 index 0000000000..63dc11fc4b --- /dev/null +++ b/tests/benchmarks/declarative/holistic/tst_holistic.cpp @@ -0,0 +1,612 @@ +/**************************************************************************** +** +** 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 "testtypes.h" + +#include +#include +#include +#include +#include +#include +#include + +#ifdef Q_OS_SYMBIAN +// In Symbian OS test data is located in applications private dir +#define SRCDIR "." +#endif + +// Conceptually, there are several different "holistic" areas to benchmark: +// 1) Loading +// - read file from disk +// - parse/lex file +// - handle nested imports +// 2) Compilation +// - create meta object templates etc +// - compile to bytecode and cache it +// 3) Instantiation +// - running the bytecode to create an object tree, assign properties, etc +// - and, importantly, to evaluate bindings for the first time (incl. js expressions) +// 4) Dynamicism +// - bindings evaluation +// - signal handlers +// +// Aside from this, we also need to determine: +// 1) JavaScript Metrics +// - simple expressions +// - complex expressions +// - instantiation vs evaluation time +// - imports and nested imports +// 2) Context-switch costs +// - how expensive is it to call a cpp function from QML +// - how expensive is it to call a js function from cpp via QML +// - how expensive is it to pass around objects between them +// 3) Complete creation time. +// - loading + compilation + instantiation (for "application startup time" metric) +// +// In some cases, we want to include "initialization costs"; +// i.e., we need to tell the engine not to cache type data resulting +// in compilation between rounds, and we need to tell the engine not +// to cache whatever it caches between instantiations of components. +// The reason for this is that it is often the "first start of application" +// performance which we're attempting to benchmark. + +// define some custom types we use in test data functions. +typedef QList PropertyNameList; +Q_DECLARE_METATYPE(PropertyNameList); +typedef QList PropertyValueList; +Q_DECLARE_METATYPE(PropertyValueList); + +class tst_holistic : public QObject +{ + Q_OBJECT + +public: + tst_holistic(); + +private slots: + void initTestCase() + { + registerTypes(); + qRegisterMetaType("PropertyNameList"); + qRegisterMetaType("PropertyValueList"); + } + + void compilation_data(); + void compilation(); + void instantiation_data() { compilation_data(); } + void instantiation(); + void creation_data() { compilation_data(); } + void creation(); + void dynamicity_data(); + void dynamicity(); + + void cppToJsDirect_data(); + void cppToJsDirect(); + void cppToJsIndirect(); + + void typeResolution_data(); + void typeResolution(); + +private: + QDeclarativeEngine engine; +}; + +tst_holistic::tst_holistic() +{ +} + +inline QUrl TEST_FILE(const QString &filename) +{ + return QUrl::fromLocalFile(QLatin1String(SRCDIR) + QLatin1String("/data/") + filename); +} + + +void tst_holistic::compilation_data() +{ + QTest::addColumn("files"); + QTest::addColumn("repetitions"); + + QStringList f; + + // Benchmarks: a single, small component once with no caching. + f << QString(SRCDIR + QLatin1String("/data/smallTargets/SmallOne.qml")); + QTest::newRow("single small component") << f << 1; + + // Benchmarks: a single, small component ten times with caching. + QTest::newRow("single small component cached") << f << 10; f.clear(); + + // Benchmarks: a single, large component once with no caching. + f << QString(SRCDIR + QLatin1String("/data/largeTargets/mousearea-example.qml")); + QTest::newRow("single large component") << f << 1; + + // Benchmarks: a single, large component ten times with caching. + QTest::newRow("single large component cached") << f << 10; f.clear(); + + // Benchmarks: 4 small components once each with no caching + f << QString(SRCDIR + QLatin1String("/data/smallTargets/SmallOne.qml")); + f << QString(SRCDIR + QLatin1String("/data/smallTargets/SmallTwo.qml")); + f << QString(SRCDIR + QLatin1String("/data/smallTargets/SmallThree.qml")); + f << QString(SRCDIR + QLatin1String("/data/smallTargets/SmallFour.qml")); + QTest::newRow("multiple small components") << f << 1; + + // Benchmarks: 4 small components ten times each with caching + QTest::newRow("multiple small components cached") << f << 10; f.clear(); + + // Benchmarks: 3 large components once each with no caching. + f << QString(SRCDIR + QLatin1String("/data/largeTargets/mousearea-example.qml")); + f << QString(SRCDIR + QLatin1String("/data/largeTargets/gridview-example.qml")); + f << QString(SRCDIR + QLatin1String("/data/largeTargets/layoutdirection.qml")); + QTest::newRow("multiple large components") << f << 1; + + // Benchmarks: 3 large components ten times each with caching. + QTest::newRow("multiple large components cached") << f << 10; f.clear(); + + // Benchmarks: single small component which imports a single small js file, no caching + f << QString(SRCDIR + QLatin1String("/data/jsImports/Sssi.qml")); + QTest::newRow("single small js import") << f << 1; + + // Benchmarks: single small component which imports a single small js file, 10 reps, with caching + QTest::newRow("single small js import, cached") << f << 10; f.clear(); + + // Benchmarks: single small component which imports multiple small js files (no deep nesting), no caching + f << QString(SRCDIR + QLatin1String("/data/jsImports/Msbsi.qml")); + QTest::newRow("multiple small js imports, shallow") << f << 1; + + // Benchmarks: single small component which imports multiple small js files (no deep nesting), 10 reps, with caching + QTest::newRow("multiple small js imports, shallow, cached") << f << 10; f.clear(); + + // Benchmarks: single small component which imports multiple small js files (with deep nesting), no caching + f << QString(SRCDIR + QLatin1String("/data/jsImports/Msdsi.qml")); + QTest::newRow("multiple small js imports, deeply nested") << f << 1; + + // Benchmarks: single small component which imports multiple small js files (with deep nesting), 10 reps, with caching + QTest::newRow("multiple small js imports, deeply nested, cached") << f << 10; f.clear(); + + // Benchmarks: single small component which imports multiple small js files (nested and unnested), no caching + f << QString(SRCDIR + QLatin1String("/data/jsImports/Mssi.qml")); + QTest::newRow("muliple small js imports, both") << f << 1; + + // Benchmarks: single small component which imports multiple small js files (nested and unnested), 10 reps, with caching + QTest::newRow("muliple small js imports, both, cached") << f << 10; f.clear(); + + // Benchmarks: single small component which imports a single large js file, no caching + f << QString(SRCDIR + QLatin1String("/data/jsImports/Slsi.qml")); + QTest::newRow("single large js import") << f << 1; + + // Benchmarks: single small component which imports a single large js file, 10 reps, with caching + QTest::newRow("single large js import, cached") << f << 10; f.clear(); + + // Benchmarks: single small component which imports multiple large js files (no deep nesting), no caching + f << QString(SRCDIR + QLatin1String("/data/jsImports/Mlbsi.qml")); + QTest::newRow("multiple large js imports, shallow") << f << 1; + + // Benchmarks: single small component which imports multiple large js files (no deep nesting), 10 reps, with caching + QTest::newRow("multiple large js imports, shallow, cached") << f << 10; f.clear(); + + // Benchmarks: single small component which imports multiple large js files (with deep nesting), no caching + f << QString(SRCDIR + QLatin1String("/data/jsImports/Mldsi.qml")); + QTest::newRow("multiple large js imports, deeply nested") << f << 1; + + // Benchmarks: single small component which imports multiple large js files (with deep nesting), 10 reps, with caching + QTest::newRow("multiple large js imports, deeply nested, cached") << f << 10; f.clear(); + + // Benchmarks: single small component which imports multiple large js files (nested and unnested), no caching + f << QString(SRCDIR + QLatin1String("/data/jsImports/Mlsi.qml")); + QTest::newRow("multiple large js imports, both") << f << 1; + + // Benchmarks: single small component which imports multiple large js files (nested and unnested), 10 reps, with caching + QTest::newRow("multiple large js imports, both, cached") << f << 10; f.clear(); + + // Benchmarks: single small component which imports multiple js files which all import a .pragma library js file, no caching + f << QString(SRCDIR + QLatin1String("/data/jsImports/PragmaBm.qml")); + QTest::newRow(".pragma library js import") << f << 1; + + // Benchmarks: single small component which imports multiple js files which all import a .pragma library js file, 10 reps, with caching + QTest::newRow(".pragma library js import, cached") << f << 10; f.clear(); + + // Benchmarks: single small component which imports a js file which imports a QML module, no caching + f << QString(SRCDIR + QLatin1String("/data/jsImports/ModuleBm.qml")); + QTest::newRow("import js with QML import") << f << 1; + + // Benchmarks: single small component which imports a js file which imports a QML module, 10 reps, with caching + QTest::newRow("import js with QML import, cached") << f << 10; f.clear(); + + // Benchmarks: single small component which imports multiple js files which all import a .pragma library js file and a QML module, no caching + f << QString(SRCDIR + QLatin1String("/data/jsImports/PragmaModuleBm.qml")); + QTest::newRow("import js with QML import and .pragma library") << f << 1; + + // Benchmarks: single small component which imports multiple js files which all import a .pragma library js file and a QML module, 10 reps, with caching + QTest::newRow("import js with QML import and .pragma library, cached") << f << 10; f.clear(); +} + +void tst_holistic::compilation() +{ + // This function benchmarks the cost of loading and compiling specified QML files. + // If "repetitions" is non-zero, each file from "files" will be compiled "repetitions" + // times, without clearing the engine's component cache between compilations. + + QFETCH(QStringList, files); + QFETCH(int, repetitions); + Q_ASSERT(files.size() > 0); + Q_ASSERT(repetitions > 0); + + QBENCHMARK { + engine.clearComponentCache(); + for (int i = 0; i < repetitions; ++i) { + for (int j = 0; j < files.size(); ++j) { + QDeclarativeComponent c(&engine, QUrl::fromLocalFile(files.at(j))); + } + } + } +} + +void tst_holistic::instantiation() +{ + // This function benchmarks the cost of instantiating components compiled from specified QML files. + // If "repetitions" is non-zero, each component compiled from "files" will be instantiated "repetitions" + // times, without clearing the component's instantiation cache between instantiations. + + QFETCH(QStringList, files); + QFETCH(int, repetitions); + Q_ASSERT(files.size() > 0); + Q_ASSERT(repetitions > 0); + + QList components; + for (int i = 0; i < files.size(); ++i) { + QDeclarativeComponent *c = new QDeclarativeComponent(&engine, QUrl::fromLocalFile(files.at(i))); + components.append(c); + } + + QBENCHMARK { + // XXX TODO: clear each component's instantiation cache + + for (int i = 0; i < repetitions; ++i) { + for (int j = 0; j < components.size(); ++j) { + QObject *obj = components.at(j)->create(); + delete obj; + } + } + } + + // cleanup + for (int i = 0; i < components.size(); ++i) { + delete components.at(i); + } +} + +void tst_holistic::creation() +{ + // This function benchmarks the cost of loading, compiling and instantiating specified QML files. + // If "repetitions" is non-zero, each file from "files" will be created "repetitions" + // times, without clearing the engine's component cache between component creation. + + QFETCH(QStringList, files); + QFETCH(int, repetitions); + Q_ASSERT(files.size() > 0); + Q_ASSERT(repetitions > 0); + + QBENCHMARK { + engine.clearComponentCache(); + for (int i = 0; i < repetitions; ++i) { + for (int j = 0; j < files.size(); ++j) { + QDeclarativeComponent c(&engine, QUrl::fromLocalFile(files.at(j))); + QObject *obj = c.create(); + delete obj; + } + } + } +} + +void tst_holistic::dynamicity_data() +{ + QTest::addColumn("file"); + QTest::addColumn("writeProperty"); + QTest::addColumn("writeValueOne"); + QTest::addColumn("writeValueTwo"); + QTest::addColumn("readProperty"); + + QString f; + + // Benchmarks: single simple property binding + f = QString(SRCDIR + QLatin1String("/data/dynamicTargets/DynamicOne.qml")); + QTest::newRow("single simple property binding") << f << QString(QLatin1String("dynamicWidth")) << QVariant(300) << QVariant(500) << QString(QLatin1String("height")); + + // Benchmarks: multiple simple property bindings in one component + f = QString(SRCDIR + QLatin1String("/data/dynamicTargets/DynamicTwo.qml")); + QTest::newRow("multiple simple property bindings") << f << QString(QLatin1String("dynamicWidth")) << QVariant(300) << QVariant(500) << QString(QLatin1String("dynamicWidth")); + + // Benchmarks: single simple property binding plus onPropertyChanged slot + f = QString(SRCDIR + QLatin1String("/data/dynamicTargets/DynamicThree.qml")); + QTest::newRow("single simple plus slot") << f << QString(QLatin1String("dynamicWidth")) << QVariant(300) << QVariant(500) << QString(QLatin1String("dynamicWidth")); + + // Benchmarks: multiple simple property bindings plus multiple onPropertyChanged slots in one component + f = QString(SRCDIR + QLatin1String("/data/dynamicTargets/DynamicFour.qml")); + QTest::newRow("multiple simple plus slots") << f << QString(QLatin1String("dynamicWidth")) << QVariant(300) << QVariant(500) << QString(QLatin1String("dynamicHeight")); + + // Benchmarks: single simple js expression in a slot + f = QString(SRCDIR + QLatin1String("/data/jsTargets/JsOne.qml")); + QTest::newRow("single simple js expression slot") << f << QString(QLatin1String("dynamicWidth")) << QVariant(300) << QVariant(500) << QString(QLatin1String("dynamicWidth")); + + // Benchmarks: single complex js expression in a slot + f = QString(SRCDIR + QLatin1String("/data/jsTargets/JsTwo.qml")); + QTest::newRow("single complex js expression slot") << f << QString(QLatin1String("dynamicWidth")) << QVariant(300) << QVariant(500) << QString(QLatin1String("dynamicWidth")); + + // Benchmarks: simple property assignment and bindings update + f = QString(SRCDIR + QLatin1String("/data/scopeSwitching/CppToQml.qml")); + QTest::newRow("single simple property binding") << f << QString(QLatin1String("arbitrary")) << QVariant(36) << QVariant(35) << QString(QLatin1String("arbitrary")); +} + +void tst_holistic::dynamicity() +{ + // This function benchmarks the cost of "continued operation" - signal invocation, + // updating bindings, etc. Note that we take two different writeValues in order + // to force updates to occur, and we read to force lazy evaluation to occur. + + QFETCH(QString, file); + QFETCH(QString, writeProperty); + QFETCH(QVariant, writeValueOne); + QFETCH(QVariant, writeValueTwo); + QFETCH(QString, readProperty); + + QDeclarativeComponent c(&engine, file); + QObject *obj = c.create(); + + QVariant readValue; + QVariant writeValue; + bool usedFirst = false; + + QBENCHMARK { + if (usedFirst) { + writeValue = writeValueTwo; + usedFirst = false; + } else { + writeValue = writeValueOne; + usedFirst = true; + } + + obj->setProperty(writeProperty.toAscii().constData(), writeValue); + readValue = obj->property(readProperty.toAscii().constData()); + } + + delete obj; +} + + + + + + + +void tst_holistic::cppToJsDirect_data() +{ + QTest::addColumn("file"); + QTest::addColumn("methodName"); + + QString f; + + // Benchmarks: cost of calling a js function from cpp directly + f = QString(SRCDIR + QLatin1String("/data/scopeSwitching/CppToJs.qml")); + QTest::newRow("cpp-to-js") << f << QString(QLatin1String("callJsFunction")); + + // Benchmarks: cost of calling js function which calls cpp function: + // const CPP function with no return value and no arguments. + f = QString(SRCDIR + QLatin1String("/data/scopeSwitching/JsToCppOne.qml")); + QTest::newRow("cpp-to-js-to-cpp: no retn, no args") << f << QString(QLatin1String("callCppFunction")); + + // Benchmarks: cost of calling js function which calls cpp function: + // nonconst CPP function with no return value and no arguments. + f = QString(SRCDIR + QLatin1String("/data/scopeSwitching/JsToCppTwo.qml")); + QTest::newRow("cpp-to-js-to-cpp: nonconst, no retn, no args") << f << QString(QLatin1String("callCppFunction")); + + // Benchmarks: cost of calling js function which calls cpp function: + // const CPP function with no return value and a single integer argument. + f = QString(SRCDIR + QLatin1String("/data/scopeSwitching/JsToCppThree.qml")); + QTest::newRow("cpp-to-js-to-cpp: const, no retn, int arg") << f << QString(QLatin1String("callCppFunction")); + + // Benchmarks: cost of calling js function which calls cpp function: + // nonconst CPP function with no return value and a single integer argument. + f = QString(SRCDIR + QLatin1String("/data/scopeSwitching/JsToCppFour.qml")); + QTest::newRow("cpp-to-js-to-cpp: nonconst, no retn, int arg") << f << QString(QLatin1String("callCppFunction")); + + // Benchmarks: cost of calling js function which calls cpp function: + // const CPP function with an integer return value and no arguments. + f = QString(SRCDIR + QLatin1String("/data/scopeSwitching/JsToCppFive.qml")); + QTest::newRow("cpp-to-js-to-cpp: const, int retn, no args") << f << QString(QLatin1String("callCppFunction")); + + // Benchmarks: cost of calling js function which calls cpp function: + // nonconst CPP function with an integer return value and no arguments. + f = QString(SRCDIR + QLatin1String("/data/scopeSwitching/JsToCppSix.qml")); + QTest::newRow("cpp-to-js-to-cpp: nonconst, int retn, no args") << f << QString(QLatin1String("callCppFunction")); + + // Benchmarks: cost of calling js function which calls cpp function: + // const CPP function with an integer return value and a single integer argument. + f = QString(SRCDIR + QLatin1String("/data/scopeSwitching/JsToCppSeven.qml")); + QTest::newRow("cpp-to-js-to-cpp: const, int retn, int arg") << f << QString(QLatin1String("callCppFunction")); + + // Benchmarks: cost of calling js function which calls cpp function: + // nonconst CPP function with an integer return value and a single integer argument. + f = QString(SRCDIR + QLatin1String("/data/scopeSwitching/JsToCppEight.qml")); + QTest::newRow("cpp-to-js-to-cpp: nonconst, int retn, int arg") << f << QString(QLatin1String("callCppFunction")); + + // Benchmarks: cost of calling js function which calls cpp function: + // const CPP function with a variant return value and multiple integer arguments. + f = QString(SRCDIR + QLatin1String("/data/scopeSwitching/JsToCppNine.qml")); + QTest::newRow("cpp-to-js-to-cpp: const, variant retn, int args") << f << QString(QLatin1String("callCppFunction")); + + // Benchmarks: cost of calling js function which calls cpp function: + // nonconst CPP function with a variant return value and multiple integer arguments. + f = QString(SRCDIR + QLatin1String("/data/scopeSwitching/JsToCppTen.qml")); + QTest::newRow("cpp-to-js-to-cpp: nonconst, variant retn, int args") << f << QString(QLatin1String("callCppFunction")); + + // Benchmarks: cost of calling js function which calls cpp function: + // nonconst CPP function with a variant return value and multiple integer arguments. + f = QString(SRCDIR + QLatin1String("/data/scopeSwitching/JsToCppEleven.qml")); + QTest::newRow("cpp-to-js-to-cpp: nonconst, variant retn, variant + int args") << f << QString(QLatin1String("callCppFunction")); + + // Benchmarks: calling js function which copies scarce resources by calling back into cpp scope + f = QString(SRCDIR + QLatin1String("/data/scopeSwitching/ScarceOne.qml")); + QTest::newRow("cpp-to-js-to-coo: copy scarce resources") << f << QString(QLatin1String("copyScarceResources")); +} + + +void tst_holistic::cppToJsDirect() +{ + // This function benchmarks the cost of calling from CPP scope to JS scope + // (and possibly vice versa, if the invoked js method then calls to cpp). + + QFETCH(QString, file); + QFETCH(QString, methodName); + + QDeclarativeComponent c(&engine, file); + QObject *obj = c.create(); + + QBENCHMARK { + QMetaObject::invokeMethod(obj, methodName.toLatin1().constData()); + } + + delete obj; +} + + +void tst_holistic::cppToJsIndirect() +{ + // This function benchmarks the cost of binding scarce resources + // to properties of a QML component. The engine should automatically release such + // resources when they are no longer used. + // The benchmark deliberately causes change signals to be emitted (and + // modifies the scarce resources) so that the properties are updated. + + QDeclarativeComponent c(&engine, QString(SRCDIR + QLatin1String("/data/scopeSwitching/ScarceTwo.qml"))); + QObject *obj = c.create(); + + ScarceResourceProvider *srp = 0; + srp = qobject_cast(QDeclarativeProperty::read(obj, "a").value()); + + QBENCHMARK { + srp->changeResources(); // will cause small+large scarce resources changed signals to be emitted. + } + + delete obj; +} + + + + + +void tst_holistic::typeResolution_data() +{ + QTest::addColumn("file"); + QTest::addColumn("propertyNameOne"); + QTest::addColumn("propertyValueOne"); + QTest::addColumn("propertyNameTwo"); + QTest::addColumn("propertyValueTwo"); + QTest::addColumn("repetitions"); + + QString f; + PropertyNameList pn1; + PropertyValueList pv1; + PropertyNameList pn2; + PropertyValueList pv2; + + // Benchmarks: resolving nested ids and types, no caching + f = QString(SRCDIR + QLatin1String("/data/resolutionTargets/ResolveOne.qml")); + pn1 << QString(QLatin1String("baseWidth")) << QString(QLatin1String("baseHeight")) << QString(QLatin1String("baseColor")); + pv1 << QVariant(401) << QVariant(402) << QVariant(QString(QLatin1String("brown"))); + pn2 << QString(QLatin1String("baseWidth")) << QString(QLatin1String("baseHeight")) << QString(QLatin1String("baseColor")); + pv2 << QVariant(403) << QVariant(404) << QVariant(QString(QLatin1String("orange"))); + QTest::newRow("nested id resolution") << f << pn1 << pv1 << pn2 << pv2 << 1; + + // Benchmarks: resolving nested ids and types, 10 reps with caching + QTest::newRow("nested id resolution, cached") << f << pn1 << pv1 << pn2 << pv2 << 10; + pn1.clear(); pn2.clear(); pv1.clear(); pv2.clear(); +} + +void tst_holistic::typeResolution() +{ + // This function benchmarks the cost of "continued operation" (signal invocation, + // updating bindings, etc) where the component has lots of nested items with + // lots of resolving required. Note that we take two different writeValues in order + // to force updates to occur. + + QFETCH(QString, file); + QFETCH(PropertyNameList, propertyNameOne); + QFETCH(PropertyValueList, propertyValueOne); + QFETCH(PropertyNameList, propertyNameTwo); + QFETCH(PropertyValueList, propertyValueTwo); + QFETCH(int, repetitions); + + Q_ASSERT(propertyNameOne.size() == propertyValueOne.size()); + Q_ASSERT(propertyNameTwo.size() == propertyValueTwo.size()); + Q_ASSERT(repetitions > 0); + + QDeclarativeComponent c(&engine, file); + QObject *obj = c.create(); + + PropertyNameList writeProperty; + PropertyValueList writeValue; + bool usedFirst = false; + + QBENCHMARK { + for (int i = 0; i < repetitions; ++i) { + if (usedFirst) { + writeProperty = propertyNameOne; + writeValue = propertyValueOne; + usedFirst = false; + } else { + writeProperty = propertyNameTwo; + writeValue = propertyValueTwo; + usedFirst = true; + } + + for (int j = 0; j < writeProperty.size(); ++j) { + obj->setProperty(writeProperty.at(j).toAscii().constData(), writeValue.at(j)); + } + } + } + + delete obj; +} + + +QTEST_MAIN(tst_holistic) + +#include "tst_holistic.moc" diff --git a/tests/benchmarks/declarative/script/data/enums.qml b/tests/benchmarks/declarative/script/data/enums.qml new file mode 100644 index 0000000000..81b27b9a58 --- /dev/null +++ b/tests/benchmarks/declarative/script/data/enums.qml @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** 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 Declarative module 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$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Item { + function runtest() { + var a = 0; + for (var ii = 0; ii < 100000; ++ii) + a += Text.RichText; + return a; + } +} diff --git a/tests/benchmarks/declarative/script/data/namespacedEnums.qml b/tests/benchmarks/declarative/script/data/namespacedEnums.qml new file mode 100644 index 0000000000..dd3fa97de9 --- /dev/null +++ b/tests/benchmarks/declarative/script/data/namespacedEnums.qml @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** 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 Declarative module 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$ +** +****************************************************************************/ + +import QtQuick 1.0 as QtQuick + +QtQuick.Item { + function runtest() { + var a = 0; + for (var ii = 0; ii < 100000; ++ii) + a += QtQuick.Text.RichText; + return a; + } +} + diff --git a/tests/benchmarks/declarative/script/data/script.js b/tests/benchmarks/declarative/script/data/script.js new file mode 100644 index 0000000000..9f46570004 --- /dev/null +++ b/tests/benchmarks/declarative/script/data/script.js @@ -0,0 +1 @@ +function func() { return 1; } diff --git a/tests/benchmarks/declarative/script/data/script2.js b/tests/benchmarks/declarative/script/data/script2.js new file mode 100644 index 0000000000..102f081140 --- /dev/null +++ b/tests/benchmarks/declarative/script/data/script2.js @@ -0,0 +1,2 @@ +function func() { return 2; } + diff --git a/tests/benchmarks/declarative/script/data/scriptCall.qml b/tests/benchmarks/declarative/script/data/scriptCall.qml new file mode 100644 index 0000000000..62014eb87a --- /dev/null +++ b/tests/benchmarks/declarative/script/data/scriptCall.qml @@ -0,0 +1,54 @@ +/**************************************************************************** +** +** 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 Declarative module 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$ +** +****************************************************************************/ + +import QtQuick 1.0 +import "script.js" as Script +import "script2.js" as OtherScript + +Item { + function runtest() { + var a = 0; + for (var ii = 0; ii < 1000000; ++ii) + a += Script.func(); + return a; + } +} + diff --git a/tests/benchmarks/declarative/script/tst_script.cpp b/tests/benchmarks/declarative/script/tst_script.cpp index 2020a18440..ff4bbb698e 100644 --- a/tests/benchmarks/declarative/script/tst_script.cpp +++ b/tests/benchmarks/declarative/script/tst_script.cpp @@ -70,6 +70,9 @@ private slots: void property_qobject(); void property_qmlobject(); + void setproperty_js(); + void setproperty_qmlobject(); + void function_js(); void function_cpp(); void function_qobject(); @@ -98,6 +101,10 @@ private slots: void global_property_qml_js(); void scriptfile_property(); + + void enums(); + void namespacedEnums(); + void scriptCall(); }; inline QUrl TEST_FILE(const QString &filename) @@ -108,12 +115,13 @@ inline QUrl TEST_FILE(const QString &filename) class TestObject : public QObject { Q_OBJECT - Q_PROPERTY(int x READ x) + Q_PROPERTY(int x READ x WRITE setX) public: TestObject(QObject *parent = 0); int x(); + void setX(int x) { m_x = x; } void emitMySignal() { emit mySignal(); } void emitMySignalWithArgs(int n) { emit mySignalWithArgs(n); } @@ -323,6 +331,49 @@ void tst_script::property_qmlobject() } } +#define SETPROPERTY_PROGRAM \ + "(function(testObject) { return (function() { " \ + " for (var ii = 0; ii < 10000; ++ii) { " \ + " testObject.x = ii; " \ + " } " \ + "}); })" + +void tst_script::setproperty_js() +{ + QScriptEngine engine; + + QScriptValue v = engine.newObject(); + v.setProperty(QLatin1String("x"), 0); + + QScriptValueList args; + args << v; + QScriptValue prog = engine.evaluate(SETPROPERTY_PROGRAM).call(engine.globalObject(), args); + prog.call(); + + QBENCHMARK { + prog.call(); + } +} + +void tst_script::setproperty_qmlobject() +{ + QDeclarativeEngine qmlengine; + + QScriptEngine *engine = QDeclarativeEnginePrivate::getScriptEngine(&qmlengine); + TestObject to; + + QScriptValue v = QDeclarativeEnginePrivate::get(&qmlengine)->objectClass->newQObject(&to); + + QScriptValueList args; + args << v; + QScriptValue prog = engine->evaluate(SETPROPERTY_PROGRAM).call(engine->globalObject(), args); + prog.call(); + + QBENCHMARK { + prog.call(); + } +} + #define FUNCTION_PROGRAM \ "(function(testObject) { return (function() { " \ " var test = 0; " \ @@ -698,6 +749,60 @@ void tst_script::scriptfile_property() delete rect; } +void tst_script::enums() +{ + QDeclarativeEngine engine; + QDeclarativeComponent component(&engine, TEST_FILE("enums.qml")); + QObject *o = component.create(); + QVERIFY(o != 0); + + int index = o->metaObject()->indexOfMethod("runtest()"); + QVERIFY(index != -1); + QMetaMethod method = o->metaObject()->method(index); + + QBENCHMARK { + method.invoke(o, Qt::DirectConnection); + } + + delete o; +} + +void tst_script::namespacedEnums() +{ + QDeclarativeEngine engine; + QDeclarativeComponent component(&engine, TEST_FILE("namespacedEnums.qml")); + QObject *o = component.create(); + QVERIFY(o != 0); + + int index = o->metaObject()->indexOfMethod("runtest()"); + QVERIFY(index != -1); + QMetaMethod method = o->metaObject()->method(index); + + QBENCHMARK { + method.invoke(o, Qt::DirectConnection); + } + + delete o; +} + +void tst_script::scriptCall() +{ + QDeclarativeEngine engine; + QDeclarativeComponent component(&engine, TEST_FILE("scriptCall.qml")); + QObject *o = component.create(); + QVERIFY(o != 0); + + int index = o->metaObject()->indexOfMethod("runtest()"); + QVERIFY(index != -1); + QMetaMethod method = o->metaObject()->method(index); + + QBENCHMARK { + method.invoke(o, Qt::DirectConnection); + } + + delete o; +} + QTEST_MAIN(tst_script) #include "tst_script.moc" -- cgit v1.2.3