on xenial help sign in
Make tst_PreviewListView and tst_GenericScopeView work in out-of-source builds

Approved by: Albert Astals Cid

commit6141dcc740c5c27adafbcdd7b0fd34929351801e authorDaniel d'Andrada <daniel.dandrada@canonical.com> dateThu 9 Apr 2015, 13:59 (12 years ago) parente11f9d8b4064d1
2 files changed+5−3
tests/mocks/Unity/fake_scope.cpp+4−2 tests/qmltests/Dash/tst_PreviewListView.qml+1−1
tests/mocks/Unity/fake_scope.cpp+4−2
@@ -24,6 +24,8 @@
2424#include "fake_scopes.h"
2525#include "fake_settingsmodel.h"
2626
27+#include <paths.h> // from unity8/include
28+
2729Scope::Scope(Scopes* parent) : Scope("MockScope5", "Mock Scope", false, parent)
2830{
2931}
@@ -249,11 +251,11 @@ QVariantMap Scope::customizations() const
249251 m["foreground-color"] = "blue";
250252 m["page-header"] = h;
251253 } else if (m_id == "MockScope4") {
252− h["navigation-background"] = QUrl("../../../tests/qmltests/Dash/artwork/background.png");
254+ h["navigation-background"] = QUrl(sourceDirectory() + "tests/qmltests/Dash/artwork/background.png");
253255 m["page-header"] = h;
254256 } else if (m_id == "MockScope5") {
255257 h["background"] = "gradient:///lightgrey/grey";
256− h["logo"] = QUrl("../../../tests/qmltests/Dash/tst_PageHeader/logo-ubuntu-orange.svg");
258+ h["logo"] = QUrl(sourceDirectory() + "tests/qmltests/Dash/tst_PageHeader/logo-ubuntu-orange.svg");
257259 h["divider-color"] = "red";
258260 h["navigation-background"] = "color:///black";
259261 m["page-header"] = h;
tests/qmltests/Dash/tst_PreviewListView.qml+1−1
@@ -109,7 +109,7 @@ Rectangle {
109109
110110 var image = findChild(header, "titleImage");
111111 verify(image, "Could not find the title image.");
112− compare(image.source, Qt.resolvedUrl("../Dash/tst_PageHeader/logo-ubuntu-orange.svg"), "Title image has the wrong source");
112+ compare(image.source, Qt.resolvedUrl("tst_PageHeader/logo-ubuntu-orange.svg"), "Title image has the wrong source");
113113 }
114114 }
115115}