on xenial help sign in
Do not hardcode Dash plugin path in tests
560941bMichał Sawicz
tests/plugins/Dash/CMakeLists.txt−1
@@ -23,7 +23,6 @@ include_directories(
23remove_definitions(-DQT_NO_KEYWORDS)
23remove_definitions(-DQT_NO_KEYWORDS)
24
24
25add_definitions(-DDASHVIEWSTEST_FOLDER="${CMAKE_CURRENT_SOURCE_DIR}")
25add_definitions(-DDASHVIEWSTEST_FOLDER="${CMAKE_CURRENT_SOURCE_DIR}")
26−add_definitions(-DBUILT_PLUGINS_DIR="${CMAKE_BINARY_DIR}/plugins")
27
26
28macro(add_lvwph_test FILENAME TESTNAME)
27macro(add_lvwph_test FILENAME TESTNAME)
29 add_executable(${TESTNAME}TestExec
28 add_executable(${TESTNAME}TestExec
tests/plugins/Dash/cardcreatortest.cpp−1
@@ -35,7 +35,6 @@ private Q_SLOTS:
35 void init()
35 void init()
36 {
36 {
37 view = new QQuickView();
37 view = new QQuickView();
38− view->engine()->addImportPath(BUILT_PLUGINS_DIR);
39 view->setSource(QUrl::fromLocalFile(DASHVIEWSTEST_FOLDER "/cardcreatortest.qml"));
38 view->setSource(QUrl::fromLocalFile(DASHVIEWSTEST_FOLDER "/cardcreatortest.qml"));
40 view->show();
39 view->show();
41 QTest::qWaitForWindowExposed(view);
40 QTest::qWaitForWindowExposed(view);
tests/plugins/Dash/horizontaljournaltest.cpp−1
@@ -123,7 +123,6 @@ private Q_SLOTS:
123 {
123 {
124 view = new QQuickView();
124 view = new QQuickView();
125 view->setResizeMode(QQuickView::SizeRootObjectToView);
125 view->setResizeMode(QQuickView::SizeRootObjectToView);
126− view->engine()->addImportPath(BUILT_PLUGINS_DIR);
127
126
128 model = new WidthModel();
127 model = new WidthModel();
129 QStringList widthList;
128 QStringList widthList;
tests/plugins/Dash/horizontaljournaltry.cpp−1
@@ -63,7 +63,6 @@ int main(int argc, char *argv[])
63
63
64 QQuickView *view = new QQuickView();
64 QQuickView *view = new QQuickView();
65 view->setResizeMode(QQuickView::SizeRootObjectToView);
65 view->setResizeMode(QQuickView::SizeRootObjectToView);
66− view->engine()->addImportPath(BUILT_PLUGINS_DIR);
67
66
68 QWidthModela model;
67 QWidthModela model;
69 QStringList heightList;
68 QStringList heightList;
tests/plugins/Dash/listviewwithpageheadersectionexternalmodeltest.cpp−1
@@ -168,7 +168,6 @@ private Q_SLOTS:
168 void init()
168 void init()
169 {
169 {
170 view = new QQuickView();
170 view = new QQuickView();
171− view->engine()->addImportPath(BUILT_PLUGINS_DIR);
172 view->setSource(QUrl::fromLocalFile(DASHVIEWSTEST_FOLDER "/listviewwithpageheadertestsectionexternalmodel.qml"));
171 view->setSource(QUrl::fromLocalFile(DASHVIEWSTEST_FOLDER "/listviewwithpageheadertestsectionexternalmodel.qml"));
173 lvwph = dynamic_cast<ListViewWithPageHeader*>(view->rootObject()->findChild<QQuickFlickable*>());
172 lvwph = dynamic_cast<ListViewWithPageHeader*>(view->rootObject()->findChild<QQuickFlickable*>());
174 QVERIFY(lvwph);
173 QVERIFY(lvwph);
tests/plugins/Dash/listviewwithpageheadersectiontest.cpp−1
@@ -133,7 +133,6 @@ private Q_SLOTS:
133 void init()
133 void init()
134 {
134 {
135 view = new QQuickView();
135 view = new QQuickView();
136− view->engine()->addImportPath(BUILT_PLUGINS_DIR);
137 view->setSource(QUrl::fromLocalFile(DASHVIEWSTEST_FOLDER "/listviewwithpageheadertestsection.qml"));
136 view->setSource(QUrl::fromLocalFile(DASHVIEWSTEST_FOLDER "/listviewwithpageheadertestsection.qml"));
138 lvwph = dynamic_cast<ListViewWithPageHeader*>(view->rootObject()->findChild<QQuickFlickable*>());
137 lvwph = dynamic_cast<ListViewWithPageHeader*>(view->rootObject()->findChild<QQuickFlickable*>());
139 model = view->rootObject()->findChild<QQmlListModel*>();
138 model = view->rootObject()->findChild<QQmlListModel*>();
tests/plugins/Dash/listviewwithpageheadertest.cpp−1
@@ -119,7 +119,6 @@ private Q_SLOTS:
119 void init()
119 void init()
120 {
120 {
121 view = new QQuickView();
121 view = new QQuickView();
122− view->engine()->addImportPath(BUILT_PLUGINS_DIR);
123 view->setSource(QUrl::fromLocalFile(DASHVIEWSTEST_FOLDER "/listviewwithpageheadertest.qml"));
122 view->setSource(QUrl::fromLocalFile(DASHVIEWSTEST_FOLDER "/listviewwithpageheadertest.qml"));
124 lvwph = dynamic_cast<ListViewWithPageHeader*>(view->rootObject()->findChild<QQuickFlickable*>());
123 lvwph = dynamic_cast<ListViewWithPageHeader*>(view->rootObject()->findChild<QQuickFlickable*>());
125 model = view->rootObject()->findChild<QQmlListModel*>();
124 model = view->rootObject()->findChild<QQmlListModel*>();
tests/plugins/Dash/organicgridtest.cpp−1
@@ -126,7 +126,6 @@ private Q_SLOTS:
126 {
126 {
127 view = new QQuickView();
127 view = new QQuickView();
128 view->setResizeMode(QQuickView::SizeRootObjectToView);
128 view->setResizeMode(QQuickView::SizeRootObjectToView);
129− view->engine()->addImportPath(BUILT_PLUGINS_DIR);
130
129
131 model = new DummyModel();
130 model = new DummyModel();
132 model->setCount(21);
131 model->setCount(21);
tests/plugins/Dash/organicgridtry.cpp−1
@@ -73,7 +73,6 @@ int main(int argc, char *argv[])
73
73
74 QQuickView *view = new QQuickView();
74 QQuickView *view = new QQuickView();
75 view->setResizeMode(QQuickView::SizeRootObjectToView);
75 view->setResizeMode(QQuickView::SizeRootObjectToView);
76− view->engine()->addImportPath(BUILT_PLUGINS_DIR);
77
76
78 DummyModel model;
77 DummyModel model;
79 model.setCount(3);
78 model.setCount(3);
tests/plugins/Dash/verticaljournaltest.cpp−1
@@ -125,7 +125,6 @@ private Q_SLOTS:
125 {
125 {
126 view = new QQuickView();
126 view = new QQuickView();
127 view->setResizeMode(QQuickView::SizeRootObjectToView);
127 view->setResizeMode(QQuickView::SizeRootObjectToView);
128− view->engine()->addImportPath(BUILT_PLUGINS_DIR);
129
128
130 model = new HeightModel();
129 model = new HeightModel();
131 QStringList heightList;
130 QStringList heightList;
tests/plugins/Dash/verticaljournaltry.cpp−1
@@ -63,7 +63,6 @@ int main(int argc, char *argv[])
63
63
64 QQuickView *view = new QQuickView();
64 QQuickView *view = new QQuickView();
65 view->setResizeMode(QQuickView::SizeRootObjectToView);
65 view->setResizeMode(QQuickView::SizeRootObjectToView);
66− view->engine()->addImportPath(BUILT_PLUGINS_DIR);
67
66
68 QHeightModel model;
67 QHeightModel model;
69 QStringList heightList;
68 QStringList heightList;