on xenial help sign in
Make tst_PreviewListView and tst_GenericScopeView work in out-of-source builds
6141dccDaniel d'Andrada
tests/mocks/Unity/fake_scope.cpp+4−2
@@ -24,6 +24,8 @@
24#include "fake_scopes.h"
24#include "fake_scopes.h"
25#include "fake_settingsmodel.h"
25#include "fake_settingsmodel.h"
26
26
27+#include <paths.h> // from unity8/include
28+
27Scope::Scope(Scopes* parent) : Scope("MockScope5", "Mock Scope", false, parent)
29Scope::Scope(Scopes* parent) : Scope("MockScope5", "Mock Scope", false, parent)
28{
30{
29}
31}
@@ -249,11 +251,11 @@ QVariantMap Scope::customizations() const
249 m["foreground-color"] = "blue";
251 m["foreground-color"] = "blue";
250 m["page-header"] = h;
252 m["page-header"] = h;
251 } else if (m_id == "MockScope4") {
253 } 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");
253 m["page-header"] = h;
255 m["page-header"] = h;
254 } else if (m_id == "MockScope5") {
256 } else if (m_id == "MockScope5") {
255 h["background"] = "gradient:///lightgrey/grey";
257 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");
257 h["divider-color"] = "red";
259 h["divider-color"] = "red";
258 h["navigation-background"] = "color:///black";
260 h["navigation-background"] = "color:///black";
259 m["page-header"] = h;
261 m["page-header"] = h;
tests/qmltests/Dash/tst_PreviewListView.qml+1−1
@@ -109,7 +109,7 @@ Rectangle {
109
109
110 var image = findChild(header, "titleImage");
110 var image = findChild(header, "titleImage");
111 verify(image, "Could not find the title image.");
111 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");
113 }
113 }
114 }
114 }
115}
115}