on xenial help sign in
More test fixes
commitd181cb288b30b1374aa9a7a8eec2b8745858d12c authorMichael Terry <michael.terry@canonical.com> dateThu 21 Apr 2016, 12:42 (10 years ago) parent581f8c9
9 files changed+39−34
cmake/modules/QmlTest.cmake+2−2 tests/CMakeLists.txt+1−1 tests/graphics/screenshots/gallery@12.png tests/plugins/Ubuntu/Gestures/tst_TouchGate.cpp+3−1 tests/plugins/Unity/Session/CMakeLists.txt+3 tests/qmltests/Components/tst_ZoomableImage.qml+1−1 tests/qmltests/Dash/Previews/tst_PreviewImageGallery.qml+13−13 tests/qmltests/Notifications/tst_Notifications.qml+11−11 tests/qmltests/Notifications/tst_SwipeToAct.qml+5−5
cmake/modules/QmlTest.cmake+2−2
@@ -83,7 +83,7 @@ function(add_qml_test_data PATH COMPONENT_NAME)
8383
8484 if ("${filename}" MATCHES "\\.qml$")
8585 file(READ "${filename}" contents)
86− string(REGEX REPLACE "(\"[./]*/)qml/" "\\1" contents "${contents}")
86+ string(REGEX REPLACE "(\"[./]*)/qml(/|\")" "\\1\\2" contents "${contents}")
8787 set(filename "${CMAKE_CURRENT_BINARY_DIR}/${PATH}/${COMPONENT_NAME}")
8888 file(WRITE "${filename}" "${contents}")
8989 endif()
@@ -316,7 +316,7 @@ function(add_test_target TARGET_NAME)
316316 # END OF CODE BLOCK --------------------------------------------------
317317
318318 install(FILES "${filename}"
319− PERMISSIONS OWNER_EXECUTE OWNER_READ
319+ PERMISSIONS OWNER_EXECUTE OWNER_READ OWNER_WRITE
320320 GROUP_EXECUTE GROUP_READ
321321 WORLD_EXECUTE WORLD_READ
322322 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/scripts"
tests/CMakeLists.txt+1−1
@@ -132,7 +132,7 @@ function(add_unity8_qmltest_data PATH COMPONENT_NAME)
132132endfunction()
133133
134134
135−install(DIRECTORY graphics
135+install(DIRECTORY data graphics
136136 DESTINATION "${SHELL_APP_DIR}/tests"
137137)
138138
tests/graphics/screenshots/gallery@12.pngnew file

Binary file not shown.

tests/plugins/Ubuntu/Gestures/tst_TouchGate.cpp+3−1
@@ -29,6 +29,8 @@
2929
3030#include "TestItem.h"
3131
32+#include <paths.h>
33+
3234class CandidateItem : public QQuickItem
3335{
3436 Q_OBJECT
@@ -96,7 +98,7 @@ void tst_TouchGate::init()
9698 touchRegistry = TouchRegistry::instance();
9799
98100 view = createView();
99− view->setSource(QUrl::fromLocalFile("touchGateExample.qml"));
101+ view->setSource(QUrl::fromLocalFile(testLibDir() + "/plugins/Ubuntu/Gestures/touchGateExample.qml"));
100102 view->show();
101103 QVERIFY(QTest::qWaitForWindowExposed(view));
102104 QVERIFY(view->rootObject() != 0);
tests/plugins/Unity/Session/CMakeLists.txt+3
@@ -17,6 +17,9 @@ target_link_libraries(sessionbackendtestExec
1717 unity8-private
1818 )
1919qt5_use_modules(sessionbackendtestExec Test Core Qml DBus)
20+install(TARGETS sessionbackendtestExec
21+ DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Unity/Session"
22+)
2023
2124add_unity8_unittest(SessionBackend dbus-test-runner
2225 ARG_PREFIX "--parameter"
tests/qmltests/Components/tst_ZoomableImage.qml+1−1
@@ -36,7 +36,7 @@ Rectangle {
3636 }
3737
3838 property var widgetData2: {
39− "source": "../../mocks/Unity/Application/resources/screenshots/gallery@12.png",
39+ "source": Qt.resolvedUrl("../../graphics/screenshots/gallery@12.png"),
4040 "zoomable": true
4141 }
4242
tests/qmltests/Dash/Previews/tst_PreviewImageGallery.qml+13−13
@@ -31,31 +31,31 @@ Rectangle {
3131
3232 property var sourcesModel1: {
3333 "sources": [
34− "../../graphics/phone_background.jpg",
35− "../../graphics/tablet_background.jpg",
36− "../../../tests/graphics/clock@18.png",
37− "../../graphics/borked"
34+ Qt.resolvedUrl("../../../../graphics/phone_background.jpg"),
35+ Qt.resolvedUrl("../../../../graphics/tablet_background.jpg"),
36+ Qt.resolvedUrl("../../../graphics/clock@18.png"),
37+ Qt.resolvedUrl("../../../../graphics/borked")
3838 ]
3939 }
4040
4141 property var sourcesModel1WithFallback: {
4242 "sources": [
43− "../../graphics/phone_background.jpg",
44− "../../graphics/tablet_background.jpg",
45− "../../../tests/graphics/clock@18.png",
46− "../../graphics/borked"
43+ Qt.resolvedUrl("../../../../graphics/phone_background.jpg"),
44+ Qt.resolvedUrl("../../../../graphics/tablet_background.jpg"),
45+ Qt.resolvedUrl("../../../graphics/clock@18.png"),
46+ Qt.resolvedUrl("../../../../graphics/borked")
4747 ]
48− , "fallback": "../../../tests/graphics/clock@18.png"
48+ , "fallback": Qt.resolvedUrl("../../../graphics/clock@18.png")
4949 }
5050
5151 property var sourcesModelEmptyWithFallback: {
5252 "sources": [
53− "../../graphics/phone_background.jpg",
54− "../../graphics/tablet_background.jpg",
55− "../../../tests/graphics/clock@18.png",
53+ Qt.resolvedUrl("../../../../graphics/phone_background.jpg"),
54+ Qt.resolvedUrl("../../../../graphics/tablet_background.jpg"),
55+ Qt.resolvedUrl("../../../graphics/clock@18.png"),
5656 ""
5757 ]
58− , "fallback": "../../../tests/graphics/clock@18.png"
58+ , "fallback": Qt.resolvedUrl("../../../graphics/clock@18.png")
5959 }
6060
6161 PreviewImageGallery {
tests/qmltests/Notifications/tst_Notifications.qml+11−11
@@ -76,8 +76,8 @@ Item {
7676 "hints": {},
7777 "summary": "Cole Raby",
7878 "body": "I did not expect it to be <b>that</b> late.",
79− "icon": "../../tests/graphics/avatars/amanda.png",
80− "secondaryIcon": "../../tests/graphics/applicationIcons/facebook.png",
79+ "icon": Qt.resolvedUrl("../../graphics/avatars/amanda.png"),
80+ "secondaryIcon": Qt.resolvedUrl("../../graphics/applicationIcons/facebook.png"),
8181 "rawActions": ["reply_id", "Dummy"]})
8282 n.completed.connect(mockModel.onCompleted)
8383 mockModel.append(n)
@@ -90,7 +90,7 @@ Item {
9090 "hints": {"x-canonical-non-shaped-icon": "true"},
9191 "summary": "Contacts",
9292 "body": "Synchronised contacts-database &amp; cloud-storage.",
93− "icon": "../../tests/graphics/applicationIcons/contacts-app.png",
93+ "icon": Qt.resolvedUrl("../../graphics/applicationIcons/contacts-app.png"),
9494 "secondaryIcon": "",
9595 "rawActions": ["reply_id", "Dummy"]})
9696 n.completed.connect(mockModel.onCompleted)
@@ -104,7 +104,7 @@ Item {
104104 "hints": {"x-canonical-non-shaped-icon": "false"},
105105 "summary": "Photo upload completed",
106106 "body": "",
107− "icon": "../../tests/graphics/applicationIcons/facebook.png",
107+ "icon": Qt.resolvedUrl("../../graphics/applicationIcons/facebook.png"),
108108 "secondaryIcon": "",
109109 "rawActions": ["reply_id", "Dummy"]})
110110 n.completed.connect(mockModel.onCompleted)
@@ -118,7 +118,7 @@ Item {
118118 "hints": {},
119119 "summary": "Interactive notification",
120120 "body": "This is a notification that can be clicked",
121− "icon": "../../tests/graphics/avatars/anna_olsson.png",
121+ "icon": Qt.resolvedUrl("../../graphics/avatars/anna_olsson.png"),
122122 "secondaryIcon": "",
123123 "rawActions": ["reply_id", "Dummy"]})
124124 n.completed.connect(mockModel.onCompleted)
@@ -293,7 +293,7 @@ Item {
293293 type: Notification.Ephemeral
294294 summary: "Photo upload completed"
295295 body: ""
296− icon: "../../tests/graphics/applicationIcons/facebook.png"
296+ icon: Qt.resolvedUrl("../../graphics/applicationIcons/facebook.png")
297297 secondaryIcon: ""
298298 value: 0
299299 rawActions: []
@@ -307,7 +307,7 @@ Item {
307307 summary: "New comment successfully published"
308308 body: ""
309309 icon: ""
310− secondaryIcon: "../../tests/graphics/applicationIcons/facebook.png"
310+ secondaryIcon: Qt.resolvedUrl("../../graphics/applicationIcons/facebook.png")
311311 value: 0
312312 rawActions: []
313313 },
@@ -318,7 +318,7 @@ Item {
318318 "sound-file": "dummy.ogg"}
319319 summary: "Interactive notification"
320320 body: "This is a notification that can be clicked"
321− icon: "../../tests/graphics/avatars/amanda.png"
321+ icon: Qt.resolvedUrl("../../graphics/avatars/amanda.png")
322322 secondaryIcon: ""
323323 value: 0
324324 rawActions: ["reply_id", "Dummy"]
@@ -330,7 +330,7 @@ Item {
330330 "sound-file": "dummy.ogg"}
331331 summary: "Bro Coly"
332332 body: "At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet."
333− icon: "../../tests/graphics/avatars/anna_olsson.png"
333+ icon: Qt.resolvedUrl("../../graphics/avatars/anna_olsson.png")
334334 secondaryIcon: ""
335335 value: 0
336336 rawActions: ["accept_id", "Accept",
@@ -343,8 +343,8 @@ Item {
343343 "sound-file": "dummy.ogg"}
344344 summary: "Cole Raby"
345345 body: "I did not expect it to be that late."
346− icon: "../../tests/graphics/avatars/funky.png"
347− secondaryIcon: "../../tests/graphics/applicationIcons/facebook.png"
346+ icon: Qt.resolvedUrl("../../graphics/avatars/funky.png")
347+ secondaryIcon: Qt.resolvedUrl("../../graphics/applicationIcons/facebook.png")
348348 value: 0
349349 rawActions: []
350350 },
tests/qmltests/Notifications/tst_SwipeToAct.qml+5−5
@@ -72,7 +72,7 @@ Item {
7272 hints: {"x-canonical-snap-decisions-swipe": "true"},
7373 summary: "Incoming call",
7474 body: "Frank Zappa\n+44 (0)7736 027340",
75− icon: "../../tests/graphics/avatars/amanda.png",
75+ icon: Qt.resolvedUrl("../../graphics/avatars/amanda.png"),
7676 secondaryIcon: "incoming-call",
7777 actions: [{ id: "ok_id", label: "Ok"},
7878 { id: "cancel_id", label: "Cancel"},
@@ -182,8 +182,8 @@ Item {
182182 hints: {"x-canonical-snap-decisions-swipe": "true"},
183183 summary: "Incoming call",
184184 body: "Frank Zappa\n+44 (0)7736 027340",
185− icon: "../../tests/graphics/avatars/amanda.png",
186− secondaryIcon: "../../tests/graphics/applicationIcons/facebook.png",
185+ icon: Qt.resolvedUrl("../../graphics/avatars/amanda.png"),
186+ secondaryIcon: Qt.resolvedUrl("../../graphics/applicationIcons/facebook.png"),
187187 actions: myActionModel,
188188 summaryVisible: true,
189189 bodyVisible: true,
@@ -201,8 +201,8 @@ Item {
201201 hints: {"x-canonical-snap-decisions-swipe": "true"},
202202 summary: "Incoming call",
203203 body: "Bro Coly\n+49 (0)221 426973",
204− icon: "../../tests/graphics/avatars/funky.png",
205− secondaryIcon: "../../tests/graphics/applicationIcons/facebook.png",
204+ icon: Qt.resolvedUrl("../../graphics/avatars/funky.png"),
205+ secondaryIcon: Qt.resolvedUrl("../../graphics/applicationIcons/facebook.png"),
206206 actions: myActionModel,
207207 summaryVisible: true,
208208 bodyVisible: true,