aboutsummaryrefslogtreecommitdiffstats
path: root/tests/benchmarks
diff options
context:
space:
mode:
authorRobin Burchell <robin.burchell@viroteck.net>2014-09-15 03:52:44 +0200
committerRobin Burchell <robin.burchell@viroteck.net>2014-09-15 14:54:58 +0200
commit0b6b8c2f8e9ca3240c2a4b405cbd4aa6f5937e3a (patch)
tree2beb045db83aafd57a206b482b4c2392a8c8e24e /tests/benchmarks
parent2c54d85bf70e078ab1dfb1465567512aded5cf9d (diff)
tst_compilation: Fix the horrifically broken benchmark.
Start by updating the horrifically outdated QML (re-copy from SameGame). In addition to this, we reinstate the QVERIFY which cunningly hid the fact that the benchmark was totally broken, and change it to a QVERIFY2, so we can easily identify what broke if anything in the future. Change-Id: Icaa60e0dd0b78861cdd2431af36e534d257a855d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'tests/benchmarks')
-rw-r--r--tests/benchmarks/qml/compilation/data/BoomBlock.qml46
-rw-r--r--tests/benchmarks/qml/compilation/tst_compilation.cpp2
2 files changed, 27 insertions, 21 deletions
diff --git a/tests/benchmarks/qml/compilation/data/BoomBlock.qml b/tests/benchmarks/qml/compilation/data/BoomBlock.qml
index e351b8a227..68cf805088 100644
--- a/tests/benchmarks/qml/compilation/data/BoomBlock.qml
+++ b/tests/benchmarks/qml/compilation/data/BoomBlock.qml
@@ -32,18 +32,22 @@
****************************************************************************/
import QtQuick 2.0
-import Qt.labs.particles 1.0
+import QtQuick.Particles 2.0
Item {
id: block
property bool dying: false
property bool spawned: false
property int type: 0
- property int targetX: 0
- property int targetY: 0
+ property ParticleSystem particleSystem
- SpringFollow on x { enabled: spawned; to: targetX; spring: 2; damping: 0.2 }
- SpringFollow on y { to: targetY; spring: 2; damping: 0.2 }
+ Behavior on x {
+ enabled: spawned;
+ SpringAnimation{ spring: 2; damping: 0.2 }
+ }
+ Behavior on y {
+ SpringAnimation{ spring: 2; damping: 0.2 }
+ }
Image {
id: img
@@ -60,26 +64,28 @@ Item {
Behavior on opacity { NumberAnimation { duration: 200 } }
anchors.fill: parent
}
-
- Particles {
+ Emitter {
id: particles
-
- width: 1; height: 1
- anchors.centerIn: parent
-
- emissionRate: 0
- lifeSpan: 700; lifeSpanDeviation: 600
- angle: 0; angleDeviation: 360;
- velocity: 100; velocityDeviation: 30
- source: {
+ system: particleSystem
+ group: {
if(type == 0){
- "pics/redStar.png";
+ "red";
} else if (type == 1) {
- "pics/blueStar.png";
+ "blue";
} else {
- "pics/greenStar.png";
+ "green";
}
}
+ anchors.fill: parent
+
+ velocity: TargetDirection{targetX: block.width/2; targetY: block.height/2; magnitude: -60; magnitudeVariation: 60}
+ shape: EllipseShape{fill:true}
+ enabled: false;
+ lifeSpan: 700; lifeSpanVariation: 100
+ emitRate: 1000
+ maximumEmitted: 100 //only fires 0.1s bursts (still 2x old number)
+ size: 28
+ endSize: 14
}
states: [
@@ -90,7 +96,7 @@ Item {
State {
name: "DeathState"; when: dying == true
- StateChangeScript { script: particles.burst(50); }
+ StateChangeScript { script: particles.pulse(0.1); }
PropertyChanges { target: img; opacity: 0 }
StateChangeScript { script: block.destroy(1000); }
}
diff --git a/tests/benchmarks/qml/compilation/tst_compilation.cpp b/tests/benchmarks/qml/compilation/tst_compilation.cpp
index 3a03972ee6..5c7a8ff58c 100644
--- a/tests/benchmarks/qml/compilation/tst_compilation.cpp
+++ b/tests/benchmarks/qml/compilation/tst_compilation.cpp
@@ -84,7 +84,7 @@ void tst_compilation::boomblock()
QBENCHMARK {
QQmlComponent c(&engine);
c.setData(data, QUrl());
-// QVERIFY(c.isReady());
+ QVERIFY2(c.isReady(), qPrintable(c.errorString()));
}
}