on xenial help sign in
* Refactor QmlTest.cmake module so that all tests can go through it.

Also a bit of cleanup around tests. * Support fallback images for dash card and preview widgets (LP: #1324142) * Resync trunk. [ Daniel d'Andrada ] * Fix Shell tests * Refactor greeter emulator to unlock the greeter via dbus [ Lukáš Tinkl ] * respect target window's devicePixelRatio in MouseTouchAdaptor [ Michael Zanetti ] * Refactor QmlTest.cmake module so that all tests can go through it. Also a bit of cleanup around tests. [ Michał Sawicz ] * Refactor QmlTest.cmake module so that all tests can go through it. Also a bit of cleanup around tests. [ handsome_feng ] * Forbid closing apps during the edge gesture. (LP: #1445572) * Removed the horizonal rule on pin unlock screen. (LP: #1368798) [ handsome_feng<445865575@qq.com> ] * Forbid closing apps during the edge gesture. (LP: #1445572)

commit5c2db7cd6a927f2ff0eb9047402a31989961d9cb authorLukáš Tinkl <lukas.tinkl@canonical.com> dateTue 23 Jun 2015, 05:01 (11 years ago) parentf6e153fb03a9da
57 files changed+923−640
CMakeLists.txt+9 cmake/modules/QmlPlugins.cmake+1−3 cmake/modules/QmlTest.cmake+285−191 debian/changelog+24−31 plugins/Dash/CardCreator.js+8 plugins/Wizard/PageList.cpp+1−1 qml/Components/PinLockscreen.qml+1−5 qml/Components/ZoomableImage.qml+1 qml/Dash/Previews/PreviewHeader.qml+6 qml/Dash/Previews/PreviewImageGallery.qml+14 qml/Dash/Previews/PreviewZoomableImage.qml+13 qml/Stages/PhoneStage.qml+7 qml/Stages/TabletStage.qml+6 runtests.sh+1−1 src/MouseTouchAdaptor.cpp+6−6 tests/CMakeLists.txt+120−8 tests/autopilot/unity8/application_lifecycle/tests/__init__.py+2−2 tests/autopilot/unity8/greeter/__init__.py+52 tests/autopilot/unity8/indicators/tests/__init__.py+1−1 tests/autopilot/unity8/process_helpers.py+7−94 tests/autopilot/unity8/shell/tests/test_emulators.py+2−2 tests/autopilot/unity8/shell/tests/test_notifications.py+22−22 tests/copyright/CMakeLists.txt+1−1 tests/libs/UbuntuGestures/CMakeLists.txt+4−8 tests/plugins/AccountsService/CMakeLists.txt+5−4 tests/plugins/Dash/CMakeLists.txt+10−17 tests/plugins/Greeter/Unity/Launcher/CMakeLists.txt+4−5 tests/plugins/LightDM/CMakeLists.txt+13−4 tests/plugins/Ubuntu/Gestures/CMakeLists.txt+22−24 tests/plugins/Unity/Indicators/CMakeLists.txt+9−12 tests/plugins/Unity/Indicators/indicatorsmanagertest.cpp → tests/plugins/Unity/Indicators/IndicatorsManagerTest.cpp+1−1 tests/plugins/Unity/Indicators/indicatorsmodeltest.cpp → tests/plugins/Unity/Indicators/IndicatorsModelTest.cpp+1−1 tests/plugins/Unity/Indicators/menucontentactivatortest.cpp → tests/plugins/Unity/Indicators/MenuContentActivatorTest.cpp+1−1 tests/plugins/Unity/Indicators/rootactionstatetest.cpp → tests/plugins/Unity/Indicators/RootActionStateTest.cpp+1−1 tests/plugins/Unity/Indicators/sharedunitymenumodeltest.cpp → tests/plugins/Unity/Indicators/SharedUnityMenuModelTest.cpp+1−1 tests/plugins/Unity/Indicators/unitymenumodelstacktest.cpp → tests/plugins/Unity/Indicators/UnityMenuModelStackTest.cpp+1−1 tests/plugins/Unity/Launcher/CMakeLists.txt+5−5 tests/plugins/Unity/Session/CMakeLists.txt+5−5 tests/plugins/Utils/CMakeLists.txt+12−26 tests/plugins/Utils/homekeywatchertest.cpp → tests/plugins/Utils/HomeKeyWatcherTest.cpp+1−1 tests/plugins/Utils/modeltest.cpp → tests/plugins/Utils/ModelTest.cpp+1−1 tests/plugins/Utils/modeltest.h → tests/plugins/Utils/ModelTest.h tests/plugins/Utils/qlimitproxymodeltest.cpp → tests/plugins/Utils/QLimitProxyModelTest.cpp+2−2 tests/plugins/Utils/timeformattertest.cpp → tests/plugins/Utils/TimeFormatterTest.cpp+1−11 tests/plugins/Utils/unitysortfilterproxymodeltest.cpp → tests/plugins/Utils/UnitySortFilterProxyModelTest.cpp+2−2 tests/plugins/Wizard/CMakeLists.txt+2−2 tests/qmltests/CMakeLists.txt+77−94 tests/qmltests/Components/CMakeLists.txt+4−10 tests/qmltests/Dash/Previews/tst_PreviewHeader.qml+30 tests/qmltests/Dash/Previews/tst_PreviewImageGallery.qml+21−1 tests/qmltests/Dash/Previews/tst_PreviewZoomableImage.qml+27−6 tests/qmltests/Dash/tst_Card.qml+30 tests/qmltests/Stages/tst_PhoneStage.qml+19 tests/qmltests/Stages/tst_WindowMoveResizeArea.qml+1 tests/qmltests/tst_Shell.qml+14−17 tests/qmltests/utils/Unity/Test/tst_UnityTest.qml+5−8 tests/whitespace/CMakeLists.txt+1−1
CMakeLists.txt+9
@@ -116,6 +116,14 @@ include_directories(
116116 ${APPLICATION_API_INCLUDE_DIRS}
117117)
118118
119+set(ARTIFACTS_DIR "" CACHE PATH "Store test artifacts in this directory.")
120+
121+# Quiet logger
122+set(QUIET_LOGGER OFF CACHE BOOL "Disable test output on stdout.")
123+if(NOT QUIET_LOGGER)
124+ set(STDOUT_LOGGER "-o" "-,txt")
125+endif()
126+
119127# add subdirectories to build
120128add_subdirectory(include)
121129add_subdirectory(libs)
@@ -124,6 +132,7 @@ add_subdirectory(tools)
124132add_subdirectory(qml)
125133
126134# Tests
135+set(NO_TESTS OFF CACHE BOOL "Disable tests.")
127136if (NOT NO_TESTS)
128137 include(CTest)
129138 enable_testing()
cmake/modules/QmlPlugins.cmake+1−3
@@ -107,8 +107,6 @@ macro(export_qmlplugin PLUGIN VERSION PATH)
107107 set(multi TARGETS)
108108 cmake_parse_arguments(QMLPLUGIN "${options}" "${single}" "${multi}" ${ARGN})
109109
110− get_target_property(qmlplugindump_executable qmlplugindump LOCATION)
111−
112110 if(QMLPLUGIN_BINARY_DIR)
113111 set(qmlplugin_dir ${QMLPLUGIN_BINARY_DIR}/${PATH})
114112 else()
@@ -127,7 +125,7 @@ macro(export_qmlplugin PLUGIN VERSION PATH)
127125 set(qmltypes_path ${CMAKE_CURRENT_SOURCE_DIR}/${plugin_suffix}.qmltypes)
128126
129127 add_custom_target(${target_prefix}-qmltypes
130− COMMAND env ${QMLPLUGIN_ENVIRONMENT} ${qmlplugindump_executable} -notrelocatable
128+ COMMAND env ${QMLPLUGIN_ENVIRONMENT} $<TARGET_FILE:qmlplugindump> -notrelocatable
131129 ${PLUGIN} ${VERSION} ${QMLPLUGIN_MODULE_DIR} > ${qmltypes_path}
132130 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
133131 )
cmake/modules/QmlTest.cmake+285−191
@@ -1,218 +1,312 @@
1−# add_qml_test(path component_name [NO_ADD_TEST] [NO_TARGETS]
2−# [TARGETS target1 [target2 [...]]]
3−# [IMPORT_PATHS import_path1 [import_path2 [...]]
4−# [PROPERTIES prop1 value1 [prop2 value2 [...]]])
1+# If you need to override the qmlscene or qmltestrunner executables,
2+# create the corresponding executable target.
3+
4+# These functions respect the global STDOUT_LOGGER and ARTIFACTS_DIR variables.
5+
6+# You can use those with cmake_parse_arguments
7+# if you need to wrap and mangle arguments.
8+set(QMLTEST_OPTIONS ADD_TEST CACHE INTERNAL "")
9+set(QMLTEST_SINGLE ITERATIONS ARG_PREFIX CACHE INTERNAL "")
10+set(QMLTEST_MULTI ARGS ENVIRONMENT DEPENDS IMPORT_PATHS TARGETS CACHE INTERNAL "")
11+
12+# import_executables(name1 [name2 [...]]
13+# [OPTIONAL] # continue when not found
14+# )
515#
6−# NO_ADD_TEST will prevent adding the test to the "test" target
7−# NO_TARGETS will prevent adding the test to any targets
8−# TARGETS lists the targets the test should be added to
9−# IMPORT_PATHS will pass those paths to qmltestrunner as "-import" arguments
10−# PROPERTIES will be set on the target and test target. See CMake's set_target_properties()
16+# This will find the named executables and import them
17+# to an imported target of the same name.
18+
19+function(import_executables)
20+ cmake_parse_arguments(QMLTEST "OPTIONAL" "" "" ${ARGN})
21+
22+ foreach(NAME ${QMLTEST_UNPARSED_ARGUMENTS})
23+ if(NOT TARGET ${NAME})
24+ add_executable(${NAME} IMPORTED GLOBAL)
25+ find_program(${NAME}_exe ${NAME})
26+
27+ if(NOT QMLTEST_OPTIONAL AND NOT ${NAME}_exe)
28+ message(FATAL_ERROR "Could not locate ${NAME}.")
29+ elseif(NOT ${NAME}_exe)
30+ message(STATUS "Could not locate ${NAME}, skipping.")
31+ else()
32+ set_target_properties(${NAME} PROPERTIES IMPORTED_LOCATION ${${NAME}_exe})
33+ endif()
34+ endif()
35+ endforeach()
36+endfunction()
37+
38+
39+# add_qml_test(path component_name
40+# [...]
41+# )
1142#
12−# Two targets will be created:
13−# - testComponentName - Runs the test with qmltestrunner
14−# - tryComponentName - Runs the test with uqmlscene, for manual interaction
15−# - gdbtestComponentName - Runs the test with qmltestrunner under gdb
43+# Add test targets for ${component_name} under ${path}. It's assumed
44+# that the test file is named ${path}/tst_${component_name}.qml.
45+#
46+# This function wraps add_manual_qml_test and add_qml_unittest,
47+# see below for available arguments.
48+
49+function(add_qml_test PATH COMPONENT_NAME)
50+ cmake_parse_arguments(QMLTEST "${QMLTEST_OPTIONS}" "${QMLTEST_SINGLE}" "${QMLTEST_MULTI}" ${ARGN})
51+ mangle_arguments()
52+
53+ add_qml_unittest(${ARGV})
54+ add_manual_qml_test(${ARGV})
55+endfunction()
56+
57+
58+# add_qml_unittest(path component_name
59+# [...]
60+# )
61+#
62+# Add test targets for ${component_name} under ${path}. It's assumed
63+# that the test file is named ${path}/tst_${component_name}.qml.
64+#
65+# This function wraps add_executable_test, see below for available arguments.
66+
67+function(add_qml_unittest PATH COMPONENT_NAME)
68+ import_executables(qmltestrunner)
69+
70+ add_executable_test(${COMPONENT_NAME} qmltestrunner
71+ ${ARGN}
72+ ARGS -input ${CMAKE_CURRENT_SOURCE_DIR}/${PATH}/tst_${COMPONENT_NAME}.qml ${QMLTEST_ARGS}
73+ )
74+endfunction()
75+
76+
77+# add_manual_qml_test(path component_name
78+# [...]
79+# )
80+#
81+# Add manual test targets for ${component_name} under ${path}. It's assumed
82+# that the test file is named ${path}/tst_${component_name}.qml.
1683#
17−# To change/set a default value for the whole test suite, prior to calling add_qml_test, set:
18−# qmltest_DEFAULT_NO_ADD_TEST (default: FALSE)
19−# qmltest_DEFAULT_TARGETS
20−# qmltest_DEFAULT_IMPORT_PATHS
21−# qmltest_DEFAULT_PROPERTIES
22−
23−find_program(qmltestrunner_exe qmltestrunner)
24−
25−if(NOT qmltestrunner_exe)
26− msg(FATAL_ERROR "Could not locate qmltestrunner.")
27−endif()
28−
29−set(qmlscene_exe ${CMAKE_BINARY_DIR}/tests/uqmlscene/uqmlscene)
30−
31−set(test_env LC_ALL=C UNITY_TESTING=1)
32−
33−macro(add_manual_qml_test SUBPATH COMPONENT_NAME)
34− set(options NO_ADD_TEST NO_TARGETS)
35− set(multi_value_keywords IMPORT_PATHS TARGETS PROPERTIES ENVIRONMENT)
36−
37− cmake_parse_arguments(qmltest "${options}" "" "${multi_value_keywords}" ${ARGN})
38− cmake_parse_arguments(qmltest_default "${options}" "" "${multi_value_keywords}" ${qmltest_DEFAULT_PROPERTIES})
39−
40− set(qmlscene_TARGET try${COMPONENT_NAME})
41− set(qmltest_FILE ${SUBPATH}/tst_${COMPONENT_NAME})
42−
43− set(qmlscene_imports "")
44− if(NOT "${qmltest_IMPORT_PATHS}" STREQUAL "")
45− foreach(IMPORT_PATH ${qmltest_IMPORT_PATHS})
46− list(APPEND qmlscene_imports "-I")
47− list(APPEND qmlscene_imports ${IMPORT_PATH})
48− endforeach(IMPORT_PATH)
49− elseif(NOT "${qmltest_DEFAULT_IMPORT_PATHS}" STREQUAL "")
50− foreach(IMPORT_PATH ${qmltest_DEFAULT_IMPORT_PATHS})
51− list(APPEND qmlscene_imports "-I")
52− list(APPEND qmlscene_imports ${IMPORT_PATH})
53− endforeach(IMPORT_PATH)
84+# This function wraps add_manual_test, see below for available arguments.
85+
86+function(add_manual_qml_test PATH COMPONENT_NAME)
87+ import_executables(qmlscene)
88+ cmake_parse_arguments(QMLTEST "${QMLTEST_OPTIONS}" "${QMLTEST_SINGLE}" "${QMLTEST_MULTI}" ${ARGN})
89+
90+ add_manual_test(${COMPONENT_NAME} qmlscene
91+ ${ARGN}
92+ ARGS ${CMAKE_CURRENT_SOURCE_DIR}/${PATH}/tst_${COMPONENT_NAME}.qml ${QMLTEST_ARGS}
93+ )
94+endfunction()
95+
96+
97+# add_executable_test(target component_name
98+# [...] # see doc for add_manual_qml_test for common arguments
99+# [ADD_TEST] # whether to add to the "test" target
100+# [ARG_PREFIX arg_prefix] # prefix logging arguments with this string
101+# [ARGS] arg1 [arg2 [...]] # pass these arguments to the test executable
102+# [TARGETS target1 [target2 [...]]] # make the listed targets depend on this test
103+# # if a corresponding xvfbtarget1, xvfbtarget2 etc. exists,
104+# # this test running under xvfb will be added as a dependency
105+# # of those targets
106+# [ITERATIONS count] # run this test as a benchmark for ${count} iterations
107+# )
108+#
109+# Logging options in the standard form of "-o filename,format"
110+# will be appended to the arguments list, prefixed with ARG_PREFIX.
111+# XUnitXML files will be stored in current binary dir or under
112+# ARTIFACTS_DIR, if set.
113+#
114+# Three targets will be created:
115+# - test${component_name} - Runs the test
116+# - xvfbtest${component_name} - Runs the test under xvfb
117+# - gdbtest${component_name} - Runs the test under gdb
118+
119+function(add_executable_test COMPONENT_NAME TARGET)
120+ import_executables(gdb xvfb-run OPTIONAL)
121+
122+ cmake_parse_arguments(QMLTEST "${QMLTEST_OPTIONS}" "${QMLTEST_SINGLE}" "${QMLTEST_MULTI}" ${ARGN})
123+ mangle_arguments()
124+
125+ if(ARTIFACTS_DIR)
126+ file(RELATIVE_PATH path ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
127+ file(MAKE_DIRECTORY ${ARTIFACTS_DIR}/${path})
128+ set(file_logger -o ${ARTIFACTS_DIR}/${path}/test${COMPONENT_NAME}.xml,xunitxml)
129+ else()
130+ set(file_logger -o ${CMAKE_CURRENT_BINARY_DIR}/test${COMPONENT_NAME}.xml,xunitxml)
131+ endif()
132+
133+ bake_arguments("${QMLTEST_ARG_PREFIX}" args ${iterations} ${file_logger} ${STDOUT_LOGGER})
134+
135+ set(qmltest_command
136+ $<TARGET_FILE:${TARGET}>
137+ ${QMLTEST_ARGS}
138+ ${args}
139+ )
140+
141+ add_qmltest_target(test${COMPONENT_NAME} ${TARGET}
142+ COMMAND ${qmltest_command}
143+ ${depends}
144+ ENVIRONMENT QML2_IMPORT_PATH=${imports} ${QMLTEST_ENVIRONMENT}
145+ ${add_test}
146+ ${targets}
147+ )
148+
149+ if(TARGET xvfb-run)
150+ add_qmltest_target(xvfbtest${COMPONENT_NAME} ${TARGET}
151+ COMMAND $<TARGET_FILE:xvfb-run> --server-args "-screen 0 1024x768x24" --auto-servernum ${qmltest_command}
152+ ${depends}
153+ ENVIRONMENT QML2_IMPORT_PATH=${imports} ${QMLTEST_ENVIRONMENT} LD_PRELOAD=/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}/mesa/libGL.so.1
154+ TARGETS ${xvfb_targets}
155+ )
54156 endif()
55157
56− if("${qmltest_ENVIRONMENT}" STREQUAL "")
57− set(qmltest_ENVIRONMENT "${qmltest_default_ENVIRONMENT}")
158+ if(TARGET gdb)
159+ add_qmltest_target(gdbtest${COMPONENT_NAME} ${TARGET}
160+ COMMAND $<TARGET_FILE:gdb> -ex run -args ${qmltest_command}
161+ ${depends}
162+ ENVIRONMENT QML2_IMPORT_PATH=${imports} ${QMLTEST_ENVIRONMENT}
163+ )
58164 endif()
165+endfunction()
166+
167+
168+# add_manual_test(target component_name
169+# [DEPENDS target1 [target2 [...]]] # make this test depend on the specified targets
170+# [IMPORT_PATHS import_path1 [import_path2 [...]] # use these QML import paths
171+# # (they're searched first to last)
172+# [ENVIRONMENT var1=value1 [var2=value2 [...]]] # set these environment variables
173+# )
174+#
175+# Two targets will be created:
176+# - try${component_name} - Runs the test for manual interaction
177+# - gdbtry${component_name} - Runs the test under gdb
178+
179+function(add_manual_test COMPONENT_NAME TARGET)
180+ import_executables(gdb OPTIONAL)
181+
182+ cmake_parse_arguments(QMLTEST "${QMLTEST_OPTIONS}" "${QMLTEST_SINGLE}" "${QMLTEST_MULTI}" ${ARGN})
183+ mangle_arguments()
184+
185+ bake_arguments("${QMLTEST_ARG_PREFIX}" args -qmljsdebugger=port:3768)
186+
187+ set(qmltry_command
188+ $<TARGET_FILE:${TARGET}>
189+ ${QMLTEST_ARGS}
190+ ${args}
191+ )
59192
60− set(qmlscene_command
61− env ${test_env} ${qmltest_ENVIRONMENT}
62− ${qmlscene_exe} -qmljsdebugger=port:3768 ${CMAKE_CURRENT_SOURCE_DIR}/${qmltest_FILE}.qml
63− ${qmlscene_imports}
193+ add_qmltest_target(try${COMPONENT_NAME} ${TARGET}
194+ COMMAND ${qmltry_command}
195+ ${depends}
196+ ENVIRONMENT QML2_IMPORT_PATH=${imports} ${QMLTEST_ENVIRONMENT}
64197 )
65− add_custom_target(${qmlscene_TARGET} ${qmlscene_command})
66−
67−endmacro(add_manual_qml_test)
68−
69−macro(add_qml_benchmark SUBPATH COMPONENT_NAME ITERATIONS)
70− add_qml_test_internal(${SUBPATH} ${COMPONENT_NAME} ${ITERATIONS} ${ARGN})
71−endmacro(add_qml_benchmark)
72−
73−macro(add_qml_test SUBPATH COMPONENT_NAME)
74− add_qml_test_internal(${SUBPATH} ${COMPONENT_NAME} 0 ${ARGN})
75−endmacro(add_qml_test)
76−
77−macro(add_qml_test_internal SUBPATH COMPONENT_NAME ITERATIONS)
78− set(options NO_ADD_TEST NO_TARGETS)
79− set(multi_value_keywords IMPORT_PATHS TARGETS PROPERTIES ENVIRONMENT)
80−
81− cmake_parse_arguments(qmltest "${options}" "" "${multi_value_keywords}" ${ARGN})
82− cmake_parse_arguments(qmltest_default "${options}" "" "${multi_value_keywords}" ${qmltest_DEFAULT_PROPERTIES})
83−
84− set(qmltest_TARGET test${COMPONENT_NAME})
85− set(qmltest_gdb_TARGET gdbtest${COMPONENT_NAME})
86− set(qmltest_xvfb_TARGET xvfbtest${COMPONENT_NAME})
87− set(qmltest_FILE ${SUBPATH}/tst_${COMPONENT_NAME})
88−
89− set(qmltestrunner_imports "")
90− if(NOT "${qmltest_IMPORT_PATHS}" STREQUAL "")
91− foreach(IMPORT_PATH ${qmltest_IMPORT_PATHS})
92− list(APPEND qmltestrunner_imports "-import")
93− list(APPEND qmltestrunner_imports ${IMPORT_PATH})
94− endforeach(IMPORT_PATH)
95− elseif(NOT "${qmltest_DEFAULT_IMPORT_PATHS}" STREQUAL "")
96− foreach(IMPORT_PATH ${qmltest_DEFAULT_IMPORT_PATHS})
97− list(APPEND qmltestrunner_imports "-import")
98− list(APPEND qmltestrunner_imports ${IMPORT_PATH})
99− endforeach(IMPORT_PATH)
198+
199+ if(TARGET gdb)
200+ add_qmltest_target(gdbtry${COMPONENT_NAME} ${TARGET}
201+ COMMAND $<TARGET_FILE:gdb> -ex run -args ${qmltry_command}
202+ ${depends}
203+ ENVIRONMENT QML2_IMPORT_PATH=${imports} ${QMLTEST_ENVIRONMENT}
204+ )
100205 endif()
206+endfunction()
207+
208+
209+################### INTERNAL ####################
210+
211+# add_qmltest_target(target_name target
212+# COMMAND test_exe [arg1 [...]] # execute this test with arguments
213+# [...] # see above for available arguments:
214+# # ADD_TEST, ENVIRONMENT, DEPENDS and TARGETS
215+# )
101216
217+function(add_qmltest_target TARGET_NAME TARGET)
218+ cmake_parse_arguments(QMLTEST "${QMLTEST_OPTIONS}" "${QMLTEST_SINGLE}" "COMMAND;${QMLTEST_MULTI}" ${ARGN})
219+ mangle_arguments()
220+
221+ # Additional arguments
102222 string(TOLOWER "${CMAKE_GENERATOR}" cmake_generator_lower)
103223 if(cmake_generator_lower STREQUAL "unix makefiles")
104− set(function_ARGS $(FUNCTION))
105− else()
106− set(function_ARGS "")
224+ set(function "$(FUNCTION)")
107225 endif()
108226
109− if (${ITERATIONS} GREATER 0)
110− set(ITERATIONS_STRING "-iterations" ${ITERATIONS})
111− else()
112− set(ITERATIONS_STRING "")
227+ add_custom_target(${TARGET_NAME}
228+ env ${QMLTEST_ENVIRONMENT}
229+ ${QMLTEST_COMMAND} ${function}
230+ DEPENDS ${TARGET} ${QMLTEST_DEPENDS}
231+ )
232+
233+ if(QMLTEST_ADD_TEST)
234+ add_test(
235+ NAME ${TARGET_NAME}
236+ COMMAND ${QMLTEST_COMMAND}
237+ )
238+
239+ foreach(ENV ${QMLTEST_ENVIRONMENT})
240+ set_property(TEST ${TARGET_NAME} APPEND PROPERTY ENVIRONMENT ${ENV})
241+ endforeach()
242+
243+ set_property(TEST ${TARGET_NAME} APPEND PROPERTY DEPENDS ${TARGET})
244+ foreach(DEPEND ${DEPENDS})
245+ set_property(TEST ${TARGET_NAME} APPEND PROPERTY DEPENDS ${DEPEND})
246+ endforeach()
113247 endif()
114248
115− if("${qmltest_ENVIRONMENT}" STREQUAL "")
116− set(qmltest_ENVIRONMENT "${qmltest_default_ENVIRONMENT}")
249+ foreach(UPSTREAM_TARGET ${QMLTEST_TARGETS})
250+ add_dependencies(${UPSTREAM_TARGET} ${TARGET_NAME})
251+ endforeach()
252+endfunction()
253+
254+
255+# mangle_arguments(${ARGN})
256+#
257+# Verify there were no unparsed arguments and
258+# mangle the known ones for further processing.
259+
260+macro(mangle_arguments)
261+ if(QMLTEST_UNPARSED_ARGUMENTS)
262+ message(FATAL_ERROR "Unexpected arguments: ${QMLTEST_UNPARSED_ARGUMENTS}")
117263 endif()
118264
119− set(qmltest_command
120− env ${test_env} ${qmltest_ENVIRONMENT}
121− ${qmltestrunner_exe} -input ${CMAKE_CURRENT_SOURCE_DIR}/${qmltest_FILE}.qml
122− ${qmltestrunner_imports}
123− ${ITERATIONS_STRING}
124− -o ${CMAKE_BINARY_DIR}/${qmltest_TARGET}.xml,xunitxml
125− -o -,txt
126− ${function_ARGS}
127− )
128− find_program(DPKG dpkg-architecture)
129− if(DPKG)
130− exec_program(${DPKG} ARGS "-qDEB_BUILD_MULTIARCH" OUTPUT_VARIABLE ARCH_TRIPLET )
131− set(LD_PRELOAD_PATH "LD_PRELOAD=/usr/lib/${ARCH_TRIPLET}/mesa/libGL.so.1")
265+ if(QMLTEST_ADD_TEST)
266+ set(add_test ADD_TEST)
132267 endif()
133− set(qmltest_xvfb_command
134− env ${test_env} ${qmltest_ENVIRONMENT} ${LD_PRELOAD_PATH}
135− xvfb-run --server-args "-screen 0 1024x768x24" --auto-servernum
136− ${qmltestrunner_exe} -input ${CMAKE_CURRENT_SOURCE_DIR}/${qmltest_FILE}.qml
137− ${qmltestrunner_imports}
138− -o ${CMAKE_BINARY_DIR}/${qmltest_TARGET}.xml,xunitxml
139− -o -,txt
140− ${function_ARGS}
141− )
142268
143− set(qmltest_gdb_command
144− env ${test_env} ${qmltest_ENVIRONMENT} ${LD_PRELOAD_PATH}
145− gdb -e ${qmltestrunner_exe} -ex \"run -input ${CMAKE_CURRENT_SOURCE_DIR}/${qmltest_FILE}.qml ${qmltestrunner_imports} ${ITERATIONS_STRING}\"
146− )
269+ if(QMLTEST_IMPORT_PATHS)
270+ string(REPLACE ";" ":" imports "${QMLTEST_IMPORT_PATHS}")
271+ endif()
147272
148− add_qmltest_target(${qmltest_TARGET} "${qmltest_command}" TRUE ${qmltest_NO_ADD_TEST})
149− add_qmltest_target(${qmltest_xvfb_TARGET} "${qmltest_xvfb_command}" ${qmltest_NO_TARGETS} TRUE)
150− add_qmltest_target(${qmltest_gdb_TARGET} "${qmltest_gdb_command}" TRUE TRUE)
151− add_manual_qml_test(${SUBPATH} ${COMPONENT_NAME} ${ARGN})
152−endmacro(add_qml_test_internal)
153−
154−macro(add_binary_qml_test CLASS_NAME LD_PATH DEPS ENVVAR)
155− set(testCommand
156− ${ENVVAR}
157− LD_LIBRARY_PATH=${LD_PATH}
158− dbus-test-runner
159− -m 300
160− -t ${CMAKE_CURRENT_BINARY_DIR}/${CLASS_NAME}TestExec
161− -p -o -p ${CMAKE_BINARY_DIR}/test${CLASS_NAME}.xml,xunitxml
162− -p -o -p -,txt)
163−
164− add_qmltest_target(test${CLASS_NAME} "${testCommand}" FALSE TRUE)
165− add_dependencies(test${CLASS_NAME} ${CLASS_NAME}TestExec ${DEPS})
166−
167− find_program( HAVE_GCC gcc )
168− if (NOT ${HAVE_GCC} STREQUAL "")
169− exec_program( gcc ARGS "-dumpmachine" OUTPUT_VARIABLE ARCH_TRIPLET )
170− set(LD_PRELOAD_PATH "LD_PRELOAD=/usr/lib/${ARCH_TRIPLET}/mesa/libGL.so.1")
273+ if(QMLTEST_ITERATIONS)
274+ set(iterations -iterations ${QMLTEST_ITERATIONS})
171275 endif()
172− set(xvfbtestCommand
173− ${LD_PRELOAD_PATH}
174− ${ENVVAR}
175− LD_LIBRARY_PATH=${LD_PATH}
176− xvfb-run --server-args "-screen 0 1024x768x24" --auto-servernum
177− dbus-test-runner
178− -m 300
179− -t ${CMAKE_CURRENT_BINARY_DIR}/${CLASS_NAME}TestExec
180− -p -o -p ${CMAKE_BINARY_DIR}/test${CLASS_NAME}.xml,xunitxml
181− -p -o -p -,txt)
182−
183− add_qmltest_target(xvfbtest${CLASS_NAME} "${xvfbtestCommand}" FALSE TRUE)
184− add_dependencies(qmluitests xvfbtest${CLASS_NAME})
185−endmacro(add_binary_qml_test)
186−
187−macro(add_qmltest_target qmltest_TARGET qmltest_command qmltest_NO_TARGETS qmltest_NO_ADD_TEST)
188− add_custom_target(${qmltest_TARGET} ${qmltest_command})
189−
190− if(NOT "${qmltest_PROPERTIES}" STREQUAL "")
191− set_target_properties(${qmltest_TARGET} PROPERTIES ${qmltest_PROPERTIES})
192− elseif(NOT "${qmltest_DEFAULT_PROPERTIES}" STREQUAL "")
193− set_target_properties(${qmltest_TARGET} PROPERTIES ${qmltest_DEFAULT_PROPERTIES})
276+
277+ if(QMLTEST_DEPENDS)
278+ set(depends DEPENDS ${QMLTEST_DEPENDS})
194279 endif()
195280
196− if("${qmltest_NO_ADD_TEST}" STREQUAL FALSE AND NOT "${qmltest_DEFAULT_NO_ADD_TEST}" STREQUAL "TRUE")
197− add_test(${qmltest_TARGET} ${qmltest_command})
281+ if(QMLTEST_TARGETS)
282+ set(targets TARGETS ${QMLTEST_TARGETS})
283+ endif()
198284
199− if(NOT "${qmltest_UNPARSED_ARGUMENTS}" STREQUAL "")
200− set_tests_properties(${qmltest_TARGET} PROPERTIES ${qmltest_PROPERTIES})
201− elseif(NOT "${qmltest_DEFAULT_PROPERTIES}" STREQUAL "")
202− set_tests_properties(${qmltest_TARGET} PROPERTIES ${qmltest_DEFAULT_PROPERTIES})
285+ set(xvfb_targets "")
286+ foreach(target ${QMLTEST_TARGETS})
287+ if(TARGET xvfb${target})
288+ list(APPEND xvfb_targets xvfb${target})
203289 endif()
204− endif("${qmltest_NO_ADD_TEST}" STREQUAL FALSE AND NOT "${qmltest_DEFAULT_NO_ADD_TEST}" STREQUAL "TRUE")
205−
206− if("${qmltest_NO_TARGETS}" STREQUAL "FALSE")
207− if(NOT "${qmltest_TARGETS}" STREQUAL "")
208− foreach(TARGET ${qmltest_TARGETS})
209− add_dependencies(${TARGET} ${qmltest_TARGET})
210− endforeach(TARGET)
211− elseif(NOT "${qmltest_DEFAULT_TARGETS}" STREQUAL "")
212− foreach(TARGET ${qmltest_DEFAULT_TARGETS})
213− add_dependencies(${TARGET} ${qmltest_TARGET})
214− endforeach(TARGET)
215− endif()
216− endif("${qmltest_NO_TARGETS}" STREQUAL "FALSE")
290+ endforeach()
291+ set(xvfb_targets "${xvfb_targets}" PARENT_SCOPE)
292+endmacro()
293+
217294
218−endmacro(add_qmltest_target)
295+# bake_arguments(prefix output
296+# arg1 [arg2 [...]]
297+# )
298+#
299+# If set, add the argument prefix before every passed
300+# argument and store the result in ${OUTPUT} variable.
301+
302+function(bake_arguments PREFIX OUTPUT)
303+ set(args "${ARGN}")
304+ if(PREFIX)
305+ set(args "")
306+ foreach(arg ${ARGN})
307+ list(APPEND args ${PREFIX})
308+ list(APPEND args ${arg})
309+ endforeach()
310+ endif()
311+ set(${OUTPUT} "${args}" PARENT_SCOPE)
312+endfunction()
debian/changelog+24−31
@@ -1,47 +1,40 @@
1−unity8 (8.10+15.10.20150616.1-0ubuntu1) wily; urgency=medium
1+unity8 (8.10+15.10.20150618-0ubuntu1) wily; urgency=medium
22
33 [ Albert Astals Cid ]
4− * Bind running to the proper object.visible
5− * Do not use template in generated card creator code
6− * Fix regression introduced by the concierge change
7− * Take into account the extra margin on top when calculating the
8− display margin
9− * workaround oxide 1.7 issue (LP: #1459142)
4+ * Refactor QmlTest.cmake module so that all tests can go through it.
5+ Also a bit of cleanup around tests.
6+ * Support fallback images for dash card and preview widgets (LP:
7+ #1324142)
108
119 [ CI Train Bot ]
1210 * New rebuild forced.
11+ * Resync trunk.
1312
14− [ Federico Gimenez ]
15− * On the autopilot helpers, swipe if the item to open from the dash is
16− not visible. unity8-autopilot dependencies now require ubuntu-ui-
17− toolkit-autopilot (>= 1.2.1485+15.04.20150417.1-0ubuntu1)
18−
19− [ Florian Boucault ]
20− * Notifications: shaped icon was stretching the icon instead of
21− respecting its aspect ratio and filling the whole shape. (LP:
22− #1450229)
13+ [ Daniel d'Andrada ]
14+ * Fix Shell tests
2315
2416 [ Josh Arenson ]
25− * Implement bare-bones shellMode=greeter and shellMode=shell
17+ * Refactor greeter emulator to unlock the greeter via dbus
2618
27− [ Leo Arias ]
28− * On the autopilot helpers, swipe if the item to open from the dash is
29− not visible. unity8-autopilot dependencies now require ubuntu-ui-
30− toolkit-autopilot (>= 1.2.1485+15.04.20150417.1-0ubuntu1)
31−
32− [ Leonardo Arias Fonseca ]
33− * On the autopilot helpers, swipe if the item to open from the dash is
34− not visible. unity8-autopilot dependencies now require ubuntu-ui-
35− toolkit-autopilot (>= 1.2.1485+15.04.20150417.1-0ubuntu1)
19+ [ Lukáš Tinkl ]
20+ * respect target window's devicePixelRatio in MouseTouchAdaptor
3621
3722 [ Michael Zanetti ]
38− * add info on how to run a single function in make test
23+ * Refactor QmlTest.cmake module so that all tests can go through it.
24+ Also a bit of cleanup around tests.
25+
26+ [ Michał Sawicz ]
27+ * Refactor QmlTest.cmake module so that all tests can go through it.
28+ Also a bit of cleanup around tests.
3929
40− [ Richard Huddie ]
41− * Slow down the speed of autopilot helpers used to swipe to a
42− different scope to improve the reliability. (LP: #1461059, #1457047)
30+ [ handsome_feng ]
31+ * Forbid closing apps during the edge gesture. (LP: #1445572)
32+ * Removed the horizonal rule on pin unlock screen. (LP: #1368798)
33+
34+ [ handsome_feng<445865575@qq.com> ]
35+ * Forbid closing apps during the edge gesture. (LP: #1445572)
4336
44− -- CI Train Bot <ci-train-bot@canonical.com> Tue, 16 Jun 2015 15:12:59 +0000
37+ -- CI Train Bot <ci-train-bot@canonical.com> Thu, 18 Jun 2015 19:40:06 +0000
4538
4639unity8 (8.10+15.10.20150612-0ubuntu2) wily; urgency=medium
4740
plugins/Dash/CardCreator.js+8
@@ -389,6 +389,10 @@ function cardString(template, components) {
389389 }
390390
391391 code += kArtShapeHolderCode.arg(artAnchors).arg(widthCode).arg(heightCode);
392+ var fallback = components["art"] && components["art"]["fallback"] || "";
393+ if (fallback !== "") {
394+ code += 'Connections { target: artShapeLoader.item ? artShapeLoader.item.image : null; onStatusChanged: if (artShapeLoader.item.image.status === Image.Error) artShapeLoader.item.image.source = "%1"; } \n'.arg(fallback);
395+ }
392396 } else {
393397 code += 'readonly property size artShapeSize: Qt.size(-1, -1);\n'
394398 }
@@ -468,6 +472,10 @@ function cardString(template, components) {
468472
469473 var mascotImageVisible = useMascotShape ? 'false' : 'showHeader';
470474 mascotCode = kMascotImageCode.arg(mascotAnchors).arg(mascotImageVisible);
475+ var fallback = components["mascot"] && components["mascot"]["fallback"] || "";
476+ if (fallback !== "") {
477+ code += 'Connections { target: mascotImage.image; onStatusChanged: if (mascotImage.image.status === Image.Error) mascotImage.source = "%1"; } \n'.arg(fallback);
478+ }
471479 }
472480
473481 var summaryColorWithBackground = 'backgroundLoader.active && backgroundLoader.item && root.scopeStyle ? root.scopeStyle.getTextColor(backgroundLoader.item.luminance) : (backgroundLoader.item && backgroundLoader.item.luminance > 0.7 ? Theme.palette.normal.baseText : "white")';
plugins/Wizard/PageList.cpp+1−1
@@ -45,7 +45,7 @@ PageList::PageList(QObject *parent)
4545 QSet<QString> disabledPages;
4646 QStringList dataDirs;
4747
48− if (!isRunningInstalled() && getenv("UNITY_TEST_ENV") == nullptr) {
48+ if (!isRunningInstalled() && getenv("WIZARD_TESTING") == nullptr) {
4949 dataDirs << qmlDirectory();
5050 } else {
5151 dataDirs = shellDataDirs();
qml/Components/PinLockscreen.qml+1−5
@@ -52,7 +52,7 @@ Item {
5252 verticalCenter: parent.verticalCenter;
5353 verticalCenterOffset: Math.max(-units.gu(10), -(root.height - height) / 2) + units.gu(4)
5454 }
55− spacing: units.gu(2)
55+ spacing: units.gu(4)
5656
5757 Column {
5858 id: shakeContainer
@@ -154,10 +154,6 @@ Item {
154154 }
155155 }
156156
157− ThinDivider {
158− anchors { left: parent.left; right: parent.right; margins: units.gu(2) }
159− }
160−
161157 Grid {
162158 id: numbersGrid
163159 objectName: "numbersGrid"
qml/Components/ZoomableImage.qml+1
@@ -30,6 +30,7 @@ Item {
3030 property var zoomable: false
3131 property alias imageStatus: imageRenderer.status
3232 property alias asynchronous: imageRenderer.asynchronous
33+ readonly property alias status: imageRenderer.status
3334
3435 Flickable {
3536 id: flickable
qml/Dash/Previews/PreviewHeader.qml+6
@@ -22,6 +22,7 @@ import "../"
2222/*! This preview widget shows a header
2323 * The title comes in widgetData["title"]
2424 * The mascot comes in widgetData["mascot"]
25+ * The mascot fall back image comes in widgetData["fallback"]
2526 * The subtitle comes in widgetData["subtitle"]
2627 * The attributes comes in widgetData["attributes"]
2728 */
@@ -35,11 +36,15 @@ PreviewWidget {
3536 id: headerRoot
3637 objectName: "innerPreviewHeader"
3738 readonly property url mascot: root.widgetData["mascot"] || ""
39+ readonly property url fallback: root.widgetData["fallback"] || ""
3840 readonly property string title: root.widgetData["title"] || ""
3941 readonly property string subtitle: root.widgetData["subtitle"] || ""
4042 readonly property var attributes: root.widgetData["attributes"] || null
4143 readonly property color fontColor: root.scopeStyle ? root.scopeStyle.foreground : Theme.palette.normal.baseText
4244
45+ // Rewire the source since we may have unwired it on onStatusChanged
46+ onMascotChanged: if (mascotShapeLoader.item) mascotShapeLoader.item.image.source = mascot;
47+
4348 implicitHeight: row.height + row.margins * 2
4449 width: parent.width
4550
@@ -82,6 +87,7 @@ PreviewWidget {
8287 fillMode: Image.PreserveAspectCrop
8388 horizontalAlignment: Image.AlignHCenter
8489 verticalAlignment: Image.AlignVCenter
90+ onStatusChanged: if (status === Image.Error) source = headerRoot.fallback;
8591 }
8692 }
8793 }
qml/Dash/Previews/PreviewImageGallery.qml+14
@@ -20,6 +20,7 @@ import "../../Components"
2020
2121/*! This preview widget shows a horizontal list of images.
2222 * The URIs for the images should be an array in widgetData["sources"].
23+ * Images fall back to widgetData["fallback"] if loading fails
2324 */
2425
2526PreviewWidget {
@@ -72,6 +73,14 @@ PreviewWidget {
7273 overlay.show();
7374 }
7475 }
76+
77+ Connections {
78+ target: sourceImage
79+ // If modelData would change after failing to load it would not be
80+ // reloaded since the source binding is destroyed by the source = fallback
81+ // But at the moment the model never changes
82+ onStatusChanged: if (sourceImage.status === Image.Error) sourceImage.source = widgetData["fallback"];
83+ }
7584 }
7685 }
7786
@@ -122,6 +131,11 @@ PreviewWidget {
122131 source: modelData ? modelData : ""
123132 fillMode: Image.PreserveAspectFit
124133 sourceSize { width: screenshot.width; height: screenshot.height }
134+
135+ // If modelData would change after failing to load it would not be
136+ // reloaded since the source binding is destroyed by the source = fallback
137+ // But at the moment the model never changes
138+ onStatusChanged: if (status === Image.Error) source = widgetData["fallback"];
125139 }
126140
127141 MouseArea {
qml/Dash/Previews/PreviewZoomableImage.qml+13
@@ -21,6 +21,7 @@ import "../../Components"
2121/*! \brief Preview widget for image.
2222
2323 This widget shows image contained in widgetData["source"],
24+ and falls back to widgetData["fallback"] if loading fails
2425 can be zoomable accordingly with widgetData["zoomable"].
2526 */
2627
@@ -53,6 +54,14 @@ PreviewWidget {
5354 overlay.show();
5455 }
5556 }
57+
58+ Connections {
59+ target: lazyImage.sourceImage
60+ // If modelData would change after failing to load it would not be
61+ // reloaded since the source binding is destroyed by the source = fallback
62+ // But at the moment the model never changes
63+ onStatusChanged: if (lazyImage.sourceImage.status === Image.Error) lazyImage.sourceImage.source = widgetData["fallback"];
64+ }
5665 }
5766
5867 PreviewOverlay {
@@ -67,6 +76,10 @@ PreviewWidget {
6776 anchors.fill: parent
6877 source: widgetData["source"]
6978 zoomable: widgetData["zoomable"] ? widgetData["zoomable"] : false
79+ // If modelData would change after failing to load it would not be
80+ // reloaded since the source binding is destroyed by the source = fallback
81+ // But at the moment the model never changes
82+ onStatusChanged: if (status === Image.Error) source = widgetData["fallback"];
7083 }
7184 }
7285}
qml/Stages/PhoneStage.qml+7
@@ -548,6 +548,13 @@ Rectangle {
548548 }
549549 }
550550
551+ //eat touch events during the right edge gesture
552+ MouseArea {
553+ objectName: "eventEaterArea"
554+ anchors.fill: parent
555+ enabled: spreadDragArea.dragging
556+ }
557+
551558 DirectionalDragArea {
552559 id: spreadDragArea
553560 objectName: "spreadDragArea"
qml/Stages/TabletStage.qml+6
@@ -724,6 +724,12 @@ Rectangle {
724724 }
725725 }
726726
727+ //eat touch events during the right edge gesture
728+ MouseArea {
729+ anchors.fill: parent
730+ enabled: spreadDragArea.dragging
731+ }
732+
727733 DirectionalDragArea {
728734 id: spreadDragArea
729735 objectName: "spreadDragArea"
runtests.sh+1−1
@@ -41,7 +41,7 @@ sleep 1
4141
4242cd -
4343
44−make -k qmltests
44+make -k xvfballtests
4545if [ $? -ne 0 ]; then
4646 echo '<?xml version="1.0" encoding="UTF-8" ?><testsuite errors="0" failures="1" tests="1" name="makeExitStatusTest"><properties/><testcase result="fail" name="makeExitStatus"><failure message="Make test did not suceed" result="fail"/></testcase><system-err/></testsuite>' > testMakeExitStatus.xml
4747fi
src/MouseTouchAdaptor.cpp+6−6
@@ -104,10 +104,10 @@ bool MouseTouchAdaptor::handleButtonPress(xcb_button_press_event_t *pressEvent)
104104 if (button != Qt::LeftButton)
105105 return true;
106106
107− QPoint windowPos(pressEvent->event_x, pressEvent->event_y);
108−
109107 QWindow *targetWindow = findQWindowWithXWindowID(static_cast<WId>(pressEvent->event));
110108
109+ QPoint windowPos(pressEvent->event_x / targetWindow->devicePixelRatio(), pressEvent->event_y / targetWindow->devicePixelRatio());
110+
111111 QTouchEventSequence touchEvent = QTest::touchEvent(targetWindow, m_touchDevice,
112112 false /* autoCommit */);
113113 touchEvent.press(0 /* touchId */, windowPos);
@@ -125,10 +125,10 @@ bool MouseTouchAdaptor::handleButtonRelease(xcb_button_release_event_t *releaseE
125125 if (button != Qt::LeftButton)
126126 return true;
127127
128− QPoint windowPos(releaseEvent->event_x, releaseEvent->event_y);
129−
130128 QWindow *targetWindow = findQWindowWithXWindowID(static_cast<WId>(releaseEvent->event));
131129
130+ QPoint windowPos(releaseEvent->event_x / targetWindow->devicePixelRatio(), releaseEvent->event_y / targetWindow->devicePixelRatio());
131+
132132 QTouchEventSequence touchEvent = QTest::touchEvent(targetWindow, m_touchDevice,
133133 false /* autoCommit */);
134134 touchEvent.release(0 /* touchId */, windowPos);
@@ -144,10 +144,10 @@ bool MouseTouchAdaptor::handleMotionNotify(xcb_motion_notify_event_t *event)
144144 return true;
145145 }
146146
147− QPoint windowPos(event->event_x, event->event_y);
148−
149147 QWindow *targetWindow = findQWindowWithXWindowID(static_cast<WId>(event->event));
150148
149+ QPoint windowPos(event->event_x / targetWindow->devicePixelRatio(), event->event_y / targetWindow->devicePixelRatio());
150+
151151 QTouchEventSequence touchEvent = QTest::touchEvent(targetWindow, m_touchDevice,
152152 false /* autoCommit */);
153153 touchEvent.move(0 /* touchId */, windowPos);
tests/CMakeLists.txt+120−8
@@ -1,16 +1,128 @@
1+include(QmlTest)
2+
13# QML tests that do not require graphical capabilities.
2−add_custom_target(qmlunittests)
4+add_custom_target(unittests)
35
46# QML tests that require graphical capabilities.
5−add_custom_target(qmluitests)
7+add_custom_target(uitests)
8+add_custom_target(xvfbuitests)
69
7−add_custom_target(qmltests)
8−add_dependencies(qmltests qmlunittests qmluitests)
10+add_custom_target(alltests)
11+add_dependencies(alltests unittests uitests)
912
10−add_subdirectory(libs)
11−add_subdirectory(qmltests)
13+add_custom_target(xvfballtests)
14+add_dependencies(xvfballtests unittests xvfbuitests)
15+
16+# Support libraries and plugins
1217add_subdirectory(mocks)
13−add_subdirectory(whitespace)
14−add_subdirectory(plugins)
1518add_subdirectory(utils)
1619add_subdirectory(uqmlscene)
20+
21+# Use our custom implementation of qmlscene and import dbus-test-runner
22+add_executable(qmlscene ALIAS uqmlscene)
23+import_executables(dbus-test-runner)
24+
25+set(UNITY_IMPORT_PATHS
26+ ${CMAKE_BINARY_DIR}/tests/mocks
27+ ${CMAKE_BINARY_DIR}/tests/utils/modules
28+ ${CMAKE_BINARY_DIR}/plugins
29+)
30+set(UNITY_IMPORT_PATHS ${UNITY_IMPORT_PATHS} CACHE INTERNAL "")
31+
32+macro(unity8_parse_arguments)
33+ cmake_parse_arguments(U8TEST
34+ "${QMLTEST_OPTIONS};LIGHTDM"
35+ "${QMLTEST_SINGLE}"
36+ "${QMLTEST_MULTI}"
37+ ${ARGN}
38+ )
39+
40+ set(ld_paths)
41+ if(U8TEST_LIGHTDM)
42+ list(APPEND ld_paths
43+ ${CMAKE_BINARY_DIR}/tests/mocks/libusermetrics
44+ ${CMAKE_BINARY_DIR}/tests/mocks/LightDM/liblightdm
45+ )
46+ endif()
47+
48+ if(ld_paths)
49+ string(REPLACE ";" ":" ld_library_path "${ld_paths}")
50+ set(ld_library_path LD_LIBRARY_PATH=${ld_library_path})
51+ endif()
52+
53+ set(U8TEST_ARGN "${ARGN}")
54+ list(REMOVE_ITEM U8TEST_ARGN LIGHTDM)
55+
56+ set(environment
57+ UNITY_TESTING=1
58+ LANGUAGE=C
59+ LC_ALL=C.UTF-8
60+ ${ld_library_path}
61+ )
62+endmacro()
63+
64+
65+# add a non-graphical unit test
66+# see QmlTest.cmake for additional options
67+function(add_unity8_unittest COMPONENT_NAME TARGET)
68+ unity8_parse_arguments(${ARGN})
69+ add_executable_test(${COMPONENT_NAME} ${TARGET}
70+ ADD_TEST
71+ IMPORT_PATHS ${UNITY_IMPORT_PATHS}
72+ TARGETS unittests
73+ ${U8TEST_ARGN}
74+ ENVIRONMENT ${environment}
75+ QT_QPA_PLATFORM=minimal
76+ ${U8TEST_ENVIRONMENT}
77+ )
78+endfunction()
79+
80+# add a graphical unit test
81+function(add_unity8_uitest COMPONENT_NAME TARGET)
82+ unity8_parse_arguments(${ARGN})
83+ add_executable_test(${COMPONENT_NAME} ${TARGET}
84+ IMPORT_PATHS ${UNITY_IMPORT_PATHS}
85+ TARGETS uitests
86+ ${U8TEST_ARGN}
87+ ENVIRONMENT ${environment}
88+ ${U8TEST_ENVIRONMENT}
89+ )
90+endfunction()
91+
92+# add a non-graphical qml unit test
93+function(add_unity8_qmlunittest PATH COMPONENT_NAME)
94+ unity8_parse_arguments(${ARGN})
95+ add_qml_unittest(${PATH} ${COMPONENT_NAME}
96+ ADD_TEST
97+ IMPORT_PATHS ${UNITY_IMPORT_PATHS}
98+ TARGET unittests
99+ ${U8TEST_ARGN}
100+ ENVIRONMENT ${environment}
101+ QT_QPA_PLATFORM=minimal
102+ ${U8TEST_ENVIRONMENT}
103+ )
104+endfunction()
105+
106+# add a graphical qml test
107+function(add_unity8_qmltest PATH COMPONENT_NAME)
108+ unity8_parse_arguments(${ARGN})
109+ add_qml_test(${PATH} ${COMPONENT_NAME}
110+ IMPORT_PATHS ${UNITY_IMPORT_PATHS}
111+ TARGETS uitests
112+ ${U8TEST_ARGN}
113+ ENVIRONMENT ${environment}
114+ ${U8TEST_ENVIRONMENT}
115+ )
116+endfunction()
117+
118+# add a graphical qml benchmark
119+function(add_unity8_qmlbenchmark PATH COMPONENT_NAME ITERATIONS)
120+ add_unity8_qmltest(${PATH} ${COMPONENT_NAME} ITERATIONS ${ITERATIONS} ${ARGN})
121+endfunction()
122+
123+
124+# Actual test definitions
125+add_subdirectory(libs)
126+add_subdirectory(plugins)
127+add_subdirectory(qmltests)
128+add_subdirectory(whitespace)
tests/autopilot/unity8/application_lifecycle/tests/__init__.py+2−2
@@ -31,8 +31,8 @@ class ApplicationLifeCycleTestCase(tests.UnityTestCase):
3131 super().setUp()
3232 self._qml_mock_enabled = False
3333 self._data_dirs_mock_enabled = False
34− unity_proxy = self.launch_unity()
35− process_helpers.unlock_unity(unity_proxy)
34+ self.launch_unity()
35+ process_helpers.unlock_unity()
3636
3737 def create_test_application(self):
3838 desktop_file_dict = fixture_setup.DEFAULT_DESKTOP_FILE_DICT
tests/autopilot/unity8/greeter/__init__.py+52
@@ -0,0 +1,52 @@
1+# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2+#
3+# Unity Autopilot Test Suite
4+# Copyright (C) 2015 Canonical
5+#
6+# This program is free software: you can redistribute it and/or modify
7+# it under the terms of the GNU General Public License as published by
8+# the Free Software Foundation, either version 3 of the License, or
9+# (at your option) any later version.
10+#
11+# This program is distributed in the hope that it will be useful,
12+# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+# GNU General Public License for more details.
15+#
16+# You should have received a copy of the GNU General Public License
17+# along with this program. If not, see <http://www.gnu.org/licenses/>.
18+#
19+
20+import dbus
21+
22+from autopilot.matchers import Eventually
23+from testtools.matchers import Equals
24+
25+
26+def hide_greeter_with_dbus():
27+ dbus_proxy = _get_greeter_dbus_proxy()
28+ if _is_greeter_active():
29+ dbus_proxy.HideGreeter()
30+
31+
32+def show_greeter_with_dbus():
33+ dbus_proxy = _get_greeter_dbus_proxy()
34+ if not _is_greeter_active():
35+ dbus_proxy.ShowGreeter()
36+
37+
38+def wait_for_greeter():
39+ Eventually(Equals(True), timeout=300).match(_is_greeter_active)
40+
41+
42+def _get_greeter_dbus_proxy():
43+ bus = dbus.SessionBus()
44+ return bus.get_object('com.canonical.UnityGreeter', '/')
45+
46+
47+def _is_greeter_active():
48+ try:
49+ dbus_proxy = _get_greeter_dbus_proxy()
50+ return dbus_proxy.Get('com.canonical.UnityGreeter', 'IsActive')
51+ except:
52+ return False
tests/autopilot/unity8/indicators/tests/__init__.py+1−1
@@ -31,7 +31,7 @@ class IndicatorTestCase(tests.UnityTestCase):
3131 def setUp(self):
3232 super().setUp()
3333 self.unity_proxy = self.launch_unity()
34− process_helpers.unlock_unity(self.unity_proxy)
34+ process_helpers.unlock_unity()
3535
3636
3737class DeviceIndicatorTestCase(IndicatorTestCase):
tests/autopilot/unity8/process_helpers.py+7−94
@@ -19,14 +19,11 @@
1919
2020import logging
2121import subprocess
22−import dbus
2322
2423import ubuntuuitoolkit
25−from autopilot.exceptions import ProcessSearchError
2624from autopilot.introspection import get_proxy_object_for_existing_process
2725
28−from unity8.shell import emulators
29−from unity8.shell.emulators import main_window as main_window_emulator
26+from unity8 import greeter
3027
3128logger = logging.getLogger(__name__)
3229
@@ -39,104 +36,20 @@ class CannotAccessUnity(Exception):
3936 pass
4037
4138
42−def unlock_unity(unity_proxy_obj=None):
39+def unlock_unity():
4340 """Helper function that attempts to unlock the unity greeter.
4441
45− If unity_proxy_object is None create a proxy object by querying for the
46− running unity process.
47− Otherwise re-use the passed proxy object.
48−
49− :raises RuntimeError: if the greeter attempts and fails to be unlocked.
50−
51− :raises RuntimeWarning: when the greeter cannot be found because it is
52− already unlocked.
53− :raises CannotAccessUnity: if unity is not introspectable or cannot be
54− found on dbus.
55− :raises CannotAccessUnity: if unity's upstart status is not "start" or the
56− upstart job cannot be found at all.
57−
5842 """
59− if unity_proxy_obj is None:
60− try:
61− pid = get_unity_pid()
62− unity = _get_unity_proxy_object(pid)
63− main_window = unity.select_single(main_window_emulator.QQuickView)
64− except ProcessSearchError as e:
65− raise CannotAccessUnity(
66− "Cannot introspect unity, make sure that it has been started "
67− "with testability. Perhaps use the function "
68− "'restart_unity_with_testability' this module provides."
69− "(%s)"
70− % str(e)
71− )
72− else:
73− main_window = unity_proxy_obj.select_single(
74− main_window_emulator.QQuickView)
75−
76− greeter = main_window.get_greeter()
77− if greeter.created is False:
78− raise RuntimeWarning("Greeter appears to be already unlocked.")
79−
80− bus = dbus.SessionBus()
81− dbus_proxy = bus.get_object("com.canonical.UnityGreeter", "/")
82− try:
83− dbus_proxy.HideGreeter()
84− except dbus.DBusException:
85− logger.info("Failed to unlock greeter")
86− raise
87− else:
88− greeter.created.wait_for(False)
89− logger.info("Greeter unlocked, continuing.")
43+ greeter.wait_for_greeter()
44+ greeter.hide_greeter_with_dbus()
9045
9146
92−def lock_unity(unity_proxy_obj=None):
47+def lock_unity():
9348 """Helper function that attempts to lock unity greeter.
9449
95− If unity_proxy_object is None create a proxy object by querying for the
96− running unity process.
97− Otherwise re-use the passed proxy object.
98−
99− :raises RuntimeError: if the greeter attempts and fails to be locked.
100−
101− :raises RuntimeWarning: when the greeter is found because it is
102− already locked.
103− :raises CannotAccessUnity: if unity is not introspectable or cannot be
104− found on dbus.
105− :raises CannotAccessUnity: if unity's upstart status is not "start" or the
106− upstart job cannot be found at all.
107−
10850 """
109− if unity_proxy_obj is None:
110− try:
111− pid = get_unity_pid()
112− unity = _get_unity_proxy_object(pid)
113− main_window = unity.select_single(main_window_emulator.QQuickView)
114− except ProcessSearchError as e:
115− raise CannotAccessUnity(
116− "Cannot introspect unity, make sure that it has been started "
117− "with testability. Perhaps use the function "
118− "'restart_unity_with_testability' this module provides."
119− "(%s)"
120− % str(e)
121− )
122− else:
123− main_window = unity_proxy_obj.select_single(
124− main_window_emulator.QQuickView)
125−
126− greeter = main_window.get_greeter()
127− if greeter.created is True:
128− raise RuntimeWarning("Greeter appears to be already locked.")
129−
130− bus = dbus.SessionBus()
131− dbus_proxy = bus.get_object("com.canonical.UnityGreeter", "/")
132− try:
133− dbus_proxy.ShowGreeter()
134− except dbus.DBusException:
135− logger.info("Failed to lock greeter")
136− raise
137− else:
138− greeter.created.wait_for(True)
139− logger.info("Greeter locked, continuing.")
51+ greeter.show_greeter_with_dbus()
52+ greeter.wait_for_greeter()
14053
14154
14255def restart_unity_with_testability(*args):
tests/autopilot/unity8/shell/tests/test_emulators.py+2−2
@@ -41,8 +41,8 @@ class MainWindowTestCase(tests.UnityTestCase):
4141
4242 def setUp(self):
4343 super().setUp()
44− unity_proxy = self.launch_unity()
45− process_helpers.unlock_unity(unity_proxy)
44+ self.launch_unity()
45+ process_helpers.unlock_unity()
4646
4747
4848class DashEmulatorTestCase(tests.DashBaseTestCase):
tests/autopilot/unity8/shell/tests/test_notifications.py+22−22
@@ -119,8 +119,8 @@ class InteractiveNotificationBase(NotificationsBase):
119119
120120 def test_interactive(self):
121121 """Interactive notification must react upon click on itself."""
122− unity_proxy = self.launch_unity()
123− unlock_unity(unity_proxy)
122+ self.launch_unity()
123+ unlock_unity()
124124
125125 notify_list = self._get_notifications_list()
126126
@@ -156,8 +156,8 @@ class InteractiveNotificationBase(NotificationsBase):
156156 """Snap-decision with three actions should use
157157 one-over two button layout.
158158 """
159− unity_proxy = self.launch_unity()
160− unlock_unity(unity_proxy)
159+ self.launch_unity()
160+ unlock_unity()
161161
162162 summary = "Theatre at Ferria Stadium"
163163 body = "at Ferria Stadium in Bilbao, Spain\n07578545317"
@@ -197,8 +197,8 @@ class InteractiveNotificationBase(NotificationsBase):
197197 """Snap-decision should block input to shell
198198 without greeter/lockscreen.
199199 """
200− unity_proxy = self.launch_unity()
201− unlock_unity(unity_proxy)
200+ self.launch_unity()
201+ unlock_unity()
202202
203203 summary = "Incoming file"
204204 body = "Frank would like to send you the file: essay.pdf"
@@ -421,8 +421,8 @@ class EphemeralNotificationsTests(NotificationsBase):
421421
422422 def test_icon_summary_body(self):
423423 """Notification must display the expected summary and body text."""
424− unity_proxy = self.launch_unity()
425− unlock_unity(unity_proxy)
424+ self.launch_unity()
425+ unlock_unity()
426426
427427 notify_list = self._get_notifications_list()
428428
@@ -458,8 +458,8 @@ class EphemeralNotificationsTests(NotificationsBase):
458458 def test_icon_summary(self):
459459 """Notification must display the expected summary and secondary
460460 icon."""
461− unity_proxy = self.launch_unity()
462− unlock_unity(unity_proxy)
461+ self.launch_unity()
462+ unlock_unity()
463463
464464 notify_list = self._get_notifications_list()
465465
@@ -491,8 +491,8 @@ class EphemeralNotificationsTests(NotificationsBase):
491491 def test_urgency_order(self):
492492 """Notifications must be displayed in order according to their
493493 urgency."""
494− unity_proxy = self.launch_unity()
495− unlock_unity(unity_proxy)
494+ self.launch_unity()
495+ unlock_unity()
496496
497497 notify_list = self._get_notifications_list()
498498
@@ -578,8 +578,8 @@ class EphemeralNotificationsTests(NotificationsBase):
578578
579579 def test_summary_and_body(self):
580580 """Notification must display the expected summary- and body-text."""
581− unity_proxy = self.launch_unity()
582− unlock_unity(unity_proxy)
581+ self.launch_unity()
582+ unlock_unity()
583583
584584 notify_list = self._get_notifications_list()
585585
@@ -603,8 +603,8 @@ class EphemeralNotificationsTests(NotificationsBase):
603603
604604 def test_summary_only(self):
605605 """Notification must display only the expected summary-text."""
606− unity_proxy = self.launch_unity()
607− unlock_unity(unity_proxy)
606+ self.launch_unity()
607+ unlock_unity()
608608
609609 notify_list = self._get_notifications_list()
610610
@@ -621,8 +621,8 @@ class EphemeralNotificationsTests(NotificationsBase):
621621 def test_update_notification_same_layout(self):
622622 """Notification must allow updating its contents while being
623623 displayed."""
624− unity_proxy = self.launch_unity()
625− unlock_unity(unity_proxy)
624+ self.launch_unity()
625+ unlock_unity()
626626
627627 notify_list = self._get_notifications_list()
628628
@@ -660,8 +660,8 @@ class EphemeralNotificationsTests(NotificationsBase):
660660 def test_update_notification_layout_change(self):
661661 """Notification must allow updating its contents and layout while
662662 being displayed."""
663− unity_proxy = self.launch_unity()
664− unlock_unity(unity_proxy)
663+ self.launch_unity()
664+ unlock_unity()
665665
666666 notify_list = self._get_notifications_list()
667667
@@ -709,8 +709,8 @@ class EphemeralNotificationsTests(NotificationsBase):
709709 """ use the create notification script to get a notification dialog.
710710 Check that the arguments passed to the script match the fields. """
711711
712− unity_proxy = self.launch_unity()
713− unlock_unity(unity_proxy)
712+ self.launch_unity()
713+ unlock_unity()
714714
715715 summary = 'Helper summary'
716716 body = 'Helper body'
tests/copyright/CMakeLists.txt+1−1
@@ -2,5 +2,5 @@
22# Test that all source files contain a copyright header.
33#
44
5−add_test(copyright ${CMAKE_CURRENT_SOURCE_DIR}/check_copyright.sh
5+add_test(Copyright ${CMAKE_CURRENT_SOURCE_DIR}/check_copyright.sh
66 ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
tests/libs/UbuntuGestures/CMakeLists.txt+4−8
@@ -4,17 +4,13 @@ include_directories(
44 )
55
66macro(add_gesture_test CLASSNAME)
7− set(testCommand
8− ${CLASSNAME}TestExec -o ${CMAKE_BINARY_DIR}/test${CLASSNAME}.xml,xunitxml -o -,txt)
9−
10− add_test(NAME test${CLASSNAME} COMMAND ${testCommand})
11−
12− set_tests_properties(test${CLASSNAME} PROPERTIES
13− ENVIRONMENT LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/libs/UbuntuGestures)
14−
157 add_executable(${CLASSNAME}TestExec tst_${CLASSNAME}.cpp)
168 qt5_use_modules(${CLASSNAME}TestExec Test Core Gui Quick)
179 target_link_libraries(${CLASSNAME}TestExec UbuntuGestures)
10+
11+ add_unity8_unittest(${CLASSNAME} ${CLASSNAME}TestExec
12+ ENVIRONMENT LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/libs/UbuntuGestures
13+ )
1814endmacro(add_gesture_test)
1915
2016add_gesture_test(TouchRegistry)
tests/plugins/AccountsService/CMakeLists.txt+5−4
@@ -43,12 +43,13 @@ add_executable(test-accountsservice
4343 )
4444qt5_use_modules(test-accountsservice Core DBus Test)
4545
46−add_test(NAME test-accountsservice
47− COMMAND dbus-test-runner
48− --task ${CMAKE_CURRENT_BINARY_DIR}/mock-server
46+add_unity8_unittest(AccountsService dbus-test-runner
47+ ARG_PREFIX "--parameter"
48+ ARGS
49+ --task $<TARGET_FILE:mock-server>
4950 --task-name server
5051 --ignore-return
51− --task ${CMAKE_CURRENT_BINARY_DIR}/test-accountsservice
52+ --task $<TARGET_FILE:test-accountsservice>
5253 --task-name client
5354 --wait-for org.freedesktop.Accounts
5455 )
tests/plugins/Dash/CMakeLists.txt+10−17
@@ -32,7 +32,7 @@ macro(add_lvwph_test FILENAME TESTNAME)
3232 qt5_use_modules(${TESTNAME}TestExec Test Core Qml)
3333 target_link_libraries(${TESTNAME}TestExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
3434
35− add_binary_qml_test(${TESTNAME} "" "Dash-qml" "")
35+ add_unity8_uitest(${TESTNAME} ${TESTNAME}TestExec DEPENDS Dash-qml)
3636endmacro()
3737
3838add_lvwph_test(listviewwithpageheader ListViewWithPageHeader)
@@ -48,19 +48,16 @@ macro(add_dashview_try_test FILENAME TESTNAME)
4848 qt5_use_modules(${TESTNAME}TestExec Test Core Qml)
4949 target_link_libraries(${TESTNAME}TestExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
5050
51− add_binary_qml_test(${TESTNAME} "" "Dash-qml" "")
51+ add_unity8_uitest(${TESTNAME} ${TESTNAME}TestExec DEPENDS Dash-qml)
5252
53− add_executable(${TESTNAME}tryExec
53+ add_executable(${TESTNAME}TryExec
5454 ${FILENAME}try.cpp
5555 ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/Dash/${FILENAME}.cpp
5656 ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/Dash/abstractdashview.cpp
5757 )
58− qt5_use_modules(${TESTNAME}tryExec Test Core Qml)
59− target_link_libraries(${TESTNAME}tryExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
60− add_custom_target(try${TESTNAME}
61− ${CMAKE_CURRENT_BINARY_DIR}/${TESTNAME}tryExec
62− DEPENDS ${TESTNAME}tryExec Dash-qml
63− )
58+ qt5_use_modules(${TESTNAME}TryExec Test Core Qml)
59+ target_link_libraries(${TESTNAME}TryExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
60+ add_manual_test(${TESTNAME} ${TESTNAME}TryExec DEPENDS Dash-qml)
6461endmacro()
6562
6663add_dashview_try_test(verticaljournal VerticalJournal)
@@ -71,13 +68,9 @@ add_dashview_try_test(organicgrid OrganicGrid)
7168add_executable(CardCreatorTestExec cardcreatortest.cpp)
7269qt5_use_modules(CardCreatorTestExec Test Core Qml)
7370target_link_libraries(CardCreatorTestExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
74−add_binary_qml_test(CardCreator "" "Dash-qml" "QML2_IMPORT_PATH=${CMAKE_BINARY_DIR}/tests/mocks/")
71+add_unity8_uitest(CardCreator CardCreatorTestExec DEPENDS Dash-qml)
7572
7673# plain qml test
77−set(qmltest_DEFAULT_TARGETS qmluitests)
78−set(qmltest_DEFAULT_NO_ADD_TEST TRUE)
79−set(qmltest_DEFAULT_PROPERTIES ENVIRONMENT "LC_ALL=C")
80−add_qml_test(. ScopeStyle IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins)
81−add_qml_test(. ListViewWithPageHeaderQML IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins)
82−add_qml_test(. CardAttributes IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins)
83−add_qml_test(. CroppedImageMinimumSourceSize IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins)
74+foreach(dash_test ScopeStyle ListViewWithPageHeaderQML CardAttributes CroppedImageMinimumSourceSize)
75+ add_unity8_qmltest(. ${dash_test})
76+endforeach()
tests/plugins/Greeter/Unity/Launcher/CMakeLists.txt+4−5
@@ -13,11 +13,6 @@ add_definitions(-DSRCDIR="${CMAKE_CURRENT_SOURCE_DIR}")
1313add_definitions(-DLAUNCHER_TESTING)
1414
1515### LauncherModelASTest
16−set(testModelCommand dbus-test-runner --task ${CMAKE_CURRENT_BINARY_DIR}/launchermodelastestExec
17− --parameter -o --parameter ${CMAKE_BINARY_DIR}/launchermodeltest.xml,xunitxml
18− --parameter -o --parameter -,txt)
19−add_test(NAME launchermodelastest COMMAND ${testModelCommand})
20−add_custom_target(launchermodelastest ${testModelCommand})
2116add_executable(launchermodelastestExec
2217 launchermodelastest.cpp
2318 AccountsServiceDBusAdaptor.cpp
@@ -36,6 +31,10 @@ target_link_libraries(launchermodelastestExec
3631 ${GSETTINGS_QT_LDFLAGS}
3732 )
3833qt5_use_modules(launchermodelastestExec Test Core DBus Gui)
34+add_unity8_unittest(LauncherModelAS dbus-test-runner
35+ ARG_PREFIX "--parameter"
36+ ARGS --task $<TARGET_FILE:launchermodelastestExec>
37+)
3938
4039# copy .desktop files into build directory for shadow builds
4140file(GLOB DESKTOP_FILES *.desktop)
tests/plugins/LightDM/CMakeLists.txt+13−4
@@ -18,7 +18,13 @@ target_include_directories(GreeterDBusTestExec PUBLIC
1818 ${CMAKE_SOURCE_DIR}/plugins/LightDM
1919 ${CMAKE_SOURCE_DIR}/tests/mocks/LightDM
2020 )
21−add_binary_qml_test(GreeterDBus "${CMAKE_BINARY_DIR}/tests/mocks/LightDM/liblightdm" MockLightDM "QML2_IMPORT_PATH=${CMAKE_BINARY_DIR}/tests/mocks")
21+add_unity8_uitest(GreeterDBus dbus-test-runner
22+ ARG_PREFIX "--parameter"
23+ ARGS --task $<TARGET_FILE:GreeterDBusTestExec>
24+ DEPENDS MockLightDM
25+ IMPORT_PATHS ${CMAKE_BINARY_DIR}/tests/mocks
26+ LIGHTDM
27+ )
2228
2329add_executable(GreeterPamTestExec
2430 pam.cpp
@@ -31,8 +37,7 @@ target_link_libraries(GreeterPamTestExec
3137target_include_directories(GreeterPamTestExec PUBLIC
3238 ${CMAKE_SOURCE_DIR}/plugins/LightDM/liblightdm
3339 )
34−add_qmltest_target(testGreeterPam "${CMAKE_CURRENT_BINARY_DIR}/GreeterPamTestExec" TRUE FALSE)
35−add_dependencies(testGreeterPam GreeterPamTestExec)
40+add_qmltest_target(testGreeterPam GreeterPamTestExec COMMAND $<TARGET_FILE:GreeterPamTestExec>)
3641
3742add_executable(GreeterUsersModelTestExec
3843 usersmodel.cpp
@@ -49,4 +54,8 @@ target_include_directories(GreeterUsersModelTestExec PUBLIC
4954 ${CMAKE_SOURCE_DIR}/plugins/Utils
5055 ${CMAKE_SOURCE_DIR}/tests/mocks/LightDM
5156 )
52−add_binary_qml_test(GreeterUsersModel "${CMAKE_BINARY_DIR}/tests/mocks/LightDM/liblightdm" MockLightDM "LIBLIGHTDM_MOCK_MODE=full")
57+add_unity8_uitest(GreeterUsers GreeterUsersModelTestExec
58+ ENVIRONMENT LIBLIGHTDM_MOCK_MODE=full
59+ DEPENDS MockLightDM
60+ LIGHTDM
61+ )
tests/plugins/Ubuntu/Gestures/CMakeLists.txt+22−24
@@ -12,43 +12,41 @@ include_directories(
1212 ${Qt5Gui_PRIVATE_INCLUDE_DIRS}
1313 )
1414
15−file(GLOB qmlFiles *.qml)
16−add_custom_target(UbuntuGesturesTestQmlFiles ALL
17− COMMAND cp ${qmlFiles} ${CMAKE_CURRENT_BINARY_DIR}
18− DEPENDS ${qmlFiles}
19−)
15+export_qmlfiles(UbuntuGesturesTest .)
2016
2117add_definitions(-DUBUNTU_GESTURES_PLUGIN_DIR="${CMAKE_BINARY_DIR}/plugins")
2218add_definitions(-DTESTS_UTILS_MODULES_DIR="${CMAKE_BINARY_DIR}/tests/utils/modules")
2319
24−macro(add_gesture_ui_test CLASSNAME)
20+macro(build_gesture_test CLASSNAME)
2521 add_executable(${CLASSNAME}TestExec tst_${CLASSNAME}.cpp GestureTest.cpp TestItem.cpp)
2622 qt5_use_modules(${CLASSNAME}TestExec Test Core Qml Gui Quick)
2723 target_link_libraries(${CLASSNAME}TestExec UbuntuGesturesQml UbuntuGestures)
24+endmacro()
25+
26+macro(add_gesture_unit_test CLASSNAME)
27+ build_gesture_test(${CLASSNAME})
28+ add_unity8_unittest(${CLASSNAME} ${CLASSNAME}TestExec
29+ ENVIRONMENT LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/plugins/Ubuntu/Gestures
30+ DEPENDS UbuntuGesturesTest-qmlfiles
31+ ${ARGN}
32+ )
33+endmacro()
2834
29− add_binary_qml_test(${CLASSNAME} ${CMAKE_BINARY_DIR}/plugins/Ubuntu/Gestures UbuntuGesturesTestQmlFiles "")
35+macro(add_gesture_ui_test CLASSNAME)
36+ build_gesture_test(${CLASSNAME})
37+ add_unity8_uitest(${CLASSNAME} ${CLASSNAME}TestExec
38+ ENVIRONMENT LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/plugins/Ubuntu/Gestures
39+ DEPENDS UbuntuGesturesTest-qmlfiles
40+ ${ARGN}
41+ )
3042 add_manual_qml_test(. ${CLASSNAME} IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins
3143 ${CMAKE_BINARY_DIR}/tests/utils/modules)
32−endmacro(add_gesture_ui_test)
33−
34−macro(add_gesture_test CLASSNAME)
35− set(testCommand
36− ${CLASSNAME}TestExec -o ${CMAKE_BINARY_DIR}/test${CLASSNAME}.xml,xunitxml -o -,txt)
37−
38− add_test(NAME test${CLASSNAME} COMMAND ${testCommand})
39−
40− set_tests_properties(test${CLASSNAME} PROPERTIES
41− ENVIRONMENT LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/plugins/Ubuntu/Gestures)
42−
43− add_executable(${CLASSNAME}TestExec tst_${CLASSNAME}.cpp)
44− qt5_use_modules(${CLASSNAME}TestExec Test Core)
45− target_link_libraries(${CLASSNAME}TestExec UbuntuGesturesQml)
46−endmacro(add_gesture_test)
44+endmacro()
4745
4846add_gesture_ui_test(DirectionalDragArea)
4947add_gesture_ui_test(FloatingFlickable)
5048add_gesture_ui_test(PressedOutsideNotifier)
5149add_gesture_ui_test(TouchDispatcher)
5250add_gesture_ui_test(TouchGate)
53−add_gesture_test(Damper)
54−add_gesture_test(AxisVelocityCalculator)
51+add_gesture_unit_test(Damper)
52+add_gesture_unit_test(AxisVelocityCalculator)
tests/plugins/Unity/Indicators/CMakeLists.txt+9−12
@@ -17,13 +17,8 @@ macro(indicator_test TEST)
1717 set(multi_value_keywords ADDITIONAL_CPPS ADDITIONAL_LIBS)
1818 cmake_parse_arguments(test "" "" "${multi_value_keywords}" ${ARGN})
1919
20− set(testCommand ${CMAKE_CURRENT_BINARY_DIR}/${TEST}Exec
21− -o ${CMAKE_BINARY_DIR}/${TEST}.xml,xunitxml
22− -o -,txt)
23− add_test(NAME ${TEST} COMMAND ${testCommand})
24− add_custom_target(${TEST} ${testCommand})
2520 add_executable(${TEST}Exec
26− ${TEST}.cpp
21+ ${TEST}Test.cpp
2722 ${test_ADDITIONAL_CPPS}
2823 )
2924 qt5_use_modules(${TEST}Exec Test Core Qml)
@@ -33,11 +28,13 @@ macro(indicator_test TEST)
3328 ${GIO_LIBRARIES}
3429 ${QMENUMODEL_LDFLAGS}
3530 )
31+
32+ add_unity8_unittest(${TEST} ${TEST}Exec)
3633endmacro(indicator_test)
3734
38−indicator_test(indicatorsmanagertest ADDITIONAL_LIBS IndicatorsQml)
39−indicator_test(indicatorsmodeltest ADDITIONAL_LIBS IndicatorsQml)
40−indicator_test(menucontentactivatortest ADDITIONAL_CPPS ${INDICATORS_DIR}/menucontentactivator.cpp)
41−indicator_test(unitymenumodelstacktest ADDITIONAL_CPPS ${TEST_DIR}/mocks/QMenuModel/unitymenumodel.cpp ${INDICATORS_DIR}/unitymenumodelstack.cpp)
42−indicator_test(rootactionstatetest ADDITIONAL_LIBS IndicatorsQml)
43−indicator_test(sharedunitymenumodeltest ADDITIONAL_LIBS IndicatorsQml)
35+indicator_test(IndicatorsManager ADDITIONAL_LIBS IndicatorsQml)
36+indicator_test(IndicatorsModel ADDITIONAL_LIBS IndicatorsQml)
37+indicator_test(MenuContentActivator ADDITIONAL_CPPS ${INDICATORS_DIR}/menucontentactivator.cpp)
38+indicator_test(UnityMenuModelStack ADDITIONAL_CPPS ${TEST_DIR}/mocks/QMenuModel/unitymenumodel.cpp ${INDICATORS_DIR}/unitymenumodelstack.cpp)
39+indicator_test(RootActionState ADDITIONAL_LIBS IndicatorsQml)
40+indicator_test(SharedUnityMenuModel ADDITIONAL_LIBS IndicatorsQml)
tests/plugins/Unity/Indicators/indicatorsmanagertest.cpp → tests/plugins/Unity/Indicators/IndicatorsManagerTest.cpprenamed+1−1
@@ -180,4 +180,4 @@ private Q_SLOTS:
180180};
181181
182182QTEST_GUILESS_MAIN(IndicatorsManagerTest)
183−#include "indicatorsmanagertest.moc"
183+#include "IndicatorsManagerTest.moc"
tests/plugins/Unity/Indicators/indicatorsmodeltest.cpp → tests/plugins/Unity/Indicators/IndicatorsModelTest.cpprenamed+1−1
@@ -138,4 +138,4 @@ private Q_SLOTS:
138138
139139QTEST_GUILESS_MAIN(IndicatorsModelTest)
140140
141−#include "indicatorsmodeltest.moc"
141+#include "IndicatorsModelTest.moc"
tests/plugins/Unity/Indicators/menucontentactivatortest.cpp → tests/plugins/Unity/Indicators/MenuContentActivatorTest.cpprenamed+1−1
@@ -299,4 +299,4 @@ private:
299299};
300300
301301QTEST_GUILESS_MAIN(MenuConentActivatorTest)
302−#include "menucontentactivatortest.moc"
302+#include "MenuContentActivatorTest.moc"
tests/plugins/Unity/Indicators/rootactionstatetest.cpp → tests/plugins/Unity/Indicators/RootActionStateTest.cpprenamed+1−1
@@ -92,4 +92,4 @@ private Q_SLOTS:
9292};
9393
9494QTEST_GUILESS_MAIN(RootActionStateTest)
95−#include "rootactionstatetest.moc"
95+#include "RootActionStateTest.moc"
tests/plugins/Unity/Indicators/sharedunitymenumodeltest.cpp → tests/plugins/Unity/Indicators/SharedUnityMenuModelTest.cpprenamed+1−1
@@ -99,4 +99,4 @@ private Q_SLOTS:
9999};
100100
101101QTEST_GUILESS_MAIN(SharedUnityMenuModelTest)
102−#include "sharedunitymenumodeltest.moc"
102+#include "SharedUnityMenuModelTest.moc"
tests/plugins/Unity/Indicators/unitymenumodelstacktest.cpp → tests/plugins/Unity/Indicators/UnityMenuModelStackTest.cpprenamed+1−1
@@ -205,4 +205,4 @@ public:
205205};
206206
207207QTEST_GUILESS_MAIN(UnityMenuModelStackTest)
208−#include "unitymenumodelstacktest.moc"
208+#include "UnityMenuModelStackTest.moc"
tests/plugins/Unity/Launcher/CMakeLists.txt+5−5
@@ -14,11 +14,6 @@ add_definitions(-DSRCDIR="${CMAKE_CURRENT_SOURCE_DIR}")
1414add_definitions(-DLAUNCHER_TESTING)
1515
1616### LauncherModelTest
17−set(testModelCommand dbus-test-runner --task ${CMAKE_CURRENT_BINARY_DIR}/launchermodeltestExec
18− --parameter -o --parameter ${CMAKE_BINARY_DIR}/launchermodeltest.xml,xunitxml
19− --parameter -o --parameter -,txt)
20−add_test(NAME launchermodeltest COMMAND ${testModelCommand})
21−add_custom_target(launchermodeltest ${testModelCommand})
2217add_executable(launchermodeltestExec
2318 launchermodeltest.cpp
2419 gsettings.cpp
@@ -42,6 +37,11 @@ target_link_libraries(launchermodeltestExec
4237 )
4338qt5_use_modules(launchermodeltestExec Test Core DBus Xml Gui)
4439
40+add_unity8_unittest(LauncherModel dbus-test-runner
41+ ARG_PREFIX "--parameter"
42+ ARGS --task $<TARGET_FILE:launchermodeltestExec>
43+)
44+
4545# copy .desktop files into build directory for shadow builds
4646file(GLOB DESKTOP_FILES *.desktop)
4747
tests/plugins/Unity/Session/CMakeLists.txt+5−5
@@ -9,11 +9,6 @@ add_definitions(-DSRCDIR="${CMAKE_CURRENT_SOURCE_DIR}")
99add_definitions(-DSESSION_TESTING)
1010
1111### SessionBackendTest
12−set(testBackendCommand dbus-test-runner --task ${CMAKE_CURRENT_BINARY_DIR}/sessionbackendtestExec
13− --parameter -o --parameter ${CMAKE_BINARY_DIR}/sessionbackendtest.xml,xunitxml
14− --parameter -o --parameter -,txt)
15−add_test(NAME sessionbackendtest COMMAND ${testBackendCommand})
16−add_custom_target(sessionbackendtest ${testBackendCommand})
1712add_executable(sessionbackendtestExec
1813 sessionbackendtest.cpp
1914 ${CMAKE_SOURCE_DIR}/plugins/Unity/Session/dbusunitysessionservice.cpp
@@ -22,3 +17,8 @@ target_link_libraries(sessionbackendtestExec
2217 unity8-private
2318 )
2419qt5_use_modules(sessionbackendtestExec Test Core Qml DBus)
20+
21+add_unity8_unittest(SessionBackend dbus-test-runner
22+ ARG_PREFIX "--parameter"
23+ ARGS --task $<TARGET_FILE:sessionbackendtestExec>
24+)
tests/plugins/Utils/CMakeLists.txt+12−26
@@ -4,31 +4,17 @@ include_directories(
44 ${CMAKE_CURRENT_BINARY_DIR}
55 )
66
7−macro(run_tests)
8− set(_test_list "")
9− foreach(_test ${ARGN})
10− set(testCommand env "LC_ALL=C.UTF-8" ${CMAKE_CURRENT_BINARY_DIR}/${_test}Exec
11− -o ${CMAKE_BINARY_DIR}/${_test}.xml,xunitxml
12− -o -,txt)
13− add_test(NAME ${_test} COMMAND ${testCommand})
14− add_custom_target(${_test} ${testCommand})
15− add_executable(${_test}Exec ${_test}.cpp modeltest.cpp)
16− qt5_use_modules(${_test}Exec Test Core Qml)
17− target_link_libraries(${_test}Exec
18− Utils-qml
19− )
20− set(_test_list "${_test_list};${_test}")
21− endforeach()
22−endmacro(run_tests)
23−
24−run_tests(
25− qlimitproxymodeltest
26− unitysortfilterproxymodeltest
27− timeformattertest
28− homekeywatchertest
29− )
7+foreach(util_test
8+ QLimitProxyModel
9+ UnitySortFilterProxyModel
10+ TimeFormatter
11+ HomeKeyWatcher
12+)
13+ add_executable(${util_test}TestExec ${util_test}Test.cpp ModelTest.cpp)
14+ qt5_use_modules(${util_test}TestExec Test Core Qml)
15+ target_link_libraries(${util_test}TestExec Utils-qml)
16+ add_unity8_unittest(${util_test} ${util_test}TestExec ADD_TEST)
17+endforeach()
3018
3119# plain qml test
32−set(qmltest_DEFAULT_TARGETS qmltests)
33−set(qmltest_DEFAULT_PROPERTIES ENVIRONMENT "QT_QPA_PLATFORM=minimal")
34−add_qml_test(. UtilsStyle IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins)
20+add_unity8_qmlunittest(. UtilsStyle)
tests/plugins/Utils/homekeywatchertest.cpp → tests/plugins/Utils/HomeKeyWatcherTest.cpprenamed+1−1
@@ -320,4 +320,4 @@ AbstractTimer *FakeTimerFactory::create(QObject *parent)
320320
321321QTEST_GUILESS_MAIN(HomeKeyWatcherTest)
322322
323−#include "homekeywatchertest.moc"
323+#include "HomeKeyWatcherTest.moc"
tests/plugins/Utils/modeltest.cpp → tests/plugins/Utils/ModelTest.cpprenamed+1−1
@@ -47,7 +47,7 @@
4747
4848#include <QtGui/QtGui>
4949
50−#include "modeltest.h"
50+#include "ModelTest.h"
5151
5252#include <QtTest/QtTest>
5353
tests/plugins/Utils/modeltest.h → tests/plugins/Utils/ModelTest.hrenamed

The content is the same.

tests/plugins/Utils/qlimitproxymodeltest.cpp → tests/plugins/Utils/QLimitProxyModelTest.cpprenamed+2−2
@@ -16,7 +16,7 @@
1616
1717// local
1818#include "qlimitproxymodelqml.h"
19−#include "modeltest.h"
19+#include "ModelTest.h"
2020
2121// Qt
2222#include <QTest>
@@ -608,4 +608,4 @@ private Q_SLOTS:
608608
609609QTEST_GUILESS_MAIN(QLimitProxyModelTest)
610610
611−#include "qlimitproxymodeltest.moc"
611+#include "QLimitProxyModelTest.moc"
tests/plugins/Utils/timeformattertest.cpp → tests/plugins/Utils/TimeFormatterTest.cpprenamed+1−11
@@ -45,16 +45,6 @@ private:
4545 }
4646
4747private Q_SLOTS:
48− void initTestCase()
49− {
50− setenv("UNITY_TEST_ENV", "1", 1);
51− }
52−
53− void cleanupTestCase()
54− {
55− unsetenv("UNITY_TEST_ENV");
56− }
57−
5848 void testTimeFormatter_Format_data() { addTestData(QList<int>() << 0); }
5949 void testTimeFormatter_Format()
6050 {
@@ -162,4 +152,4 @@ private Q_SLOTS:
162152
163153QTEST_GUILESS_MAIN(TimeFormatterTest)
164154
165−#include "timeformattertest.moc"
155+#include "TimeFormatterTest.moc"
tests/plugins/Utils/unitysortfilterproxymodeltest.cpp → tests/plugins/Utils/UnitySortFilterProxyModelTest.cpprenamed+2−2
@@ -19,7 +19,7 @@
1919
2020// local
2121#include "unitysortfilterproxymodelqml.h"
22−#include "modeltest.h"
22+#include "ModelTest.h"
2323
2424// Qt
2525#include <QTest>
@@ -287,4 +287,4 @@ private Q_SLOTS:
287287
288288QTEST_GUILESS_MAIN(UnitySortFilterProxyModelTest)
289289
290−#include "unitysortfilterproxymodeltest.moc"
290+#include "UnitySortFilterProxyModelTest.moc"
tests/plugins/Wizard/CMakeLists.txt+2−2
@@ -8,11 +8,11 @@ add_executable(tst-wizard-pagelist
88 ${CMAKE_SOURCE_DIR}/plugins/Wizard/PageList.cpp
99)
1010qt5_use_modules(tst-wizard-pagelist Core Qml Test)
11−add_test(NAME wizardpagelisttest COMMAND env UNITY_TEST_ENV=1 ${CMAKE_CURRENT_BINARY_DIR}/tst-wizard-pagelist)
11+add_unity8_unittest(WizardPageList tst-wizard-pagelist ENVIRONMENT WIZARD_TESTING=1)
1212
1313add_executable(tst-wizard-system
1414 tst_system.cpp
1515 ${CMAKE_SOURCE_DIR}/plugins/Wizard/System.cpp
1616)
1717qt5_use_modules(tst-wizard-system Core DBus Qml Test)
18−add_test(NAME wizardsystemtest COMMAND ${CMAKE_CURRENT_BINARY_DIR}/tst-wizard-system)
18+add_unity8_unittest(WizardSystem tst-wizard-system)
tests/qmltests/CMakeLists.txt+77−94
@@ -1,97 +1,80 @@
1−# add_qml_test macro
2−include(QmlTest)
31
42add_subdirectory(Components)
53
6−set(qmltest_DEFAULT_IMPORT_PATHS
7− ${CMAKE_BINARY_DIR}/plugins
8− ${CMAKE_BINARY_DIR}/tests/utils/modules
9− ${CMAKE_BINARY_DIR}/tests/mocks
10−)
11−
12−set(qmltest_DEFAULT_TARGETS qmlunittests)
13−set(qmltest_DEFAULT_NO_ADD_TEST FALSE)
14−set(qmltest_DEFAULT_PROPERTIES ENVIRONMENT "QT_QPA_PLATFORM=minimal")
15−add_qml_test(utils/Unity/Test UnityTest)
16−add_qml_test(Components PhysicalKeysMapper)
17−
18−set(qmltest_DEFAULT_TARGETS qmluitests)
19−set(qmltest_DEFAULT_NO_ADD_TEST TRUE)
20−set(qmltest_DEFAULT_PROPERTIES ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/libusermetrics:${CMAKE_BINARY_DIR}/tests/mocks/LightDM/liblightdm:${CMAKE_BINARY_DIR}/tests/mocks/QMenuModel")
21−
22−add_qml_test(. OrientedShell)
23−add_qml_test(. Shell)
24−add_qml_test(. ShellWithPin)
25−add_qml_test(Components Background)
26−add_qml_test(Components Carousel)
27−add_qml_test(Components Dialogs)
28−add_qml_test(Components DraggingArea)
29−add_qml_test(Components LazyImage)
30−add_qml_test(Components Lockscreen)
31−add_qml_test(Components Rating)
32−add_qml_test(Components ResponsiveGridView)
33−add_qml_test(Components ResponsiveVerticalJournal IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/plugins)
34−add_qml_test(Components Showable)
35−add_qml_test(Components ZoomableImage)
36−add_qml_test(Dash Dash)
37−add_qml_test(Dash DashContent)
38−add_qml_test(Dash Card)
39−add_qml_benchmark(Dash CardBenchmark 1000)
40−add_qml_test(Dash CardTool)
41−add_qml_test(Dash GenericScopeView)
42−add_qml_test(Dash PageHeader)
43−add_qml_test(Dash PreviewListView)
44−add_qml_test(Dash/Previews Preview)
45−add_qml_test(Dash/Previews PreviewActions)
46−add_qml_test(Dash/Previews PreviewAudioPlayback)
47−add_qml_test(Dash/Previews PreviewExpandable)
48−add_qml_test(Dash/Previews PreviewHeader)
49−add_qml_test(Dash/Previews PreviewImageGallery)
50−add_qml_test(Dash/Previews PreviewPayments)
51−add_qml_test(Dash/Previews PreviewProgress)
52−add_qml_test(Dash/Previews PreviewRatingDisplay)
53−add_qml_test(Dash/Previews PreviewRatingEdit)
54−add_qml_test(Dash/Previews PreviewRatingInput)
55−add_qml_test(Dash/Previews PreviewTable)
56−add_qml_test(Dash/Previews PreviewTextSummary)
57−add_qml_test(Dash/Previews PreviewVideoPlayback)
58−add_qml_test(Dash/Previews PreviewWidgetFactory)
59−add_qml_test(Dash/Previews PreviewZoomableImage)
60−add_qml_test(Dash/ScopeSettings ScopeSettingBoolean)
61−add_qml_test(Dash/ScopeSettings ScopeSettingList)
62−add_qml_test(Dash/ScopeSettings ScopeSettingNumber)
63−add_qml_test(Dash/ScopeSettings ScopeSettingString)
64−add_qml_test(Dash/ScopeSettings ScopeSettingsWidgetFactory)
65−add_qml_test(Greeter Clock)
66−add_qml_test(Greeter Greeter)
67−add_qml_test(Greeter Infographics)
68−add_qml_test(Greeter NarrowView)
69−add_qml_test(Greeter WideView)
70−add_qml_test(Launcher Launcher)
71−add_qml_test(Notifications Notifications)
72−add_qml_test(Notifications VisualSnapDecisionsQueue)
73−add_qml_test(Notifications OptionToggle)
74−add_qml_test(Notifications SwipeToAct)
75−add_qml_test(Panel ActiveCallHint)
76−add_qml_test(Panel IndicatorItem)
77−add_qml_test(Panel IndicatorItemRow)
78−add_qml_test(Panel IndicatorPage)
79−add_qml_test(Panel IndicatorsBar)
80−add_qml_test(Panel IndicatorsMenu)
81−add_qml_test(Panel MenuContent)
82−add_qml_test(Panel Panel)
83−add_qml_test(Panel/Indicators IndicatorsLight ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/QMenuModel")
84−# These MenuItemFactory tests need the test/mocks/ to come before plugins/
85−add_qml_test(Panel/Indicators MenuItemFactory IMPORT_PATHS ${CMAKE_BINARY_DIR}/tests/mocks ${qmltest_DEFAULT_IMPORT_PATHS})
86−add_qml_test(Panel/Indicators MessageMenuItemFactory IMPORT_PATHS ${CMAKE_BINARY_DIR}/tests/mocks ${qmltest_DEFAULT_IMPORT_PATHS})
87−add_qml_test(Stages ApplicationWindow)
88−add_qml_test(Stages DesktopStage)
89−add_qml_test(Stages PhoneStage ENVIRONMENT)
90−add_qml_test(Stages SpreadDelegate ENVIRONMENT)
91−add_qml_test(Stages SurfaceContainer ENVIRONMENT)
92−add_qml_test(Stages SessionContainer ENVIRONMENT)
93−add_qml_test(Stages TabletStage)
94−add_qml_test(Stages WindowMoveResizeArea)
95−add_qml_test(Stages Splash)
96−add_qml_test(Tutorial Tutorial)
97−add_qml_test(Wizard Wizard ENVIRONMENT "OXIDE_NO_SANDBOX=1")
4+add_unity8_qmltest(. OrientedShell)
5+add_unity8_qmltest(. Shell LIGHTDM)
6+add_unity8_qmltest(. ShellWithPin LIGHTDM)
7+add_unity8_qmltest(Components Background)
8+add_unity8_qmltest(Components Carousel)
9+add_unity8_qmltest(Components Dialogs LIGHTDM)
10+add_unity8_qmltest(Components DraggingArea)
11+add_unity8_qmltest(Components LazyImage)
12+add_unity8_qmltest(Components Lockscreen)
13+add_unity8_qmlunittest(Components PhysicalKeysMapper)
14+add_unity8_qmltest(Components Rating)
15+add_unity8_qmltest(Components ResponsiveGridView)
16+add_unity8_qmltest(Components ResponsiveVerticalJournal)
17+add_unity8_qmltest(Components Showable)
18+add_unity8_qmltest(Components ZoomableImage)
19+add_unity8_qmltest(Dash Dash)
20+add_unity8_qmltest(Dash DashContent)
21+add_unity8_qmltest(Dash Card)
22+add_unity8_qmlbenchmark(Dash CardBenchmark 1000)
23+add_unity8_qmltest(Dash CardTool)
24+add_unity8_qmltest(Dash GenericScopeView)
25+add_unity8_qmltest(Dash PageHeader)
26+add_unity8_qmltest(Dash PreviewListView)
27+add_unity8_qmltest(Dash/Previews Preview)
28+add_unity8_qmltest(Dash/Previews PreviewActions)
29+add_unity8_qmltest(Dash/Previews PreviewAudioPlayback)
30+add_unity8_qmltest(Dash/Previews PreviewExpandable)
31+add_unity8_qmltest(Dash/Previews PreviewHeader)
32+add_unity8_qmltest(Dash/Previews PreviewImageGallery)
33+add_unity8_qmltest(Dash/Previews PreviewPayments)
34+add_unity8_qmltest(Dash/Previews PreviewProgress)
35+add_unity8_qmltest(Dash/Previews PreviewRatingDisplay)
36+add_unity8_qmltest(Dash/Previews PreviewRatingEdit)
37+add_unity8_qmltest(Dash/Previews PreviewRatingInput)
38+add_unity8_qmltest(Dash/Previews PreviewTable)
39+add_unity8_qmltest(Dash/Previews PreviewTextSummary)
40+add_unity8_qmltest(Dash/Previews PreviewVideoPlayback)
41+add_unity8_qmltest(Dash/Previews PreviewWidgetFactory)
42+add_unity8_qmltest(Dash/Previews PreviewZoomableImage)
43+add_unity8_qmltest(Dash/ScopeSettings ScopeSettingBoolean)
44+add_unity8_qmltest(Dash/ScopeSettings ScopeSettingList)
45+add_unity8_qmltest(Dash/ScopeSettings ScopeSettingNumber)
46+add_unity8_qmltest(Dash/ScopeSettings ScopeSettingString)
47+add_unity8_qmltest(Dash/ScopeSettings ScopeSettingsWidgetFactory)
48+add_unity8_qmltest(Greeter Clock)
49+add_unity8_qmltest(Greeter Greeter LIGHTDM)
50+add_unity8_qmltest(Greeter Infographics LIGHTDM)
51+add_unity8_qmltest(Greeter NarrowView LIGHTDM)
52+add_unity8_qmltest(Greeter WideView LIGHTDM)
53+add_unity8_qmltest(Launcher Launcher)
54+add_unity8_qmltest(Notifications Notifications)
55+add_unity8_qmltest(Notifications VisualSnapDecisionsQueue)
56+add_unity8_qmltest(Notifications OptionToggle)
57+add_unity8_qmltest(Notifications SwipeToAct)
58+add_unity8_qmltest(Panel ActiveCallHint)
59+add_unity8_qmltest(Panel IndicatorItem)
60+add_unity8_qmltest(Panel IndicatorItemRow)
61+add_unity8_qmltest(Panel IndicatorPage)
62+add_unity8_qmltest(Panel IndicatorsBar)
63+add_unity8_qmltest(Panel IndicatorsMenu)
64+add_unity8_qmltest(Panel MenuContent)
65+add_unity8_qmltest(Panel Panel)
66+add_unity8_qmltest(Panel/Indicators IndicatorsLight)
67+add_unity8_qmltest(Panel/Indicators MenuItemFactory)
68+add_unity8_qmltest(Panel/Indicators MessageMenuItemFactory)
69+add_unity8_qmltest(Stages ApplicationWindow)
70+add_unity8_qmltest(Stages DesktopStage)
71+add_unity8_qmltest(Stages PhoneStage)
72+add_unity8_qmltest(Stages SpreadDelegate)
73+add_unity8_qmltest(Stages SurfaceContainer)
74+add_unity8_qmltest(Stages SessionContainer)
75+add_unity8_qmltest(Stages TabletStage)
76+add_unity8_qmltest(Stages WindowMoveResizeArea)
77+add_unity8_qmltest(Stages Splash)
78+add_unity8_qmltest(Tutorial Tutorial LIGHTDM)
79+add_unity8_qmltest(Wizard Wizard ENVIRONMENT "OXIDE_NO_SANDBOX=1")
80+add_unity8_qmlunittest(utils/Unity/Test UnityTest)
tests/qmltests/Components/CMakeLists.txt+4−10
@@ -16,19 +16,13 @@ add_executable(DragHandleTestExec tst_DragHandle.cpp)
1616qt5_use_modules(DragHandleTestExec Test Core Qml Gui Quick)
1717target_link_libraries(DragHandleTestExec UbuntuGesturesQml UbuntuGestures)
1818
19−add_binary_qml_test(DragHandle ${CMAKE_BINARY_DIR}/plugins/Ubuntu/Gestures "" "")
20−add_manual_qml_test(. DragHandle IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${CMAKE_BINARY_DIR}/tests/utils/modules)
19+add_unity8_uitest(DragHandle DragHandleTestExec ENVIRONMENT LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/plugins/Ubuntu/Gestures)
20+add_manual_qml_test(. DragHandle IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${CMAKE_BINARY_DIR}/tests/utils/modules)
2121
22−########## tst_EdgeDragEvaluator
23−
24−include_directories(
25− ${CMAKE_SOURCE_DIR}/plugins/Ubuntu/Gestures
26− ${CMAKE_SOURCE_DIR}/libs/UbuntuGestures
27− ${CMAKE_CURRENT_BINARY_DIR}
28− )
2922
23+########## tst_EdgeDragEvaluator
3024add_executable(EdgeDragEvaluatorTestExec tst_EdgeDragEvaluator.cpp)
3125qt5_use_modules(EdgeDragEvaluatorTestExec Test Core Qml Gui Quick)
3226target_link_libraries(EdgeDragEvaluatorTestExec UbuntuGesturesQml UbuntuGestures)
3327
34−add_binary_qml_test(EdgeDragEvaluator ${CMAKE_BINARY_DIR}/plugins/Ubuntu/Gestures "" "")
28+add_unity8_uitest(EdgeDragEvaluator EdgeDragEvaluatorTestExec ENVIRONMENT LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/plugins/Ubuntu/Gestures)
tests/qmltests/Dash/Previews/tst_PreviewHeader.qml+30
@@ -38,6 +38,22 @@ Rectangle {
3838 "attributes": [{"value":"text1","icon":"image://theme/ok"},{"value":"text2","icon":"image://theme/cancel"}]
3939 }
4040
41+ property var brokenheaderjson: {
42+ "title": "THE TITLE",
43+ "subtitle": "Something catchy",
44+ "mascot": "bad_path",
45+ "fallback": "",
46+ "attributes": [{"value":"text1","icon":"image://theme/ok"},{"value":"text2","icon":"image://theme/cancel"}]
47+ }
48+
49+ property var fallbackheaderjson: {
50+ "title": "THE TITLE",
51+ "subtitle": "Something catchy",
52+ "mascot": "bad_path2",
53+ "fallback": "../graphics/play_button.png",
54+ "attributes": [{"value":"text1","icon":"image://theme/ok"},{"value":"text2","icon":"image://theme/cancel"}]
55+ }
56+
4157 PreviewHeader {
4258 id: previewHeader
4359 widgetData: headerjson
@@ -121,5 +137,19 @@ Rectangle {
121137 compare(innerPreviewHeader.subtitle, "Something catchy");
122138 compare(innerPreviewHeader.mascot.toString().slice(-24), "graphics/play_button.png");
123139 }
140+
141+ function test_fallback() {
142+ previewHeader.widgetData = brokenheaderjson;
143+ tryCompareFunction(function() { return findChild(previewHeader, "mascotShape") != null }, true);
144+ var mascot = findChild(previewHeader, "mascotShape");
145+ compare(mascot.visible, false);
146+
147+ previewHeader.widgetData = {};
148+ previewHeader.widgetData = fallbackheaderjson;
149+ tryCompareFunction(function() { return findChild(previewHeader, "mascotShape") != null }, true);
150+ var mascot = findChild(previewHeader, "mascotShape");
151+ tryCompare(mascot, "visible", true);
152+ tryCompare(mascot.image, "status", Image.Ready);
153+ }
124154 }
125155}
tests/qmltests/Dash/Previews/tst_PreviewImageGallery.qml+21−1
@@ -33,10 +33,21 @@ Rectangle {
3333 "sources": [
3434 "../../graphics/phone_background.jpg",
3535 "../../graphics/tablet_background.jpg",
36− "../../graphics/clock@18.png"
36+ "../../graphics/clock@18.png",
37+ "../../graphics/borked"
3738 ]
3839 }
3940
41+ property var sourcesModel1WithFallback: {
42+ "sources": [
43+ "../../graphics/phone_background.jpg",
44+ "../../graphics/tablet_background.jpg",
45+ "../../graphics/clock@18.png",
46+ "../../graphics/borked"
47+ ]
48+ , "fallback": "../../graphics/clock@18.png"
49+ }
50+
4051 PreviewImageGallery {
4152 id: imageGallery
4253 width: parent.width
@@ -103,5 +114,14 @@ Rectangle {
103114 tryCompare(overlayListView, "currentIndex", data.index);
104115 verify(image.source === overlayListView.currentItem.source);
105116 }
117+
118+ function test_fallback() {
119+ var image3 = findChild(imageGallery, "previewImage3");
120+ tryCompare(image3, "state", "error");
121+ imageGallery.widgetData = sourcesModel0;
122+ imageGallery.widgetData = sourcesModel1WithFallback;
123+ image3 = findChild(imageGallery, "previewImage3");
124+ tryCompare(image3, "state", "ready");
125+ }
106126 }
107127}
tests/qmltests/Dash/Previews/tst_PreviewZoomableImage.qml+27−6
@@ -26,7 +26,7 @@ Rectangle {
2626 color: "lightgrey"
2727
2828 property var widgetData0: {
29− "source": Qt.resolvedUrl("../artwork/checkers.png"),
29+ "source": "../../graphics/phone_background.jpg",
3030 "zoomable": false
3131 }
3232
@@ -34,21 +34,35 @@ Rectangle {
3434 "source": ""
3535 }
3636
37− PreviewZoomableImage {
38− id: zoomableImage
37+ property var widgetData2: {
38+ "source": "fadsasf",
39+ "fallback": "../../graphics/phone_background.jpg"
40+ }
41+
42+ Loader {
43+ id: loader
3944 anchors.centerIn: parent
40− widgetData: widgetData0
45+ sourceComponent: PreviewZoomableImage {
46+ widgetData: widgetData0
47+ }
4148 }
4249
50+ property alias zoomableImage: loader.item
51+
4352 UT.UnityTestCase {
4453 name: "PreviewZoomableImageTest"
4554 when: windowShown
4655
47− property Item lazyImage: findChild(zoomableImage, "lazyImage");
48− property Item overlay: findChild(zoomableImage.rootItem, "overlay");
56+ property Item lazyImage
57+ property Item overlay
4958
5059 function init() {
60+ // Use a loader so we start from scratch each time
61+ loader.active = false;
62+ loader.active = true;
63+ lazyImage = findChild(zoomableImage, "lazyImage");
5164 waitForRendering(zoomableImage);
65+ overlay = findChild(zoomableImage.rootItem, "overlay");
5266 waitForRendering(overlay);
5367 }
5468
@@ -79,5 +93,12 @@ Rectangle {
7993 mouseClick(overlayCloseButton);
8094 tryCompare(overlay, "visible", false);
8195 }
96+
97+ function test_fallback() {
98+ zoomableImage.widgetData = widgetData2;
99+ waitForRendering(zoomableImage);
100+ waitForRendering(lazyImage);
101+ tryCompare(lazyImage, "state", "ready");
102+ }
82103 }
83104}
tests/qmltests/Dash/tst_Card.qml+30
@@ -223,6 +223,7 @@ Rectangle {
223223 property Item mascotImage: findChild(card, "mascotImage");
224224
225225 function init() {
226+ cardTool.components = Qt.binding(function() { return Helpers.update(JSON.parse(Helpers.defaultLayout), Helpers.tryParse(layoutArea.text, layoutError))['components']; });
226227 loader.visible = true;
227228 }
228229
@@ -423,6 +424,7 @@ Rectangle {
423424 ];
424425 }
425426
427+
426428 function test_background(data) {
427429 selector.selectedIndex = data.index;
428430 waitForRendering(selector);
@@ -453,6 +455,34 @@ Rectangle {
453455 }
454456 }
455457
458+ function test_fallback() {
459+ selector.selectedIndex = 0;
460+ waitForRendering(card);
461+
462+ card.cardData["art"] = "somethingbroken";
463+ card.cardDataChanged();
464+ waitForRendering(card);
465+ tryCompare(art, "visible", false);
466+
467+ cardTool.components["art"]["fallback"] = Qt.resolvedUrl("artwork/emblem.png");
468+ cardTool.componentsChanged();
469+ card.cardData["art"] = "somethingbroken";
470+ card.cardDataChanged();
471+ waitForRendering(card);
472+ tryCompare(art, "visible", true);
473+
474+ card.cardData["mascot"] = "somethingbroken2";
475+ card.cardDataChanged();
476+ compare(mascotImage.image.status, Image.Error);
477+
478+ cardTool.components["mascot"] = {"fallback": Qt.resolvedUrl("artwork/emblem.png")};
479+ cardTool.componentsChanged();
480+ card.cardData["mascot"] = "somethingbroken2";
481+ card.cardDataChanged();
482+ waitForRendering(card);
483+ tryCompare(mascotImage.image, "status", Image.Ready);
484+ }
485+
456486 function test_font_weights_data() {
457487 return [
458488 { tag: "Title only", index: 8, weight: Font.Normal },
tests/qmltests/Stages/tst_PhoneStage.qml+19
@@ -346,6 +346,25 @@ Item {
346346 tryCompare(spreadView, "contentX", -spreadView.shift)
347347 }
348348
349+ function test_cantAccessPhoneStageWhileRightEdgeGesture() {
350+ var spreadView = findChild(phoneStage, "spreadView");
351+ var eventEaterArea = findChild(phoneStage, "eventEaterArea")
352+
353+ var startX = phoneStage.width - 2;
354+ var startY = phoneStage.height / 2;
355+ var endY = startY;
356+ var endX = phoneStage.width / 2;
357+
358+ touchFlick(phoneStage, startX, startY, endX, endY,
359+ true /* beginTouch */, false /* endTouch */, units.gu(10), 50);
360+
361+ compare(eventEaterArea.enabled, true);
362+
363+ touchRelease(phoneStage, endX, endY);
364+
365+ compare(eventEaterArea.enabled, false);
366+ }
367+
349368 function test_leftEdge_data() {
350369 return [
351370 { tag: "normal", inSpread: false, leftEdgeDragWidth: units.gu(5), shouldMoveApp: true },
tests/qmltests/Stages/tst_WindowMoveResizeArea.qml+1
@@ -70,6 +70,7 @@ Item {
7070 }
7171
7272 UT.UnityTestCase {
73+ name: "WindowMoveResizeArea"
7374 when: windowShown
7475
7576 function init() {
tests/qmltests/tst_Shell.qml+14−17
@@ -83,7 +83,7 @@ Rectangle {
8383 Shell {
8484 property string shellMode: "full-greeter" /* default */
8585
86− usageScenario: "phone"
86+ usageScenario: usageScenarioSelector.model[usageScenarioSelector.selectedIndex]
8787 orientation: Qt.PortraitOrientation
8888 primaryOrientation: Qt.PortraitOrientation
8989 nativeOrientation: Qt.PortraitOrientation
@@ -151,14 +151,11 @@ Rectangle {
151151 }
152152 }
153153 ListItem.ItemSelector {
154− id: usageModeSelector
154+ id: usageScenarioSelector
155155 anchors { left: parent.left; right: parent.right }
156156 activeFocusOnPress: false
157− text: "Usage mode"
158− model: ["Staged", "Windowed"]
159− onSelectedIndexChanged: {
160− GSettingsController.setUsageMode(model[selectedIndex]);
161− }
157+ text: "Usage scenario"
158+ model: ["phone", "tablet", "desktop"]
162159 }
163160 MouseTouchEmulationCheckbox {
164161 id: mouseEmulation
@@ -725,7 +722,7 @@ Rectangle {
725722
726723 tryCompare(webApp.session.surface, "activeFocus", true);
727724
728− GSettingsController.setUsageMode("Windowed");
725+ shell.usageScenario = "desktop";
729726
730727 // check that the desktop stage and window have been loaded
731728 {
@@ -735,7 +732,7 @@ Rectangle {
735732
736733 tryCompare(webApp.session.surface, "activeFocus", true);
737734
738− GSettingsController.setUsageMode("Staged");
735+ shell.usageScenario = "tablet";
739736
740737 // check that the tablet stage and app surface delegate have been loaded
741738 {
@@ -1205,30 +1202,30 @@ Rectangle {
12051202
12061203 function test_stageLoader_data() {
12071204 return [
1208− {tag: "phone", source: "Stages/PhoneStage.qml", formFactor: "phone", usageMode: "Staged"},
1209− {tag: "tablet", source: "Stages/TabletStage.qml", formFactor: "tablet", usageMode: "Staged"},
1210− {tag: "desktop", source: "Stages/DesktopStage.qml", formFactor: "tablet", usageMode: "Windowed"}
1205+ {tag: "phone", source: "Stages/PhoneStage.qml", formFactor: "phone", usageScenario: "phone"},
1206+ {tag: "tablet", source: "Stages/TabletStage.qml", formFactor: "tablet", usageScenario: "tablet"},
1207+ {tag: "desktop", source: "Stages/DesktopStage.qml", formFactor: "tablet", usageScenario: "desktop"}
12111208 ]
12121209 }
12131210
12141211 function test_stageLoader(data) {
1215− GSettingsController.setUsageMode(data.usageMode);
12161212 loadShell(data.formFactor);
1213+ shell.usageScenario = data.usageScenario;
12171214 var stageLoader = findChild(shell, "applicationsDisplayLoader");
12181215 verify(String(stageLoader.source).indexOf(data.source) >= 0);
12191216 }
12201217
12211218 function test_launcherInverted_data() {
12221219 return [
1223− {tag: "phone", formFactor: "phone", usageMode: "Staged", launcherInverted: true},
1224− {tag: "tablet", formFactor: "tablet", usageMode: "Staged", launcherInverted: true},
1225− {tag: "desktop", formFactor: "tablet", usageMode: "Windowed", launcherInverted: false}
1220+ {tag: "phone", formFactor: "phone", usageScenario: "phone", launcherInverted: true},
1221+ {tag: "tablet", formFactor: "tablet", usageScenario: "tablet", launcherInverted: true},
1222+ {tag: "desktop", formFactor: "tablet", usageScenario: "desktop", launcherInverted: false}
12261223 ]
12271224 }
12281225
12291226 function test_launcherInverted(data) {
1230− GSettingsController.setUsageMode(data.usageMode);
12311227 loadShell(data.formFactor);
1228+ shell.usageScenario = data.usageScenario;
12321229
12331230 var launcher = findChild(shell, "launcher");
12341231 compare(launcher.inverted, data.launcherInverted);
tests/qmltests/utils/Unity/Test/tst_UnityTest.qml+5−8
@@ -20,6 +20,8 @@ import QtTest 1.0
2020import Unity.Test 0.1
2121
2222TestCase {
23+ name: "UnityTest"
24+
2325 Rectangle {
2426 id: rect
2527 }
@@ -28,28 +30,23 @@ TestCase {
2830 id: testObject
2931 }
3032
31− // Singletons need to be bound to a property and not-named-imported
32− // for them to be able to be properly passed back to C++.
33− // See https://bugreports.qt-project.org/browse/QTBUG-30730
34− property var util: Util
35−
3633 function test_direct() {
3734 compare(Util.isInstanceOf(rect, "QQuickRectangle"), true, "rect should be an instance of QQuickRectangle");
38− compare(Util.isInstanceOf(util, "TestUtil"), true, "Util should be an instance of TestUtil");
35+ compare(Util.isInstanceOf(Util, "TestUtil"), true, "Util should be an instance of TestUtil");
3936 compare(Util.isInstanceOf(testObject, "MockObjectForInstanceOfTestChild"), true, "testObject should be an instance of MockObjectForInstanceOfTestChild");
4037 }
4138
4239 function test_inherited() {
4340 compare(Util.isInstanceOf(rect, "QQuickItem"), true, "rect should be an instance of QQuickItem");
4441 compare(Util.isInstanceOf(rect, "QObject"), true, "rect should be an instance of QObject");
45− compare(Util.isInstanceOf(util, "QObject"), true, "Util should be an instance of QObject");
42+ compare(Util.isInstanceOf(Util, "QObject"), true, "Util should be an instance of QObject");
4643 compare(Util.isInstanceOf(testObject, "MockObjectForInstanceOfTest"), true, "testObject should be an instance of MockObjectForInstanceOfTest");
4744 compare(Util.isInstanceOf(testObject, "QQuickRectangle"), true, "testObject should be an instance of QQuickRectangle");
4845 }
4946
5047 function test_negative() {
5148 compare(Util.isInstanceOf(rect, "QQuickMouseArea"), false, "rect should not be an instance of MouseArea");
52− compare(Util.isInstanceOf(util, "QQuickItem"), false, "Util should not be an instance of QQuickItem");
49+ compare(Util.isInstanceOf(Util, "QQuickItem"), false, "Util should not be an instance of QQuickItem");
5350 }
5451
5552 function test_undefined() {
tests/whitespace/CMakeLists.txt+1−1
@@ -2,4 +2,4 @@
22# Test that all source files, cmakefiles, etc. do not contain trailing whitespace.
33#
44
5−add_test(whitespace ${CMAKE_CURRENT_SOURCE_DIR}/check_whitespace.py ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
5+add_test(Whitespace ${CMAKE_CURRENT_SOURCE_DIR}/check_whitespace.py ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})