summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2010-12-09 13:51:29 +1000
committerRhys Weatherley <rhys.weatherley@nokia.com>2010-12-09 14:43:01 +1000
commit200a8ac92afa0d8c5ff54c929a345dd3e05d3dd7 (patch)
treee5750e009bec957663f44fda4706dcf62163f97c /doc
parent0298da6b7a93b87e951ce04b6b88bdbfe87db9c8 (diff)
Add benchmark support to the QML test framework
Test functions called "benchmark_foo()" will be run as benchmarks inside an implicit QBENCHMARK {} block.
Diffstat (limited to 'doc')
-rw-r--r--doc/testcases.txt29
1 files changed, 29 insertions, 0 deletions
diff --git a/doc/testcases.txt b/doc/testcases.txt
index fe655dd..3ba44bc 100644
--- a/doc/testcases.txt
+++ b/doc/testcases.txt
@@ -276,3 +276,32 @@ Button {
}
}
----------------------
+
+Benchmarks
+==========
+
+If the test function name starts with "benchmark_", then it will be
+run multiple times with the Qt benchmark framework, with a average
+timing value reported for the runs. This is equivalent to using the
+QBENCHMARK macro in QTestLib.
+
+----------------------
+TestCase {
+ id: top
+ name: "CreateBenchmark"
+
+ function benchmark_create_component() {
+ var component = Qt.createComponent("item.qml")
+ var obj = component.createObject(top)
+ obj.destroy()
+ component.destroy()
+ }
+}
+----------------------
+
+RESULT : CreateBenchmark::benchmark_create_component:
+ 0.23 msecs per iteration (total: 60, iterations: 256)
+PASS : CreateBenchmark::benchmark_create_component()
+
+To get the effect of the QBENCHMARK_ONCE macro, prefix the test
+function name with "benchmark_once_".