Merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/whereDidMyBenchGo into lp:ubuntu-ui-toolkit/staging

Proposed by Christian Dywan on 2015-05-12
Status: Merged
Approved by: Zsombor Egri on 2015-05-15
Approved revision: 1506
Merged at revision: 1506
Proposed branch: lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/whereDidMyBenchGo
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 69 lines (+7/-10)
1 file modified
tests/unit/tst_components_benchmark/tst_components_benchmark.cpp (+7/-10)
To merge this branch: bzr merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/whereDidMyBenchGo
Reviewer Review Type Date Requested Status
Zsombor Egri 2015-05-12 Approve on 2015-05-15
PS Jenkins bot continuous-integration Needs Fixing on 2015-05-12
Review via email: mp+258925@code.launchpad.net

Commit message

Add version subfolder to benchmark test paths

To post a comment you must log in.
Zsombor Egri (zsombi) wrote :

A small request inline, and we're good.

review: Needs Fixing
1506. By Christian Dywan on 2015-05-15

Use macros instead of hard-coding latest version

Zsombor Egri (zsombi) wrote :

Looks good now. Thx!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/unit/tst_components_benchmark/tst_components_benchmark.cpp'
2--- tests/unit/tst_components_benchmark/tst_components_benchmark.cpp 2014-11-25 09:58:33 +0000
3+++ tests/unit/tst_components_benchmark/tst_components_benchmark.cpp 2015-05-15 09:59:19 +0000
4@@ -22,6 +22,7 @@
5
6 #include <QDir>
7 #include <QUrl>
8+#include <ucnamespace.h>
9
10 class tst_components_benchmark: public QObject
11 {
12@@ -32,7 +33,8 @@
13 QTest::addColumn<QString>("fileName");
14
15 QDir dir;
16- dir.setPath(UBUNTU_COMPONENT_PATH);
17+ dir.setPath(QString("%1/%2.%3").arg(UBUNTU_COMPONENT_PATH).arg(MAJOR_VERSION(LATEST_UITK_VERSION)).arg(MINOR_VERSION(LATEST_UITK_VERSION)));
18+ QVERIFY2(dir.exists(), qPrintable(dir.absolutePath()));
19 QStringList nameFilters;
20 nameFilters << "*.qml";
21 dir.setNameFilters(nameFilters);
22@@ -40,8 +42,7 @@
23 dir.setSorting(QDir::Size | QDir::Reversed);
24
25 QFileInfoList list = dir.entryInfoList();
26-
27- qDebug() << "Found" << list.size() << "tests.";
28+ QVERIFY2(list.size(), qPrintable(dir.absolutePath()));
29
30 for (int i = 0; i < list.size(); ++i) {
31 QFileInfo fileInfo = list.at(i);
32@@ -52,8 +53,6 @@
33 void benchmark_creation_components() {
34 QFETCH(QString, fileName);
35
36- qDebug() << "Loading" << fileName;
37-
38 QQmlComponent component(&engine, fileName);
39 QObject *obj = component.create();
40 obj->deleteLater();
41@@ -67,7 +66,8 @@
42 QTest::addColumn<QString>("fileName");
43
44 QDir dir;
45- dir.setPath(QString(UBUNTU_COMPONENT_PATH)+"/ListItems");
46+ dir.setPath(QString("%1/ListItems/%2.%3").arg(UBUNTU_COMPONENT_PATH).arg(MAJOR_VERSION(LATEST_UITK_VERSION)).arg(MINOR_VERSION(LATEST_UITK_VERSION)));
47+ QVERIFY2(dir.exists(), qPrintable(dir.absolutePath()));
48 QStringList nameFilters;
49 nameFilters << "*.qml";
50 dir.setNameFilters(nameFilters);
51@@ -75,8 +75,7 @@
52 dir.setSorting(QDir::Size | QDir::Reversed);
53
54 QFileInfoList list = dir.entryInfoList();
55-
56- qDebug() << "Found" << list.size() << "tests.";
57+ QVERIFY2(list.size(), qPrintable(dir.absolutePath()));
58
59 for (int i = 0; i < list.size(); ++i) {
60 QFileInfo fileInfo = list.at(i);
61@@ -87,8 +86,6 @@
62 void benchmark_creation_listitems() {
63 QFETCH(QString, fileName);
64
65- qDebug() << "Loading" << fileName;
66-
67 QQmlComponent component(&engine, fileName);
68 QObject *obj = component.create();
69 obj->deleteLater();

Subscribers

People subscribed via source and target branches