Merge lp:~unity-team/unity8/refactor-qmltests into lp:unity8

Proposed by Michał Sawicz
Status: Superseded
Proposed branch: lp:~unity-team/unity8/refactor-qmltests
Merge into: lp:unity8
Prerequisite: lp:~aacid/unity8/more_stable_lvwpht
Diff against target: 1581 lines (+635/-478)
34 files modified
CMakeLists.txt (+9/-0)
cmake/modules/QmlPlugins.cmake (+1/-3)
cmake/modules/QmlTest.cmake (+308/-214)
plugins/Wizard/PageList.cpp (+1/-1)
runtests.sh (+1/-1)
tests/CMakeLists.txt (+122/-10)
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 (+23/-25)
tests/plugins/Unity/Indicators/CMakeLists.txt (+9/-12)
tests/plugins/Unity/Indicators/IndicatorsManagerTest.cpp (+1/-1)
tests/plugins/Unity/Indicators/IndicatorsModelTest.cpp (+1/-1)
tests/plugins/Unity/Indicators/MenuContentActivatorTest.cpp (+1/-1)
tests/plugins/Unity/Indicators/RootActionStateTest.cpp (+1/-1)
tests/plugins/Unity/Indicators/SharedUnityMenuModelTest.cpp (+1/-1)
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 (+1/-1)
tests/plugins/Utils/ModelTest.cpp (+1/-1)
tests/plugins/Utils/QLimitProxyModelTest.cpp (+2/-2)
tests/plugins/Utils/TimeFormatterTest.cpp (+1/-11)
tests/plugins/Utils/UnitySortFilterProxyModelTest.cpp (+2/-2)
tests/plugins/Wizard/CMakeLists.txt (+2/-2)
tests/qmltests/CMakeLists.txt (+76/-93)
tests/qmltests/Components/CMakeLists.txt (+4/-10)
tests/qmltests/Stages/tst_WindowMoveResizeArea.qml (+1/-0)
tests/qmltests/utils/Unity/Test/tst_UnityTest.qml (+5/-8)
tests/whitespace/CMakeLists.txt (+1/-1)
To merge this branch: bzr merge lp:~unity-team/unity8/refactor-qmltests
Reviewer Review Type Date Requested Status
Michael Zanetti (community) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Albert Astals Cid (community) Abstain
Review via email: mp+257835@code.launchpad.net

This proposal has been superseded by a proposal from 2015-05-27.

Commit message

Refactor QmlTest.cmake module so that all tests can go through it.
Also a bit of cleanup around tests.

ARTIFACTS_DIR directs xunitxml output to that dir
QUIET_LOGGER lets you disable stdout logging

Description of the change

* Are there any related MPs required for this MP to build/function as expected? Please list.
Prerequisite
 * Did you perform an exploratory manual test run of your code change and any related functionality?
Y
 * Did you make sure that your branch does not contain spurious tags?
Y
 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A
 * If you changed the UI, has there been a design review?
N/A

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1762. By Michał Sawicz

Make gdb and xvfb-run optional

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1763. By Michał Sawicz

Transition gesture tests to new macros

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1764. By Michał Sawicz

PageList only wants testing env in the unit test.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1765. By Michał Sawicz

GreeterDBus test needs dbus.

1766. By Michał Sawicz

Drop quotes

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

function(add_qml_unittest PATH COMPONENT_NAME)
import_executables(qmlscene)

Should this be qmltestrunner?

Also the docu is add_manual_qml_test instead of add_qml_unittest?

review: Needs Information
1767. By Michał Sawicz

Refactor library and import path handling

1768. By Michał Sawicz

Add testcase name in tst_WindowMoveResizeArea.qml

1769. By Michał Sawicz

Add LIGHTDM where needed

1770. By Michał Sawicz

Fix add_qml_unittest.

1771. By Michał Sawicz

Drop unneeded qmltestrunner import

Revision history for this message
Michał Sawicz (saviq) wrote :

W dniu 01.05.2015 o 11:41, Albert Astals Cid pisze:
> Should this be qmltestrunner?

Yup.

> Also the docu is add_manual_qml_test instead of add_qml_unittest?

Fixed.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1772. By Michał Sawicz

Add UnityTest name

1773. By Michał Sawicz

Singleton bug is fixed.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1774. By Michał Sawicz

Use CMAKE_LIBRARY_ARCHITECTURE instead of asking gcc

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

Text conflict in runtests.sh
Text conflict in tests/plugins/Ubuntu/Gestures/CMakeLists.txt
Text conflict in tests/qmltests/Components/CMakeLists.txt
3 conflicts encountered.

review: Needs Fixing
1775. By Albert Astals Cid

Merge lp:unity8

Revision history for this message
Albert Astals Cid (aacid) wrote :

> Text conflict in runtests.sh
> Text conflict in tests/plugins/Ubuntu/Gestures/CMakeLists.txt
> Text conflict in tests/qmltests/Components/CMakeLists.txt
> 3 conflicts encountered.

Merged

1776. By Albert Astals Cid

We never need to ld library path the qmenumodel

Revision history for this message
Albert Astals Cid (aacid) :
review: Abstain
Revision history for this message
Albert Astals Cid (aacid) wrote :

After speaking with Michael we decided to leave the possible refactoring for dbus-test-runner tests for later

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

success!

looks good to me.

 * Did you perform an exploratory manual test run of the code change and any related functionality?

just test changes, jenkins tested them

 * Did CI run pass? If not, please explain why.

unrelated AP failures :/

 * Did you make sure that the branch does not contain spurious tags?

yes

review: Approve
1777. By Albert Astals Cid

Merge unity8

1778. By Albert Astals Cid

Merge oxide_regression_workaround

1779. By Michael Zanetti

merge trunk

1780. By Michael Zanetti

fix bad merge

1781. By Michael Zanetti

merge with trunk

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2015-03-12 13:59:07 +0000
3+++ CMakeLists.txt 2015-05-27 14:12:22 +0000
4@@ -113,6 +113,14 @@
5 ${CMAKE_BINARY_DIR}/include
6 )
7
8+set(ARTIFACTS_DIR "" CACHE PATH "Store test artifacts in this directory.")
9+
10+# Quiet logger
11+set(QUIET_LOGGER OFF CACHE BOOL "Disable test output on stdout.")
12+if(NOT QUIET_LOGGER)
13+ set(STDOUT_LOGGER "-o" "-,txt")
14+endif()
15+
16 # add subdirectories to build
17 add_subdirectory(include)
18 add_subdirectory(libs)
19@@ -121,6 +129,7 @@
20 add_subdirectory(qml)
21
22 # Tests
23+set(NO_TESTS OFF CACHE BOOL "Disable tests.")
24 if (NOT NO_TESTS)
25 include(CTest)
26 enable_testing()
27
28=== modified file 'cmake/modules/QmlPlugins.cmake'
29--- cmake/modules/QmlPlugins.cmake 2014-06-26 08:26:58 +0000
30+++ cmake/modules/QmlPlugins.cmake 2015-05-27 14:12:22 +0000
31@@ -107,8 +107,6 @@
32 set(multi TARGETS)
33 cmake_parse_arguments(QMLPLUGIN "${options}" "${single}" "${multi}" ${ARGN})
34
35- get_target_property(qmlplugindump_executable qmlplugindump LOCATION)
36-
37 if(QMLPLUGIN_BINARY_DIR)
38 set(qmlplugin_dir ${QMLPLUGIN_BINARY_DIR}/${PATH})
39 else()
40@@ -127,7 +125,7 @@
41 set(qmltypes_path ${CMAKE_CURRENT_SOURCE_DIR}/${plugin_suffix}.qmltypes)
42
43 add_custom_target(${target_prefix}-qmltypes
44- COMMAND env ${QMLPLUGIN_ENVIRONMENT} ${qmlplugindump_executable} -notrelocatable
45+ COMMAND env ${QMLPLUGIN_ENVIRONMENT} $<TARGET_FILE:qmlplugindump> -notrelocatable
46 ${PLUGIN} ${VERSION} ${QMLPLUGIN_MODULE_DIR} > ${qmltypes_path}
47 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
48 )
49
50=== modified file 'cmake/modules/QmlTest.cmake'
51--- cmake/modules/QmlTest.cmake 2015-04-29 08:14:58 +0000
52+++ cmake/modules/QmlTest.cmake 2015-05-27 14:12:22 +0000
53@@ -1,218 +1,312 @@
54-# add_qml_test(path component_name [NO_ADD_TEST] [NO_TARGETS]
55-# [TARGETS target1 [target2 [...]]]
56-# [IMPORT_PATHS import_path1 [import_path2 [...]]
57-# [PROPERTIES prop1 value1 [prop2 value2 [...]]])
58-#
59-# NO_ADD_TEST will prevent adding the test to the "test" target
60-# NO_TARGETS will prevent adding the test to any targets
61-# TARGETS lists the targets the test should be added to
62-# IMPORT_PATHS will pass those paths to qmltestrunner as "-import" arguments
63-# PROPERTIES will be set on the target and test target. See CMake's set_target_properties()
64+# If you need to override the qmlscene or qmltestrunner executables,
65+# create the corresponding executable target.
66+
67+# These functions respect the global STDOUT_LOGGER and ARTIFACTS_DIR variables.
68+
69+# You can use those with cmake_parse_arguments
70+# if you need to wrap and mangle arguments.
71+set(QMLTEST_OPTIONS ADD_TEST CACHE INTERNAL "")
72+set(QMLTEST_SINGLE ITERATIONS ARG_PREFIX CACHE INTERNAL "")
73+set(QMLTEST_MULTI ARGS ENVIRONMENT DEPENDS IMPORT_PATHS TARGETS CACHE INTERNAL "")
74+
75+# import_executables(name1 [name2 [...]]
76+# [OPTIONAL] # continue when not found
77+# )
78+#
79+# This will find the named executables and import them
80+# to an imported target of the same name.
81+
82+function(import_executables)
83+ cmake_parse_arguments(QMLTEST "OPTIONAL" "" "" ${ARGN})
84+
85+ foreach(NAME ${QMLTEST_UNPARSED_ARGUMENTS})
86+ if(NOT TARGET ${NAME})
87+ add_executable(${NAME} IMPORTED GLOBAL)
88+ find_program(${NAME}_exe ${NAME})
89+
90+ if(NOT QMLTEST_OPTIONAL AND NOT ${NAME}_exe)
91+ message(FATAL_ERROR "Could not locate ${NAME}.")
92+ elseif(NOT ${NAME}_exe)
93+ message(STATUS "Could not locate ${NAME}, skipping.")
94+ else()
95+ set_target_properties(${NAME} PROPERTIES IMPORTED_LOCATION ${${NAME}_exe})
96+ endif()
97+ endif()
98+ endforeach()
99+endfunction()
100+
101+
102+# add_qml_test(path component_name
103+# [...]
104+# )
105+#
106+# Add test targets for ${component_name} under ${path}. It's assumed
107+# that the test file is named ${path}/tst_${component_name}.qml.
108+#
109+# This function wraps add_manual_qml_test and add_qml_unittest,
110+# see below for available arguments.
111+
112+function(add_qml_test PATH COMPONENT_NAME)
113+ cmake_parse_arguments(QMLTEST "${QMLTEST_OPTIONS}" "${QMLTEST_SINGLE}" "${QMLTEST_MULTI}" ${ARGN})
114+ mangle_arguments()
115+
116+ add_qml_unittest(${ARGV})
117+ add_manual_qml_test(${ARGV})
118+endfunction()
119+
120+
121+# add_qml_unittest(path component_name
122+# [...]
123+# )
124+#
125+# Add test targets for ${component_name} under ${path}. It's assumed
126+# that the test file is named ${path}/tst_${component_name}.qml.
127+#
128+# This function wraps add_executable_test, see below for available arguments.
129+
130+function(add_qml_unittest PATH COMPONENT_NAME)
131+ import_executables(qmltestrunner)
132+
133+ add_executable_test(${COMPONENT_NAME} qmltestrunner
134+ ${ARGN}
135+ ARGS -input ${CMAKE_CURRENT_SOURCE_DIR}/${PATH}/tst_${COMPONENT_NAME}.qml ${QMLTEST_ARGS}
136+ )
137+endfunction()
138+
139+
140+# add_manual_qml_test(path component_name
141+# [...]
142+# )
143+#
144+# Add manual test targets for ${component_name} under ${path}. It's assumed
145+# that the test file is named ${path}/tst_${component_name}.qml.
146+#
147+# This function wraps add_manual_test, see below for available arguments.
148+
149+function(add_manual_qml_test PATH COMPONENT_NAME)
150+ import_executables(qmlscene)
151+ cmake_parse_arguments(QMLTEST "${QMLTEST_OPTIONS}" "${QMLTEST_SINGLE}" "${QMLTEST_MULTI}" ${ARGN})
152+
153+ add_manual_test(${COMPONENT_NAME} qmlscene
154+ ${ARGN}
155+ ARGS ${CMAKE_CURRENT_SOURCE_DIR}/${PATH}/tst_${COMPONENT_NAME}.qml ${QMLTEST_ARGS}
156+ )
157+endfunction()
158+
159+
160+# add_executable_test(target component_name
161+# [...] # see doc for add_manual_qml_test for common arguments
162+# [ADD_TEST] # whether to add to the "test" target
163+# [ARG_PREFIX arg_prefix] # prefix logging arguments with this string
164+# [ARGS] arg1 [arg2 [...]] # pass these arguments to the test executable
165+# [TARGETS target1 [target2 [...]]] # make the listed targets depend on this test
166+# # if a corresponding xvfbtarget1, xvfbtarget2 etc. exists,
167+# # this test running under xvfb will be added as a dependency
168+# # of those targets
169+# [ITERATIONS count] # run this test as a benchmark for ${count} iterations
170+# )
171+#
172+# Logging options in the standard form of "-o filename,format"
173+# will be appended to the arguments list, prefixed with ARG_PREFIX.
174+# XUnitXML files will be stored in current binary dir or under
175+# ARTIFACTS_DIR, if set.
176+#
177+# Three targets will be created:
178+# - test${component_name} - Runs the test
179+# - xvfbtest${component_name} - Runs the test under xvfb
180+# - gdbtest${component_name} - Runs the test under gdb
181+
182+function(add_executable_test COMPONENT_NAME TARGET)
183+ import_executables(gdb xvfb-run OPTIONAL)
184+
185+ cmake_parse_arguments(QMLTEST "${QMLTEST_OPTIONS}" "${QMLTEST_SINGLE}" "${QMLTEST_MULTI}" ${ARGN})
186+ mangle_arguments()
187+
188+ if(ARTIFACTS_DIR)
189+ file(RELATIVE_PATH path ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
190+ file(MAKE_DIRECTORY ${ARTIFACTS_DIR}/${path})
191+ set(file_logger -o ${ARTIFACTS_DIR}/${path}/test${COMPONENT_NAME}.xml,xunitxml)
192+ else()
193+ set(file_logger -o ${CMAKE_CURRENT_BINARY_DIR}/test${COMPONENT_NAME}.xml,xunitxml)
194+ endif()
195+
196+ bake_arguments("${QMLTEST_ARG_PREFIX}" args ${iterations} ${file_logger} ${STDOUT_LOGGER})
197+
198+ set(qmltest_command
199+ $<TARGET_FILE:${TARGET}>
200+ ${QMLTEST_ARGS}
201+ ${args}
202+ )
203+
204+ add_qmltest_target(test${COMPONENT_NAME} ${TARGET}
205+ COMMAND ${qmltest_command}
206+ ${depends}
207+ ENVIRONMENT QML2_IMPORT_PATH=${imports} ${QMLTEST_ENVIRONMENT}
208+ ${add_test}
209+ ${targets}
210+ )
211+
212+ if(TARGET xvfb-run)
213+ add_qmltest_target(xvfbtest${COMPONENT_NAME} ${TARGET}
214+ COMMAND $<TARGET_FILE:xvfb-run> --server-args "-screen 0 1024x768x24" --auto-servernum ${qmltest_command}
215+ ${depends}
216+ ENVIRONMENT QML2_IMPORT_PATH=${imports} ${QMLTEST_ENVIRONMENT} LD_PRELOAD=/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}/mesa/libGL.so.1
217+ TARGETS ${xvfb_targets}
218+ )
219+ endif()
220+
221+ if(TARGET gdb)
222+ add_qmltest_target(gdbtest${COMPONENT_NAME} ${TARGET}
223+ COMMAND $<TARGET_FILE:gdb> -ex run -args ${qmltest_command}
224+ ${depends}
225+ ENVIRONMENT QML2_IMPORT_PATH=${imports} ${QMLTEST_ENVIRONMENT}
226+ )
227+ endif()
228+endfunction()
229+
230+
231+# add_manual_test(target component_name
232+# [DEPENDS target1 [target2 [...]]] # make this test depend on the specified targets
233+# [IMPORT_PATHS import_path1 [import_path2 [...]] # use these QML import paths
234+# # (they're searched first to last)
235+# [ENVIRONMENT var1=value1 [var2=value2 [...]]] # set these environment variables
236+# )
237 #
238 # Two targets will be created:
239-# - testComponentName - Runs the test with qmltestrunner
240-# - tryComponentName - Runs the test with uqmlscene, for manual interaction
241-# - gdbtestComponentName - Runs the test with qmltestrunner under gdb
242-#
243-# To change/set a default value for the whole test suite, prior to calling add_qml_test, set:
244-# qmltest_DEFAULT_NO_ADD_TEST (default: FALSE)
245-# qmltest_DEFAULT_TARGETS
246-# qmltest_DEFAULT_IMPORT_PATHS
247-# qmltest_DEFAULT_PROPERTIES
248-
249-find_program(qmltestrunner_exe qmltestrunner)
250-
251-if(NOT qmltestrunner_exe)
252- msg(FATAL_ERROR "Could not locate qmltestrunner.")
253-endif()
254-
255-set(qmlscene_exe ${CMAKE_BINARY_DIR}/tests/uqmlscene/uqmlscene)
256-
257-set(test_env LC_ALL=C UNITY_TESTING=1)
258-
259-macro(add_manual_qml_test SUBPATH COMPONENT_NAME)
260- set(options NO_ADD_TEST NO_TARGETS)
261- set(multi_value_keywords IMPORT_PATHS TARGETS PROPERTIES ENVIRONMENT)
262-
263- cmake_parse_arguments(qmltest "${options}" "" "${multi_value_keywords}" ${ARGN})
264- cmake_parse_arguments(qmltest_default "${options}" "" "${multi_value_keywords}" ${qmltest_DEFAULT_PROPERTIES})
265-
266- set(qmlscene_TARGET try${COMPONENT_NAME})
267- set(qmltest_FILE ${SUBPATH}/tst_${COMPONENT_NAME})
268-
269- set(qmlscene_imports "")
270- if(NOT "${qmltest_IMPORT_PATHS}" STREQUAL "")
271- foreach(IMPORT_PATH ${qmltest_IMPORT_PATHS})
272- list(APPEND qmlscene_imports "-I")
273- list(APPEND qmlscene_imports ${IMPORT_PATH})
274- endforeach(IMPORT_PATH)
275- elseif(NOT "${qmltest_DEFAULT_IMPORT_PATHS}" STREQUAL "")
276- foreach(IMPORT_PATH ${qmltest_DEFAULT_IMPORT_PATHS})
277- list(APPEND qmlscene_imports "-I")
278- list(APPEND qmlscene_imports ${IMPORT_PATH})
279- endforeach(IMPORT_PATH)
280- endif()
281-
282- if("${qmltest_ENVIRONMENT}" STREQUAL "")
283- set(qmltest_ENVIRONMENT "${qmltest_default_ENVIRONMENT}")
284- endif()
285-
286- set(qmlscene_command
287- env ${test_env} ${qmltest_ENVIRONMENT}
288- ${qmlscene_exe} -qmljsdebugger=port:3768 ${CMAKE_CURRENT_SOURCE_DIR}/${qmltest_FILE}.qml
289- ${qmlscene_imports}
290- )
291- add_custom_target(${qmlscene_TARGET} ${qmlscene_command})
292-
293-endmacro(add_manual_qml_test)
294-
295-macro(add_qml_benchmark SUBPATH COMPONENT_NAME ITERATIONS)
296- add_qml_test_internal(${SUBPATH} ${COMPONENT_NAME} ${ITERATIONS} ${ARGN})
297-endmacro(add_qml_benchmark)
298-
299-macro(add_qml_test SUBPATH COMPONENT_NAME)
300- add_qml_test_internal(${SUBPATH} ${COMPONENT_NAME} 0 ${ARGN})
301-endmacro(add_qml_test)
302-
303-macro(add_qml_test_internal SUBPATH COMPONENT_NAME ITERATIONS)
304- set(options NO_ADD_TEST NO_TARGETS)
305- set(multi_value_keywords IMPORT_PATHS TARGETS PROPERTIES ENVIRONMENT)
306-
307- cmake_parse_arguments(qmltest "${options}" "" "${multi_value_keywords}" ${ARGN})
308- cmake_parse_arguments(qmltest_default "${options}" "" "${multi_value_keywords}" ${qmltest_DEFAULT_PROPERTIES})
309-
310- set(qmltest_TARGET test${COMPONENT_NAME})
311- set(qmltest_gdb_TARGET gdbtest${COMPONENT_NAME})
312- set(qmltest_xvfb_TARGET xvfbtest${COMPONENT_NAME})
313- set(qmltest_FILE ${SUBPATH}/tst_${COMPONENT_NAME})
314-
315- set(qmltestrunner_imports "")
316- if(NOT "${qmltest_IMPORT_PATHS}" STREQUAL "")
317- foreach(IMPORT_PATH ${qmltest_IMPORT_PATHS})
318- list(APPEND qmltestrunner_imports "-import")
319- list(APPEND qmltestrunner_imports ${IMPORT_PATH})
320- endforeach(IMPORT_PATH)
321- elseif(NOT "${qmltest_DEFAULT_IMPORT_PATHS}" STREQUAL "")
322- foreach(IMPORT_PATH ${qmltest_DEFAULT_IMPORT_PATHS})
323- list(APPEND qmltestrunner_imports "-import")
324- list(APPEND qmltestrunner_imports ${IMPORT_PATH})
325- endforeach(IMPORT_PATH)
326- endif()
327-
328+# - try${component_name} - Runs the test for manual interaction
329+# - gdbtry${component_name} - Runs the test under gdb
330+
331+function(add_manual_test COMPONENT_NAME TARGET)
332+ import_executables(gdb OPTIONAL)
333+
334+ cmake_parse_arguments(QMLTEST "${QMLTEST_OPTIONS}" "${QMLTEST_SINGLE}" "${QMLTEST_MULTI}" ${ARGN})
335+ mangle_arguments()
336+
337+ bake_arguments("${QMLTEST_ARG_PREFIX}" args -qmljsdebugger=port:3768)
338+
339+ set(qmltry_command
340+ $<TARGET_FILE:${TARGET}>
341+ ${QMLTEST_ARGS}
342+ ${args}
343+ )
344+
345+ add_qmltest_target(try${COMPONENT_NAME} ${TARGET}
346+ COMMAND ${qmltry_command}
347+ ${depends}
348+ ENVIRONMENT QML2_IMPORT_PATH=${imports} ${QMLTEST_ENVIRONMENT}
349+ )
350+
351+ if(TARGET gdb)
352+ add_qmltest_target(gdbtry${COMPONENT_NAME} ${TARGET}
353+ COMMAND $<TARGET_FILE:gdb> -ex run -args ${qmltry_command}
354+ ${depends}
355+ ENVIRONMENT QML2_IMPORT_PATH=${imports} ${QMLTEST_ENVIRONMENT}
356+ )
357+ endif()
358+endfunction()
359+
360+
361+################### INTERNAL ####################
362+
363+# add_qmltest_target(target_name target
364+# COMMAND test_exe [arg1 [...]] # execute this test with arguments
365+# [...] # see above for available arguments:
366+# # ADD_TEST, ENVIRONMENT, DEPENDS and TARGETS
367+# )
368+
369+function(add_qmltest_target TARGET_NAME TARGET)
370+ cmake_parse_arguments(QMLTEST "${QMLTEST_OPTIONS}" "${QMLTEST_SINGLE}" "COMMAND;${QMLTEST_MULTI}" ${ARGN})
371+ mangle_arguments()
372+
373+ # Additional arguments
374 string(TOLOWER "${CMAKE_GENERATOR}" cmake_generator_lower)
375 if(cmake_generator_lower STREQUAL "unix makefiles")
376- set(function_ARGS $(FUNCTION))
377- else()
378- set(function_ARGS "")
379- endif()
380-
381- if (${ITERATIONS} GREATER 0)
382- set(ITERATIONS_STRING "-iterations" ${ITERATIONS})
383- else()
384- set(ITERATIONS_STRING "")
385- endif()
386-
387- if("${qmltest_ENVIRONMENT}" STREQUAL "")
388- set(qmltest_ENVIRONMENT "${qmltest_default_ENVIRONMENT}")
389- endif()
390-
391- set(qmltest_command
392- env ${test_env} ${qmltest_ENVIRONMENT}
393- ${qmltestrunner_exe} -input ${CMAKE_CURRENT_SOURCE_DIR}/${qmltest_FILE}.qml
394- ${qmltestrunner_imports}
395- ${ITERATIONS_STRING}
396- -o ${CMAKE_BINARY_DIR}/${qmltest_TARGET}.xml,xunitxml
397- -o -,txt
398- ${function_ARGS}
399- )
400- find_program(DPKG dpkg-architecture)
401- if(DPKG)
402- exec_program(${DPKG} ARGS "-qDEB_BUILD_MULTIARCH" OUTPUT_VARIABLE ARCH_TRIPLET )
403- set(LD_PRELOAD_PATH "LD_PRELOAD=/usr/lib/${ARCH_TRIPLET}/mesa/libGL.so.1")
404- endif()
405- set(qmltest_xvfb_command
406- env ${test_env} ${qmltest_ENVIRONMENT} ${LD_PRELOAD_PATH}
407- xvfb-run --server-args "-screen 0 1024x768x24" --auto-servernum
408- ${qmltestrunner_exe} -input ${CMAKE_CURRENT_SOURCE_DIR}/${qmltest_FILE}.qml
409- ${qmltestrunner_imports}
410- -o ${CMAKE_BINARY_DIR}/${qmltest_TARGET}.xml,xunitxml
411- -o -,txt
412- ${function_ARGS}
413- )
414-
415- set(qmltest_gdb_command
416- env ${test_env} ${qmltest_ENVIRONMENT} ${LD_PRELOAD_PATH}
417- gdb -e ${qmltestrunner_exe} -ex \"run -input ${CMAKE_CURRENT_SOURCE_DIR}/${qmltest_FILE}.qml ${qmltestrunner_imports} ${ITERATIONS_STRING}\"
418- )
419-
420- add_qmltest_target(${qmltest_TARGET} "${qmltest_command}" TRUE ${qmltest_NO_ADD_TEST})
421- add_qmltest_target(${qmltest_xvfb_TARGET} "${qmltest_xvfb_command}" ${qmltest_NO_TARGETS} TRUE)
422- add_qmltest_target(${qmltest_gdb_TARGET} "${qmltest_gdb_command}" TRUE TRUE)
423- add_manual_qml_test(${SUBPATH} ${COMPONENT_NAME} ${ARGN})
424-endmacro(add_qml_test_internal)
425-
426-macro(add_binary_qml_test CLASS_NAME LD_PATH DEPS ENVVAR)
427- set(testCommand
428- ${ENVVAR}
429- LD_LIBRARY_PATH=${LD_PATH}
430- dbus-test-runner
431- -m 300
432- -t ${CMAKE_CURRENT_BINARY_DIR}/${CLASS_NAME}TestExec
433- -p -o -p ${CMAKE_BINARY_DIR}/test${CLASS_NAME}.xml,xunitxml
434- -p -o -p -,txt)
435-
436- add_qmltest_target(test${CLASS_NAME} "${testCommand}" FALSE TRUE)
437- add_dependencies(test${CLASS_NAME} ${CLASS_NAME}TestExec ${DEPS})
438-
439- find_program( HAVE_GCC gcc )
440- if (NOT ${HAVE_GCC} STREQUAL "")
441- exec_program( gcc ARGS "-dumpmachine" OUTPUT_VARIABLE ARCH_TRIPLET )
442- set(LD_PRELOAD_PATH "LD_PRELOAD=/usr/lib/${ARCH_TRIPLET}/mesa/libGL.so.1")
443- endif()
444- set(xvfbtestCommand
445- ${LD_PRELOAD_PATH}
446- ${ENVVAR}
447- LD_LIBRARY_PATH=${LD_PATH}
448- xvfb-run --server-args "-screen 0 1024x768x24" --auto-servernum
449- dbus-test-runner
450- -m 300
451- -t ${CMAKE_CURRENT_BINARY_DIR}/${CLASS_NAME}TestExec
452- -p -o -p ${CMAKE_BINARY_DIR}/test${CLASS_NAME}.xml,xunitxml
453- -p -o -p -,txt)
454-
455- add_qmltest_target(xvfbtest${CLASS_NAME} "${xvfbtestCommand}" FALSE TRUE)
456- add_dependencies(qmluitests xvfbtest${CLASS_NAME})
457-endmacro(add_binary_qml_test)
458-
459-macro(add_qmltest_target qmltest_TARGET qmltest_command qmltest_NO_TARGETS qmltest_NO_ADD_TEST)
460- add_custom_target(${qmltest_TARGET} ${qmltest_command})
461-
462- if(NOT "${qmltest_PROPERTIES}" STREQUAL "")
463- set_target_properties(${qmltest_TARGET} PROPERTIES ${qmltest_PROPERTIES})
464- elseif(NOT "${qmltest_DEFAULT_PROPERTIES}" STREQUAL "")
465- set_target_properties(${qmltest_TARGET} PROPERTIES ${qmltest_DEFAULT_PROPERTIES})
466- endif()
467-
468- if("${qmltest_NO_ADD_TEST}" STREQUAL FALSE AND NOT "${qmltest_DEFAULT_NO_ADD_TEST}" STREQUAL "TRUE")
469- add_test(${qmltest_TARGET} ${qmltest_command})
470-
471- if(NOT "${qmltest_UNPARSED_ARGUMENTS}" STREQUAL "")
472- set_tests_properties(${qmltest_TARGET} PROPERTIES ${qmltest_PROPERTIES})
473- elseif(NOT "${qmltest_DEFAULT_PROPERTIES}" STREQUAL "")
474- set_tests_properties(${qmltest_TARGET} PROPERTIES ${qmltest_DEFAULT_PROPERTIES})
475- endif()
476- endif("${qmltest_NO_ADD_TEST}" STREQUAL FALSE AND NOT "${qmltest_DEFAULT_NO_ADD_TEST}" STREQUAL "TRUE")
477-
478- if("${qmltest_NO_TARGETS}" STREQUAL "FALSE")
479- if(NOT "${qmltest_TARGETS}" STREQUAL "")
480- foreach(TARGET ${qmltest_TARGETS})
481- add_dependencies(${TARGET} ${qmltest_TARGET})
482- endforeach(TARGET)
483- elseif(NOT "${qmltest_DEFAULT_TARGETS}" STREQUAL "")
484- foreach(TARGET ${qmltest_DEFAULT_TARGETS})
485- add_dependencies(${TARGET} ${qmltest_TARGET})
486- endforeach(TARGET)
487- endif()
488- endif("${qmltest_NO_TARGETS}" STREQUAL "FALSE")
489-
490-endmacro(add_qmltest_target)
491+ set(function "$(FUNCTION)")
492+ endif()
493+
494+ add_custom_target(${TARGET_NAME}
495+ env ${QMLTEST_ENVIRONMENT}
496+ ${QMLTEST_COMMAND} ${function}
497+ DEPENDS ${TARGET} ${QMLTEST_DEPENDS}
498+ )
499+
500+ if(QMLTEST_ADD_TEST)
501+ add_test(
502+ NAME ${TARGET_NAME}
503+ COMMAND ${QMLTEST_COMMAND}
504+ )
505+
506+ foreach(ENV ${QMLTEST_ENVIRONMENT})
507+ set_property(TEST ${TARGET_NAME} APPEND PROPERTY ENVIRONMENT ${ENV})
508+ endforeach()
509+
510+ set_property(TEST ${TARGET_NAME} APPEND PROPERTY DEPENDS ${TARGET})
511+ foreach(DEPEND ${DEPENDS})
512+ set_property(TEST ${TARGET_NAME} APPEND PROPERTY DEPENDS ${DEPEND})
513+ endforeach()
514+ endif()
515+
516+ foreach(UPSTREAM_TARGET ${QMLTEST_TARGETS})
517+ add_dependencies(${UPSTREAM_TARGET} ${TARGET_NAME})
518+ endforeach()
519+endfunction()
520+
521+
522+# mangle_arguments(${ARGN})
523+#
524+# Verify there were no unparsed arguments and
525+# mangle the known ones for further processing.
526+
527+macro(mangle_arguments)
528+ if(QMLTEST_UNPARSED_ARGUMENTS)
529+ message(FATAL_ERROR "Unexpected arguments: ${QMLTEST_UNPARSED_ARGUMENTS}")
530+ endif()
531+
532+ if(QMLTEST_ADD_TEST)
533+ set(add_test ADD_TEST)
534+ endif()
535+
536+ if(QMLTEST_IMPORT_PATHS)
537+ string(REPLACE ";" ":" imports "${QMLTEST_IMPORT_PATHS}")
538+ endif()
539+
540+ if(QMLTEST_ITERATIONS)
541+ set(iterations -iterations ${QMLTEST_ITERATIONS})
542+ endif()
543+
544+ if(QMLTEST_DEPENDS)
545+ set(depends DEPENDS ${QMLTEST_DEPENDS})
546+ endif()
547+
548+ if(QMLTEST_TARGETS)
549+ set(targets TARGETS ${QMLTEST_TARGETS})
550+ endif()
551+
552+ set(xvfb_targets "")
553+ foreach(target ${QMLTEST_TARGETS})
554+ if(TARGET xvfb${target})
555+ list(APPEND xvfb_targets xvfb${target})
556+ endif()
557+ endforeach()
558+ set(xvfb_targets "${xvfb_targets}" PARENT_SCOPE)
559+endmacro()
560+
561+
562+# bake_arguments(prefix output
563+# arg1 [arg2 [...]]
564+# )
565+#
566+# If set, add the argument prefix before every passed
567+# argument and store the result in ${OUTPUT} variable.
568+
569+function(bake_arguments PREFIX OUTPUT)
570+ set(args "${ARGN}")
571+ if(PREFIX)
572+ set(args "")
573+ foreach(arg ${ARGN})
574+ list(APPEND args ${PREFIX})
575+ list(APPEND args ${arg})
576+ endforeach()
577+ endif()
578+ set(${OUTPUT} "${args}" PARENT_SCOPE)
579+endfunction()
580
581=== modified file 'plugins/Wizard/PageList.cpp'
582--- plugins/Wizard/PageList.cpp 2014-11-14 23:30:10 +0000
583+++ plugins/Wizard/PageList.cpp 2015-05-27 14:12:22 +0000
584@@ -45,7 +45,7 @@
585 QSet<QString> disabledPages;
586 QStringList dataDirs;
587
588- if (!isRunningInstalled() && getenv("UNITY_TEST_ENV") == nullptr) {
589+ if (!isRunningInstalled() && getenv("WIZARD_TESTING") == nullptr) {
590 dataDirs = QStringList() << qmlDirectory();
591 } else {
592 dataDirs = shellDataDirs();
593
594=== modified file 'runtests.sh'
595--- runtests.sh 2015-05-04 08:46:14 +0000
596+++ runtests.sh 2015-05-27 14:12:22 +0000
597@@ -41,7 +41,7 @@
598
599 cd -
600
601-make -k qmltests
602+make -k xvfballtests
603 if [ $? -ne 0 ]; then
604 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
605 fi
606
607=== modified file 'tests/CMakeLists.txt'
608--- tests/CMakeLists.txt 2015-03-23 23:43:57 +0000
609+++ tests/CMakeLists.txt 2015-05-27 14:12:22 +0000
610@@ -1,16 +1,128 @@
611+include(QmlTest)
612+
613 # QML tests that do not require graphical capabilities.
614-add_custom_target(qmlunittests)
615+add_custom_target(unittests)
616
617 # QML tests that require graphical capabilities.
618-add_custom_target(qmluitests)
619-
620-add_custom_target(qmltests)
621-add_dependencies(qmltests qmlunittests qmluitests)
622-
623+add_custom_target(uitests)
624+add_custom_target(xvfbuitests)
625+
626+add_custom_target(alltests)
627+add_dependencies(alltests unittests uitests)
628+
629+add_custom_target(xvfballtests)
630+add_dependencies(xvfballtests unittests xvfbuitests)
631+
632+# Support libraries and plugins
633+add_subdirectory(mocks)
634+add_subdirectory(utils)
635+add_subdirectory(uqmlscene)
636+
637+# Use our custom implementation of qmlscene and import dbus-test-runner
638+add_executable(qmlscene ALIAS uqmlscene)
639+import_executables(dbus-test-runner)
640+
641+set(UNITY_IMPORT_PATHS
642+ ${CMAKE_BINARY_DIR}/tests/mocks
643+ ${CMAKE_BINARY_DIR}/tests/utils/modules
644+ ${CMAKE_BINARY_DIR}/plugins
645+)
646+set(UNITY_IMPORT_PATHS ${UNITY_IMPORT_PATHS} CACHE INTERNAL "")
647+
648+macro(unity8_parse_arguments)
649+ cmake_parse_arguments(U8TEST
650+ "${QMLTEST_OPTIONS};LIGHTDM"
651+ "${QMLTEST_SINGLE}"
652+ "${QMLTEST_MULTI}"
653+ ${ARGN}
654+ )
655+
656+ set(ld_paths)
657+ if(U8TEST_LIGHTDM)
658+ list(APPEND ld_paths
659+ ${CMAKE_BINARY_DIR}/tests/mocks/libusermetrics
660+ ${CMAKE_BINARY_DIR}/tests/mocks/LightDM/liblightdm
661+ )
662+ endif()
663+
664+ if(ld_paths)
665+ string(REPLACE ";" ":" ld_library_path "${ld_paths}")
666+ set(ld_library_path LD_LIBRARY_PATH=${ld_library_path})
667+ endif()
668+
669+ set(U8TEST_ARGN "${ARGN}")
670+ list(REMOVE_ITEM U8TEST_ARGN LIGHTDM)
671+
672+ set(environment
673+ UNITY_TESTING=1
674+ LANGUAGE=C
675+ LC_ALL=C.UTF-8
676+ ${ld_library_path}
677+ )
678+endmacro()
679+
680+
681+# add a non-graphical unit test
682+# see QmlTest.cmake for additional options
683+function(add_unity8_unittest COMPONENT_NAME TARGET)
684+ unity8_parse_arguments(${ARGN})
685+ add_executable_test(${COMPONENT_NAME} ${TARGET}
686+ ADD_TEST
687+ IMPORT_PATHS ${UNITY_IMPORT_PATHS}
688+ TARGETS unittests
689+ ${U8TEST_ARGN}
690+ ENVIRONMENT ${environment}
691+ QT_QPA_PLATFORM=minimal
692+ ${U8TEST_ENVIRONMENT}
693+ )
694+endfunction()
695+
696+# add a graphical unit test
697+function(add_unity8_uitest COMPONENT_NAME TARGET)
698+ unity8_parse_arguments(${ARGN})
699+ add_executable_test(${COMPONENT_NAME} ${TARGET}
700+ IMPORT_PATHS ${UNITY_IMPORT_PATHS}
701+ TARGETS uitests
702+ ${U8TEST_ARGN}
703+ ENVIRONMENT ${environment}
704+ ${U8TEST_ENVIRONMENT}
705+ )
706+endfunction()
707+
708+# add a non-graphical qml unit test
709+function(add_unity8_qmlunittest PATH COMPONENT_NAME)
710+ unity8_parse_arguments(${ARGN})
711+ add_qml_unittest(${PATH} ${COMPONENT_NAME}
712+ ADD_TEST
713+ IMPORT_PATHS ${UNITY_IMPORT_PATHS}
714+ TARGET unittests
715+ ${U8TEST_ARGN}
716+ ENVIRONMENT ${environment}
717+ QT_QPA_PLATFORM=minimal
718+ ${U8TEST_ENVIRONMENT}
719+ )
720+endfunction()
721+
722+# add a graphical qml test
723+function(add_unity8_qmltest PATH COMPONENT_NAME)
724+ unity8_parse_arguments(${ARGN})
725+ add_qml_test(${PATH} ${COMPONENT_NAME}
726+ IMPORT_PATHS ${UNITY_IMPORT_PATHS}
727+ TARGETS uitests
728+ ${U8TEST_ARGN}
729+ ENVIRONMENT ${environment}
730+ ${U8TEST_ENVIRONMENT}
731+ )
732+endfunction()
733+
734+# add a graphical qml benchmark
735+function(add_unity8_qmlbenchmark PATH COMPONENT_NAME ITERATIONS)
736+ add_unity8_qmltest(${PATH} ${COMPONENT_NAME} ITERATIONS ${ITERATIONS} ${ARGN})
737+endfunction()
738+
739+
740+# Actual test definitions
741 add_subdirectory(libs)
742+add_subdirectory(plugins)
743 add_subdirectory(qmltests)
744-add_subdirectory(mocks)
745 add_subdirectory(whitespace)
746-add_subdirectory(plugins)
747-add_subdirectory(utils)
748-add_subdirectory(uqmlscene)
749
750=== modified file 'tests/copyright/CMakeLists.txt'
751--- tests/copyright/CMakeLists.txt 2013-06-05 22:03:08 +0000
752+++ tests/copyright/CMakeLists.txt 2015-05-27 14:12:22 +0000
753@@ -2,5 +2,5 @@
754 # Test that all source files contain a copyright header.
755 #
756
757-add_test(copyright ${CMAKE_CURRENT_SOURCE_DIR}/check_copyright.sh
758+add_test(Copyright ${CMAKE_CURRENT_SOURCE_DIR}/check_copyright.sh
759 ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
760
761=== modified file 'tests/libs/UbuntuGestures/CMakeLists.txt'
762--- tests/libs/UbuntuGestures/CMakeLists.txt 2014-10-01 13:20:32 +0000
763+++ tests/libs/UbuntuGestures/CMakeLists.txt 2015-05-27 14:12:22 +0000
764@@ -4,17 +4,13 @@
765 )
766
767 macro(add_gesture_test CLASSNAME)
768- set(testCommand
769- ${CLASSNAME}TestExec -o ${CMAKE_BINARY_DIR}/test${CLASSNAME}.xml,xunitxml -o -,txt)
770-
771- add_test(NAME test${CLASSNAME} COMMAND ${testCommand})
772-
773- set_tests_properties(test${CLASSNAME} PROPERTIES
774- ENVIRONMENT LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/libs/UbuntuGestures)
775-
776 add_executable(${CLASSNAME}TestExec tst_${CLASSNAME}.cpp)
777 qt5_use_modules(${CLASSNAME}TestExec Test Core Gui Quick)
778 target_link_libraries(${CLASSNAME}TestExec UbuntuGestures)
779+
780+ add_unity8_unittest(${CLASSNAME} ${CLASSNAME}TestExec
781+ ENVIRONMENT LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/libs/UbuntuGestures
782+ )
783 endmacro(add_gesture_test)
784
785 add_gesture_test(TouchRegistry)
786
787=== modified file 'tests/plugins/AccountsService/CMakeLists.txt'
788--- tests/plugins/AccountsService/CMakeLists.txt 2015-04-17 16:39:43 +0000
789+++ tests/plugins/AccountsService/CMakeLists.txt 2015-05-27 14:12:22 +0000
790@@ -43,12 +43,13 @@
791 )
792 qt5_use_modules(test-accountsservice Core DBus Test)
793
794-add_test(NAME test-accountsservice
795- COMMAND dbus-test-runner
796- --task ${CMAKE_CURRENT_BINARY_DIR}/mock-server
797+add_unity8_unittest(AccountsService dbus-test-runner
798+ ARG_PREFIX "--parameter"
799+ ARGS
800+ --task $<TARGET_FILE:mock-server>
801 --task-name server
802 --ignore-return
803- --task ${CMAKE_CURRENT_BINARY_DIR}/test-accountsservice
804+ --task $<TARGET_FILE:test-accountsservice>
805 --task-name client
806 --wait-for org.freedesktop.Accounts
807 )
808
809=== modified file 'tests/plugins/Dash/CMakeLists.txt'
810--- tests/plugins/Dash/CMakeLists.txt 2014-10-28 14:06:09 +0000
811+++ tests/plugins/Dash/CMakeLists.txt 2015-05-27 14:12:22 +0000
812@@ -32,7 +32,7 @@
813 qt5_use_modules(${TESTNAME}TestExec Test Core Qml)
814 target_link_libraries(${TESTNAME}TestExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
815
816- add_binary_qml_test(${TESTNAME} "" "Dash-qml" "")
817+ add_unity8_uitest(${TESTNAME} ${TESTNAME}TestExec DEPENDS Dash-qml)
818 endmacro()
819
820 add_lvwph_test(listviewwithpageheader ListViewWithPageHeader)
821@@ -48,19 +48,16 @@
822 qt5_use_modules(${TESTNAME}TestExec Test Core Qml)
823 target_link_libraries(${TESTNAME}TestExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
824
825- add_binary_qml_test(${TESTNAME} "" "Dash-qml" "")
826+ add_unity8_uitest(${TESTNAME} ${TESTNAME}TestExec DEPENDS Dash-qml)
827
828- add_executable(${TESTNAME}tryExec
829+ add_executable(${TESTNAME}TryExec
830 ${FILENAME}try.cpp
831 ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/Dash/${FILENAME}.cpp
832 ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/Dash/abstractdashview.cpp
833 )
834- qt5_use_modules(${TESTNAME}tryExec Test Core Qml)
835- target_link_libraries(${TESTNAME}tryExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
836- add_custom_target(try${TESTNAME}
837- ${CMAKE_CURRENT_BINARY_DIR}/${TESTNAME}tryExec
838- DEPENDS ${TESTNAME}tryExec Dash-qml
839- )
840+ qt5_use_modules(${TESTNAME}TryExec Test Core Qml)
841+ target_link_libraries(${TESTNAME}TryExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
842+ add_manual_test(${TESTNAME} ${TESTNAME}TryExec DEPENDS Dash-qml)
843 endmacro()
844
845 add_dashview_try_test(verticaljournal VerticalJournal)
846@@ -71,13 +68,9 @@
847 add_executable(CardCreatorTestExec cardcreatortest.cpp)
848 qt5_use_modules(CardCreatorTestExec Test Core Qml)
849 target_link_libraries(CardCreatorTestExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
850-add_binary_qml_test(CardCreator "" "Dash-qml" "QML2_IMPORT_PATH=${CMAKE_BINARY_DIR}/tests/mocks/")
851+add_unity8_uitest(CardCreator CardCreatorTestExec DEPENDS Dash-qml)
852
853 # plain qml test
854-set(qmltest_DEFAULT_TARGETS qmluitests)
855-set(qmltest_DEFAULT_NO_ADD_TEST TRUE)
856-set(qmltest_DEFAULT_PROPERTIES ENVIRONMENT "LC_ALL=C")
857-add_qml_test(. ScopeStyle IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins)
858-add_qml_test(. ListViewWithPageHeaderQML IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins)
859-add_qml_test(. CardAttributes IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins)
860-add_qml_test(. CroppedImageMinimumSourceSize IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins)
861+foreach(dash_test ScopeStyle ListViewWithPageHeaderQML CardAttributes CroppedImageMinimumSourceSize)
862+ add_unity8_qmltest(. ${dash_test})
863+endforeach()
864
865=== modified file 'tests/plugins/Greeter/Unity/Launcher/CMakeLists.txt'
866--- tests/plugins/Greeter/Unity/Launcher/CMakeLists.txt 2015-02-11 13:43:17 +0000
867+++ tests/plugins/Greeter/Unity/Launcher/CMakeLists.txt 2015-05-27 14:12:22 +0000
868@@ -13,11 +13,6 @@
869 add_definitions(-DLAUNCHER_TESTING)
870
871 ### LauncherModelASTest
872-set(testModelCommand dbus-test-runner --task ${CMAKE_CURRENT_BINARY_DIR}/launchermodelastestExec
873- --parameter -o --parameter ${CMAKE_BINARY_DIR}/launchermodeltest.xml,xunitxml
874- --parameter -o --parameter -,txt)
875-add_test(NAME launchermodelastest COMMAND ${testModelCommand})
876-add_custom_target(launchermodelastest ${testModelCommand})
877 add_executable(launchermodelastestExec
878 launchermodelastest.cpp
879 AccountsServiceDBusAdaptor.cpp
880@@ -36,6 +31,10 @@
881 ${GSETTINGS_QT_LDFLAGS}
882 )
883 qt5_use_modules(launchermodelastestExec Test Core DBus Gui)
884+add_unity8_unittest(LauncherModelAS dbus-test-runner
885+ ARG_PREFIX "--parameter"
886+ ARGS --task $<TARGET_FILE:launchermodelastestExec>
887+)
888
889 # copy .desktop files into build directory for shadow builds
890 file(GLOB DESKTOP_FILES *.desktop)
891
892=== modified file 'tests/plugins/LightDM/CMakeLists.txt'
893--- tests/plugins/LightDM/CMakeLists.txt 2015-04-22 21:34:05 +0000
894+++ tests/plugins/LightDM/CMakeLists.txt 2015-05-27 14:12:22 +0000
895@@ -18,7 +18,13 @@
896 ${CMAKE_SOURCE_DIR}/plugins/LightDM
897 ${CMAKE_SOURCE_DIR}/tests/mocks/LightDM
898 )
899-add_binary_qml_test(GreeterDBus "${CMAKE_BINARY_DIR}/tests/mocks/LightDM/liblightdm" MockLightDM "QML2_IMPORT_PATH=${CMAKE_BINARY_DIR}/tests/mocks")
900+add_unity8_uitest(GreeterDBus dbus-test-runner
901+ ARG_PREFIX "--parameter"
902+ ARGS --task $<TARGET_FILE:GreeterDBusTestExec>
903+ DEPENDS MockLightDM
904+ IMPORT_PATHS ${CMAKE_BINARY_DIR}/tests/mocks
905+ LIGHTDM
906+ )
907
908 add_executable(GreeterPamTestExec
909 pam.cpp
910@@ -31,8 +37,7 @@
911 target_include_directories(GreeterPamTestExec PUBLIC
912 ${CMAKE_SOURCE_DIR}/plugins/LightDM/liblightdm
913 )
914-add_qmltest_target(testGreeterPam "${CMAKE_CURRENT_BINARY_DIR}/GreeterPamTestExec" TRUE FALSE)
915-add_dependencies(testGreeterPam GreeterPamTestExec)
916+add_qmltest_target(testGreeterPam GreeterPamTestExec COMMAND $<TARGET_FILE:GreeterPamTestExec>)
917
918 add_executable(GreeterUsersModelTestExec
919 usersmodel.cpp
920@@ -49,4 +54,8 @@
921 ${CMAKE_SOURCE_DIR}/plugins/Utils
922 ${CMAKE_SOURCE_DIR}/tests/mocks/LightDM
923 )
924-add_binary_qml_test(GreeterUsersModel "${CMAKE_BINARY_DIR}/tests/mocks/LightDM/liblightdm" MockLightDM "LIBLIGHTDM_MOCK_MODE=full")
925+add_unity8_uitest(GreeterUsers GreeterUsersModelTestExec
926+ ENVIRONMENT LIBLIGHTDM_MOCK_MODE=full
927+ DEPENDS MockLightDM
928+ LIGHTDM
929+ )
930\ No newline at end of file
931
932=== modified file 'tests/plugins/Ubuntu/Gestures/CMakeLists.txt'
933--- tests/plugins/Ubuntu/Gestures/CMakeLists.txt 2015-04-17 14:21:43 +0000
934+++ tests/plugins/Ubuntu/Gestures/CMakeLists.txt 2015-05-27 14:12:22 +0000
935@@ -12,43 +12,41 @@
936 ${Qt5Gui_PRIVATE_INCLUDE_DIRS}
937 )
938
939-file(GLOB qmlFiles *.qml)
940-add_custom_target(UbuntuGesturesTestQmlFiles ALL
941- COMMAND cp ${qmlFiles} ${CMAKE_CURRENT_BINARY_DIR}
942- DEPENDS ${qmlFiles}
943-)
944+export_qmlfiles(UbuntuGesturesTest .)
945
946 add_definitions(-DUBUNTU_GESTURES_PLUGIN_DIR="${CMAKE_BINARY_DIR}/plugins")
947 add_definitions(-DTESTS_UTILS_MODULES_DIR="${CMAKE_BINARY_DIR}/tests/utils/modules")
948
949-macro(add_gesture_ui_test CLASSNAME)
950+macro(build_gesture_test CLASSNAME)
951 add_executable(${CLASSNAME}TestExec tst_${CLASSNAME}.cpp GestureTest.cpp TestItem.cpp)
952 qt5_use_modules(${CLASSNAME}TestExec Test Core Qml Gui Quick)
953 target_link_libraries(${CLASSNAME}TestExec UbuntuGesturesQml UbuntuGestures)
954-
955- add_binary_qml_test(${CLASSNAME} ${CMAKE_BINARY_DIR}/plugins/Ubuntu/Gestures UbuntuGesturesTestQmlFiles "")
956+endmacro()
957+
958+macro(add_gesture_unit_test CLASSNAME)
959+ build_gesture_test(${CLASSNAME})
960+ add_unity8_unittest(${CLASSNAME} ${CLASSNAME}TestExec
961+ ENVIRONMENT LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/plugins/Ubuntu/Gestures
962+ DEPENDS UbuntuGesturesTest-qmlfiles
963+ ${ARGN}
964+ )
965+endmacro()
966+
967+macro(add_gesture_ui_test CLASSNAME)
968+ build_gesture_test(${CLASSNAME})
969+ add_unity8_uitest(${CLASSNAME} ${CLASSNAME}TestExec
970+ ENVIRONMENT LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/plugins/Ubuntu/Gestures
971+ DEPENDS UbuntuGesturesTest-qmlfiles
972+ ${ARGN}
973+ )
974 add_manual_qml_test(. ${CLASSNAME} IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins
975 ${CMAKE_BINARY_DIR}/tests/utils/modules)
976-endmacro(add_gesture_ui_test)
977-
978-macro(add_gesture_test CLASSNAME)
979- set(testCommand
980- ${CLASSNAME}TestExec -o ${CMAKE_BINARY_DIR}/test${CLASSNAME}.xml,xunitxml -o -,txt)
981-
982- add_test(NAME test${CLASSNAME} COMMAND ${testCommand})
983-
984- set_tests_properties(test${CLASSNAME} PROPERTIES
985- ENVIRONMENT LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/plugins/Ubuntu/Gestures)
986-
987- add_executable(${CLASSNAME}TestExec tst_${CLASSNAME}.cpp)
988- qt5_use_modules(${CLASSNAME}TestExec Test Core)
989- target_link_libraries(${CLASSNAME}TestExec UbuntuGesturesQml)
990-endmacro(add_gesture_test)
991+endmacro()
992
993 add_gesture_ui_test(DirectionalDragArea)
994 add_gesture_ui_test(FloatingFlickable)
995 add_gesture_ui_test(PressedOutsideNotifier)
996 add_gesture_ui_test(TouchDispatcher)
997 add_gesture_ui_test(TouchGate)
998-add_gesture_test(Damper)
999-add_gesture_test(AxisVelocityCalculator)
1000+add_gesture_unit_test(Damper)
1001+add_gesture_unit_test(AxisVelocityCalculator)
1002
1003=== modified file 'tests/plugins/Unity/Indicators/CMakeLists.txt'
1004--- tests/plugins/Unity/Indicators/CMakeLists.txt 2014-09-12 13:01:25 +0000
1005+++ tests/plugins/Unity/Indicators/CMakeLists.txt 2015-05-27 14:12:22 +0000
1006@@ -17,13 +17,8 @@
1007 set(multi_value_keywords ADDITIONAL_CPPS ADDITIONAL_LIBS)
1008 cmake_parse_arguments(test "" "" "${multi_value_keywords}" ${ARGN})
1009
1010- set(testCommand ${CMAKE_CURRENT_BINARY_DIR}/${TEST}Exec
1011- -o ${CMAKE_BINARY_DIR}/${TEST}.xml,xunitxml
1012- -o -,txt)
1013- add_test(NAME ${TEST} COMMAND ${testCommand})
1014- add_custom_target(${TEST} ${testCommand})
1015 add_executable(${TEST}Exec
1016- ${TEST}.cpp
1017+ ${TEST}Test.cpp
1018 ${test_ADDITIONAL_CPPS}
1019 )
1020 qt5_use_modules(${TEST}Exec Test Core Qml)
1021@@ -33,11 +28,13 @@
1022 ${GIO_LIBRARIES}
1023 ${QMENUMODEL_LDFLAGS}
1024 )
1025+
1026+ add_unity8_unittest(${TEST} ${TEST}Exec)
1027 endmacro(indicator_test)
1028
1029-indicator_test(indicatorsmanagertest ADDITIONAL_LIBS IndicatorsQml)
1030-indicator_test(indicatorsmodeltest ADDITIONAL_LIBS IndicatorsQml)
1031-indicator_test(menucontentactivatortest ADDITIONAL_CPPS ${INDICATORS_DIR}/menucontentactivator.cpp)
1032-indicator_test(unitymenumodelstacktest ADDITIONAL_CPPS ${TEST_DIR}/mocks/QMenuModel/unitymenumodel.cpp ${INDICATORS_DIR}/unitymenumodelstack.cpp)
1033-indicator_test(rootactionstatetest ADDITIONAL_LIBS IndicatorsQml)
1034-indicator_test(sharedunitymenumodeltest ADDITIONAL_LIBS IndicatorsQml)
1035+indicator_test(IndicatorsManager ADDITIONAL_LIBS IndicatorsQml)
1036+indicator_test(IndicatorsModel ADDITIONAL_LIBS IndicatorsQml)
1037+indicator_test(MenuContentActivator ADDITIONAL_CPPS ${INDICATORS_DIR}/menucontentactivator.cpp)
1038+indicator_test(UnityMenuModelStack ADDITIONAL_CPPS ${TEST_DIR}/mocks/QMenuModel/unitymenumodel.cpp ${INDICATORS_DIR}/unitymenumodelstack.cpp)
1039+indicator_test(RootActionState ADDITIONAL_LIBS IndicatorsQml)
1040+indicator_test(SharedUnityMenuModel ADDITIONAL_LIBS IndicatorsQml)
1041
1042=== renamed file 'tests/plugins/Unity/Indicators/indicatorsmanagertest.cpp' => 'tests/plugins/Unity/Indicators/IndicatorsManagerTest.cpp'
1043--- tests/plugins/Unity/Indicators/indicatorsmanagertest.cpp 2015-03-11 08:07:31 +0000
1044+++ tests/plugins/Unity/Indicators/IndicatorsManagerTest.cpp 2015-05-27 14:12:22 +0000
1045@@ -180,4 +180,4 @@
1046 };
1047
1048 QTEST_GUILESS_MAIN(IndicatorsManagerTest)
1049-#include "indicatorsmanagertest.moc"
1050+#include "IndicatorsManagerTest.moc"
1051
1052=== renamed file 'tests/plugins/Unity/Indicators/indicatorsmodeltest.cpp' => 'tests/plugins/Unity/Indicators/IndicatorsModelTest.cpp'
1053--- tests/plugins/Unity/Indicators/indicatorsmodeltest.cpp 2015-03-11 08:07:31 +0000
1054+++ tests/plugins/Unity/Indicators/IndicatorsModelTest.cpp 2015-05-27 14:12:22 +0000
1055@@ -138,4 +138,4 @@
1056
1057 QTEST_GUILESS_MAIN(IndicatorsModelTest)
1058
1059-#include "indicatorsmodeltest.moc"
1060+#include "IndicatorsModelTest.moc"
1061
1062=== renamed file 'tests/plugins/Unity/Indicators/menucontentactivatortest.cpp' => 'tests/plugins/Unity/Indicators/MenuContentActivatorTest.cpp'
1063--- tests/plugins/Unity/Indicators/menucontentactivatortest.cpp 2015-04-30 09:31:51 +0000
1064+++ tests/plugins/Unity/Indicators/MenuContentActivatorTest.cpp 2015-05-27 14:12:22 +0000
1065@@ -299,4 +299,4 @@
1066 };
1067
1068 QTEST_GUILESS_MAIN(MenuConentActivatorTest)
1069-#include "menucontentactivatortest.moc"
1070+#include "MenuContentActivatorTest.moc"
1071
1072=== renamed file 'tests/plugins/Unity/Indicators/rootactionstatetest.cpp' => 'tests/plugins/Unity/Indicators/RootActionStateTest.cpp'
1073--- tests/plugins/Unity/Indicators/rootactionstatetest.cpp 2014-11-11 10:45:41 +0000
1074+++ tests/plugins/Unity/Indicators/RootActionStateTest.cpp 2015-05-27 14:12:22 +0000
1075@@ -92,4 +92,4 @@
1076 };
1077
1078 QTEST_GUILESS_MAIN(RootActionStateTest)
1079-#include "rootactionstatetest.moc"
1080+#include "RootActionStateTest.moc"
1081
1082=== renamed file 'tests/plugins/Unity/Indicators/sharedunitymenumodeltest.cpp' => 'tests/plugins/Unity/Indicators/SharedUnityMenuModelTest.cpp'
1083--- tests/plugins/Unity/Indicators/sharedunitymenumodeltest.cpp 2014-11-17 23:04:48 +0000
1084+++ tests/plugins/Unity/Indicators/SharedUnityMenuModelTest.cpp 2015-05-27 14:12:22 +0000
1085@@ -99,4 +99,4 @@
1086 };
1087
1088 QTEST_GUILESS_MAIN(SharedUnityMenuModelTest)
1089-#include "sharedunitymenumodeltest.moc"
1090+#include "SharedUnityMenuModelTest.moc"
1091
1092=== renamed file 'tests/plugins/Unity/Indicators/unitymenumodelstacktest.cpp' => 'tests/plugins/Unity/Indicators/UnityMenuModelStackTest.cpp'
1093--- tests/plugins/Unity/Indicators/unitymenumodelstacktest.cpp 2014-08-26 08:14:44 +0000
1094+++ tests/plugins/Unity/Indicators/UnityMenuModelStackTest.cpp 2015-05-27 14:12:22 +0000
1095@@ -205,4 +205,4 @@
1096 };
1097
1098 QTEST_GUILESS_MAIN(UnityMenuModelStackTest)
1099-#include "unitymenumodelstacktest.moc"
1100+#include "UnityMenuModelStackTest.moc"
1101
1102=== modified file 'tests/plugins/Unity/Launcher/CMakeLists.txt'
1103--- tests/plugins/Unity/Launcher/CMakeLists.txt 2015-04-13 08:28:56 +0000
1104+++ tests/plugins/Unity/Launcher/CMakeLists.txt 2015-05-27 14:12:22 +0000
1105@@ -15,11 +15,6 @@
1106 add_definitions(-DLAUNCHER_TESTING)
1107
1108 ### LauncherModelTest
1109-set(testModelCommand dbus-test-runner --task ${CMAKE_CURRENT_BINARY_DIR}/launchermodeltestExec
1110- --parameter -o --parameter ${CMAKE_BINARY_DIR}/launchermodeltest.xml,xunitxml
1111- --parameter -o --parameter -,txt)
1112-add_test(NAME launchermodeltest COMMAND ${testModelCommand})
1113-add_custom_target(launchermodeltest ${testModelCommand})
1114 add_executable(launchermodeltestExec
1115 launchermodeltest.cpp
1116 gsettings.cpp
1117@@ -43,6 +38,11 @@
1118 )
1119 qt5_use_modules(launchermodeltestExec Test Core DBus Xml Gui)
1120
1121+add_unity8_unittest(LauncherModel dbus-test-runner
1122+ ARG_PREFIX "--parameter"
1123+ ARGS --task $<TARGET_FILE:launchermodeltestExec>
1124+)
1125+
1126 # copy .desktop files into build directory for shadow builds
1127 file(GLOB DESKTOP_FILES *.desktop)
1128
1129
1130=== modified file 'tests/plugins/Unity/Session/CMakeLists.txt'
1131--- tests/plugins/Unity/Session/CMakeLists.txt 2014-10-09 14:53:00 +0000
1132+++ tests/plugins/Unity/Session/CMakeLists.txt 2015-05-27 14:12:22 +0000
1133@@ -9,11 +9,6 @@
1134 add_definitions(-DSESSION_TESTING)
1135
1136 ### SessionBackendTest
1137-set(testBackendCommand dbus-test-runner --task ${CMAKE_CURRENT_BINARY_DIR}/sessionbackendtestExec
1138- --parameter -o --parameter ${CMAKE_BINARY_DIR}/sessionbackendtest.xml,xunitxml
1139- --parameter -o --parameter -,txt)
1140-add_test(NAME sessionbackendtest COMMAND ${testBackendCommand})
1141-add_custom_target(sessionbackendtest ${testBackendCommand})
1142 add_executable(sessionbackendtestExec
1143 sessionbackendtest.cpp
1144 ${CMAKE_SOURCE_DIR}/plugins/Unity/Session/dbusunitysessionservice.cpp
1145@@ -22,3 +17,8 @@
1146 unity8-private
1147 )
1148 qt5_use_modules(sessionbackendtestExec Test Core Qml DBus)
1149+
1150+add_unity8_unittest(SessionBackend dbus-test-runner
1151+ ARG_PREFIX "--parameter"
1152+ ARGS --task $<TARGET_FILE:sessionbackendtestExec>
1153+)
1154
1155=== modified file 'tests/plugins/Utils/CMakeLists.txt'
1156--- tests/plugins/Utils/CMakeLists.txt 2015-04-17 12:44:10 +0000
1157+++ tests/plugins/Utils/CMakeLists.txt 2015-05-27 14:12:22 +0000
1158@@ -4,31 +4,17 @@
1159 ${CMAKE_CURRENT_BINARY_DIR}
1160 )
1161
1162-macro(run_tests)
1163- set(_test_list "")
1164- foreach(_test ${ARGN})
1165- set(testCommand env "LC_ALL=C.UTF-8" ${CMAKE_CURRENT_BINARY_DIR}/${_test}Exec
1166- -o ${CMAKE_BINARY_DIR}/${_test}.xml,xunitxml
1167- -o -,txt)
1168- add_test(NAME ${_test} COMMAND ${testCommand})
1169- add_custom_target(${_test} ${testCommand})
1170- add_executable(${_test}Exec ${_test}.cpp modeltest.cpp)
1171- qt5_use_modules(${_test}Exec Test Core Qml)
1172- target_link_libraries(${_test}Exec
1173- Utils-qml
1174- )
1175- set(_test_list "${_test_list};${_test}")
1176- endforeach()
1177-endmacro(run_tests)
1178-
1179-run_tests(
1180- qlimitproxymodeltest
1181- unitysortfilterproxymodeltest
1182- timeformattertest
1183- homekeywatchertest
1184- )
1185+foreach(util_test
1186+ QLimitProxyModel
1187+ UnitySortFilterProxyModel
1188+ TimeFormatter
1189+ HomeKeyWatcher
1190+)
1191+ add_executable(${util_test}TestExec ${util_test}Test.cpp ModelTest.cpp)
1192+ qt5_use_modules(${util_test}TestExec Test Core Qml)
1193+ target_link_libraries(${util_test}TestExec Utils-qml)
1194+ add_unity8_unittest(${util_test} ${util_test}TestExec ADD_TEST)
1195+endforeach()
1196
1197 # plain qml test
1198-set(qmltest_DEFAULT_TARGETS qmltests)
1199-set(qmltest_DEFAULT_PROPERTIES ENVIRONMENT "QT_QPA_PLATFORM=minimal")
1200-add_qml_test(. UtilsStyle IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins)
1201+add_unity8_qmlunittest(. UtilsStyle)
1202
1203=== renamed file 'tests/plugins/Utils/homekeywatchertest.cpp' => 'tests/plugins/Utils/HomeKeyWatcherTest.cpp'
1204--- tests/plugins/Utils/homekeywatchertest.cpp 2015-04-23 12:49:15 +0000
1205+++ tests/plugins/Utils/HomeKeyWatcherTest.cpp 2015-05-27 14:12:22 +0000
1206@@ -320,4 +320,4 @@
1207
1208 QTEST_GUILESS_MAIN(HomeKeyWatcherTest)
1209
1210-#include "homekeywatchertest.moc"
1211+#include "HomeKeyWatcherTest.moc"
1212
1213=== renamed file 'tests/plugins/Utils/modeltest.cpp' => 'tests/plugins/Utils/ModelTest.cpp'
1214--- tests/plugins/Utils/modeltest.cpp 2013-06-05 22:03:08 +0000
1215+++ tests/plugins/Utils/ModelTest.cpp 2015-05-27 14:12:22 +0000
1216@@ -47,7 +47,7 @@
1217
1218 #include <QtGui/QtGui>
1219
1220-#include "modeltest.h"
1221+#include "ModelTest.h"
1222
1223 #include <QtTest/QtTest>
1224
1225
1226=== renamed file 'tests/plugins/Utils/modeltest.h' => 'tests/plugins/Utils/ModelTest.h'
1227=== renamed file 'tests/plugins/Utils/qlimitproxymodeltest.cpp' => 'tests/plugins/Utils/QLimitProxyModelTest.cpp'
1228--- tests/plugins/Utils/qlimitproxymodeltest.cpp 2015-04-30 09:31:51 +0000
1229+++ tests/plugins/Utils/QLimitProxyModelTest.cpp 2015-05-27 14:12:22 +0000
1230@@ -16,7 +16,7 @@
1231
1232 // local
1233 #include "qlimitproxymodelqml.h"
1234-#include "modeltest.h"
1235+#include "ModelTest.h"
1236
1237 // Qt
1238 #include <QTest>
1239@@ -608,4 +608,4 @@
1240
1241 QTEST_GUILESS_MAIN(QLimitProxyModelTest)
1242
1243-#include "qlimitproxymodeltest.moc"
1244+#include "QLimitProxyModelTest.moc"
1245
1246=== renamed file 'tests/plugins/Utils/timeformattertest.cpp' => 'tests/plugins/Utils/TimeFormatterTest.cpp'
1247--- tests/plugins/Utils/timeformattertest.cpp 2014-09-12 08:30:12 +0000
1248+++ tests/plugins/Utils/TimeFormatterTest.cpp 2015-05-27 14:12:22 +0000
1249@@ -45,16 +45,6 @@
1250 }
1251
1252 private Q_SLOTS:
1253- void initTestCase()
1254- {
1255- setenv("UNITY_TEST_ENV", "1", 1);
1256- }
1257-
1258- void cleanupTestCase()
1259- {
1260- unsetenv("UNITY_TEST_ENV");
1261- }
1262-
1263 void testTimeFormatter_Format_data() { addTestData(QList<int>() << 0); }
1264 void testTimeFormatter_Format()
1265 {
1266@@ -162,4 +152,4 @@
1267
1268 QTEST_GUILESS_MAIN(TimeFormatterTest)
1269
1270-#include "timeformattertest.moc"
1271+#include "TimeFormatterTest.moc"
1272
1273=== renamed file 'tests/plugins/Utils/unitysortfilterproxymodeltest.cpp' => 'tests/plugins/Utils/UnitySortFilterProxyModelTest.cpp'
1274--- tests/plugins/Utils/unitysortfilterproxymodeltest.cpp 2015-04-30 09:31:51 +0000
1275+++ tests/plugins/Utils/UnitySortFilterProxyModelTest.cpp 2015-05-27 14:12:22 +0000
1276@@ -19,7 +19,7 @@
1277
1278 // local
1279 #include "unitysortfilterproxymodelqml.h"
1280-#include "modeltest.h"
1281+#include "ModelTest.h"
1282
1283 // Qt
1284 #include <QTest>
1285@@ -287,4 +287,4 @@
1286
1287 QTEST_GUILESS_MAIN(UnitySortFilterProxyModelTest)
1288
1289-#include "unitysortfilterproxymodeltest.moc"
1290+#include "UnitySortFilterProxyModelTest.moc"
1291
1292=== modified file 'tests/plugins/Wizard/CMakeLists.txt'
1293--- tests/plugins/Wizard/CMakeLists.txt 2014-11-21 19:28:16 +0000
1294+++ tests/plugins/Wizard/CMakeLists.txt 2015-05-27 14:12:22 +0000
1295@@ -8,11 +8,11 @@
1296 ${CMAKE_SOURCE_DIR}/plugins/Wizard/PageList.cpp
1297 )
1298 qt5_use_modules(tst-wizard-pagelist Core Qml Test)
1299-add_test(NAME wizardpagelisttest COMMAND env UNITY_TEST_ENV=1 ${CMAKE_CURRENT_BINARY_DIR}/tst-wizard-pagelist)
1300+add_unity8_unittest(WizardPageList tst-wizard-pagelist ENVIRONMENT WIZARD_TESTING=1)
1301
1302 add_executable(tst-wizard-system
1303 tst_system.cpp
1304 ${CMAKE_SOURCE_DIR}/plugins/Wizard/System.cpp
1305 )
1306 qt5_use_modules(tst-wizard-system Core DBus Qml Test)
1307-add_test(NAME wizardsystemtest COMMAND ${CMAKE_CURRENT_BINARY_DIR}/tst-wizard-system)
1308+add_unity8_unittest(WizardSystem tst-wizard-system)
1309
1310=== modified file 'tests/qmltests/CMakeLists.txt'
1311--- tests/qmltests/CMakeLists.txt 2015-05-18 23:04:19 +0000
1312+++ tests/qmltests/CMakeLists.txt 2015-05-27 14:12:22 +0000
1313@@ -1,96 +1,79 @@
1314-# add_qml_test macro
1315-include(QmlTest)
1316
1317 add_subdirectory(Components)
1318
1319-set(qmltest_DEFAULT_IMPORT_PATHS
1320- ${CMAKE_BINARY_DIR}/plugins
1321- ${CMAKE_BINARY_DIR}/tests/utils/modules
1322- ${CMAKE_BINARY_DIR}/tests/mocks
1323-)
1324-
1325-set(qmltest_DEFAULT_TARGETS qmlunittests)
1326-set(qmltest_DEFAULT_NO_ADD_TEST FALSE)
1327-set(qmltest_DEFAULT_PROPERTIES ENVIRONMENT "QT_QPA_PLATFORM=minimal")
1328-add_qml_test(utils/Unity/Test UnityTest)
1329-add_qml_test(Components PhysicalKeysMapper)
1330-
1331-set(qmltest_DEFAULT_TARGETS qmluitests)
1332-set(qmltest_DEFAULT_NO_ADD_TEST TRUE)
1333-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")
1334-
1335-add_qml_test(. Shell)
1336-add_qml_test(. ShellWithPin)
1337-add_qml_test(Components Background)
1338-add_qml_test(Components Carousel)
1339-add_qml_test(Components Dialogs)
1340-add_qml_test(Components DraggingArea)
1341-add_qml_test(Components LazyImage)
1342-add_qml_test(Components Lockscreen)
1343-add_qml_test(Components Rating)
1344-add_qml_test(Components ResponsiveGridView)
1345-add_qml_test(Components ResponsiveVerticalJournal IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/plugins)
1346-add_qml_test(Components Showable)
1347-add_qml_test(Components ZoomableImage)
1348-add_qml_test(Dash Dash)
1349-add_qml_test(Dash DashContent)
1350-add_qml_test(Dash Card)
1351-add_qml_benchmark(Dash CardBenchmark 1000)
1352-add_qml_test(Dash CardTool)
1353-add_qml_test(Dash GenericScopeView)
1354-add_qml_test(Dash PageHeader)
1355-add_qml_test(Dash PreviewListView)
1356-add_qml_test(Dash/Previews Preview)
1357-add_qml_test(Dash/Previews PreviewActions)
1358-add_qml_test(Dash/Previews PreviewAudioPlayback)
1359-add_qml_test(Dash/Previews PreviewExpandable)
1360-add_qml_test(Dash/Previews PreviewHeader)
1361-add_qml_test(Dash/Previews PreviewImageGallery)
1362-add_qml_test(Dash/Previews PreviewPayments)
1363-add_qml_test(Dash/Previews PreviewProgress)
1364-add_qml_test(Dash/Previews PreviewRatingDisplay)
1365-add_qml_test(Dash/Previews PreviewRatingEdit)
1366-add_qml_test(Dash/Previews PreviewRatingInput)
1367-add_qml_test(Dash/Previews PreviewTable)
1368-add_qml_test(Dash/Previews PreviewTextSummary)
1369-add_qml_test(Dash/Previews PreviewVideoPlayback)
1370-add_qml_test(Dash/Previews PreviewWidgetFactory)
1371-add_qml_test(Dash/Previews PreviewZoomableImage)
1372-add_qml_test(Dash/ScopeSettings ScopeSettingBoolean)
1373-add_qml_test(Dash/ScopeSettings ScopeSettingList)
1374-add_qml_test(Dash/ScopeSettings ScopeSettingNumber)
1375-add_qml_test(Dash/ScopeSettings ScopeSettingString)
1376-add_qml_test(Dash/ScopeSettings ScopeSettingsWidgetFactory)
1377-add_qml_test(Greeter Clock)
1378-add_qml_test(Greeter Greeter)
1379-add_qml_test(Greeter Infographics)
1380-add_qml_test(Greeter NarrowView)
1381-add_qml_test(Greeter WideView)
1382-add_qml_test(Launcher Launcher)
1383-add_qml_test(Notifications Notifications)
1384-add_qml_test(Notifications VisualSnapDecisionsQueue)
1385-add_qml_test(Notifications OptionToggle)
1386-add_qml_test(Notifications SwipeToAct)
1387-add_qml_test(Panel ActiveCallHint)
1388-add_qml_test(Panel IndicatorItem)
1389-add_qml_test(Panel IndicatorItemRow)
1390-add_qml_test(Panel IndicatorPage)
1391-add_qml_test(Panel IndicatorsBar)
1392-add_qml_test(Panel IndicatorsMenu)
1393-add_qml_test(Panel MenuContent)
1394-add_qml_test(Panel Panel)
1395-add_qml_test(Panel/Indicators IndicatorsLight ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/QMenuModel")
1396-# These MenuItemFactory tests need the test/mocks/ to come before plugins/
1397-add_qml_test(Panel/Indicators MenuItemFactory IMPORT_PATHS ${CMAKE_BINARY_DIR}/tests/mocks ${qmltest_DEFAULT_IMPORT_PATHS})
1398-add_qml_test(Panel/Indicators MessageMenuItemFactory IMPORT_PATHS ${CMAKE_BINARY_DIR}/tests/mocks ${qmltest_DEFAULT_IMPORT_PATHS})
1399-add_qml_test(Stages ApplicationWindow)
1400-add_qml_test(Stages DesktopStage)
1401-add_qml_test(Stages PhoneStage ENVIRONMENT)
1402-add_qml_test(Stages SpreadDelegate ENVIRONMENT)
1403-add_qml_test(Stages SurfaceContainer ENVIRONMENT)
1404-add_qml_test(Stages SessionContainer ENVIRONMENT)
1405-add_qml_test(Stages TabletStage)
1406-add_qml_test(Stages WindowMoveResizeArea)
1407-add_qml_test(Stages Splash)
1408-add_qml_test(Tutorial Tutorial)
1409-add_qml_test(Wizard Wizard)
1410+add_unity8_qmltest(. Shell LIGHTDM)
1411+add_unity8_qmltest(. ShellWithPin LIGHTDM)
1412+add_unity8_qmltest(Components Background)
1413+add_unity8_qmltest(Components Carousel)
1414+add_unity8_qmltest(Components Dialogs LIGHTDM)
1415+add_unity8_qmltest(Components DraggingArea)
1416+add_unity8_qmltest(Components LazyImage)
1417+add_unity8_qmltest(Components Lockscreen)
1418+add_unity8_qmlunittest(Components PhysicalKeysMapper)
1419+add_unity8_qmltest(Components Rating)
1420+add_unity8_qmltest(Components ResponsiveGridView)
1421+add_unity8_qmltest(Components ResponsiveVerticalJournal)
1422+add_unity8_qmltest(Components Showable)
1423+add_unity8_qmltest(Components ZoomableImage)
1424+add_unity8_qmltest(Dash Dash)
1425+add_unity8_qmltest(Dash DashContent)
1426+add_unity8_qmltest(Dash Card)
1427+add_unity8_qmlbenchmark(Dash CardBenchmark 1000)
1428+add_unity8_qmltest(Dash CardTool)
1429+add_unity8_qmltest(Dash GenericScopeView)
1430+add_unity8_qmltest(Dash PageHeader)
1431+add_unity8_qmltest(Dash PreviewListView)
1432+add_unity8_qmltest(Dash/Previews Preview)
1433+add_unity8_qmltest(Dash/Previews PreviewActions)
1434+add_unity8_qmltest(Dash/Previews PreviewAudioPlayback)
1435+add_unity8_qmltest(Dash/Previews PreviewExpandable)
1436+add_unity8_qmltest(Dash/Previews PreviewHeader)
1437+add_unity8_qmltest(Dash/Previews PreviewImageGallery)
1438+add_unity8_qmltest(Dash/Previews PreviewPayments)
1439+add_unity8_qmltest(Dash/Previews PreviewProgress)
1440+add_unity8_qmltest(Dash/Previews PreviewRatingDisplay)
1441+add_unity8_qmltest(Dash/Previews PreviewRatingEdit)
1442+add_unity8_qmltest(Dash/Previews PreviewRatingInput)
1443+add_unity8_qmltest(Dash/Previews PreviewTable)
1444+add_unity8_qmltest(Dash/Previews PreviewTextSummary)
1445+add_unity8_qmltest(Dash/Previews PreviewVideoPlayback)
1446+add_unity8_qmltest(Dash/Previews PreviewWidgetFactory)
1447+add_unity8_qmltest(Dash/Previews PreviewZoomableImage)
1448+add_unity8_qmltest(Dash/ScopeSettings ScopeSettingBoolean)
1449+add_unity8_qmltest(Dash/ScopeSettings ScopeSettingList)
1450+add_unity8_qmltest(Dash/ScopeSettings ScopeSettingNumber)
1451+add_unity8_qmltest(Dash/ScopeSettings ScopeSettingString)
1452+add_unity8_qmltest(Dash/ScopeSettings ScopeSettingsWidgetFactory)
1453+add_unity8_qmltest(Greeter Clock)
1454+add_unity8_qmltest(Greeter Greeter LIGHTDM)
1455+add_unity8_qmltest(Greeter Infographics LIGHTDM)
1456+add_unity8_qmltest(Greeter NarrowView LIGHTDM)
1457+add_unity8_qmltest(Greeter WideView LIGHTDM)
1458+add_unity8_qmltest(Launcher Launcher)
1459+add_unity8_qmltest(Notifications Notifications)
1460+add_unity8_qmltest(Notifications VisualSnapDecisionsQueue)
1461+add_unity8_qmltest(Notifications OptionToggle)
1462+add_unity8_qmltest(Notifications SwipeToAct)
1463+add_unity8_qmltest(Panel ActiveCallHint)
1464+add_unity8_qmltest(Panel IndicatorItem)
1465+add_unity8_qmltest(Panel IndicatorItemRow)
1466+add_unity8_qmltest(Panel IndicatorPage)
1467+add_unity8_qmltest(Panel IndicatorsBar)
1468+add_unity8_qmltest(Panel IndicatorsMenu)
1469+add_unity8_qmltest(Panel MenuContent)
1470+add_unity8_qmltest(Panel Panel)
1471+add_unity8_qmltest(Panel/Indicators IndicatorsLight)
1472+add_unity8_qmltest(Panel/Indicators MenuItemFactory)
1473+add_unity8_qmltest(Panel/Indicators MessageMenuItemFactory)
1474+add_unity8_qmltest(Stages ApplicationWindow)
1475+add_unity8_qmltest(Stages DesktopStage)
1476+add_unity8_qmltest(Stages PhoneStage)
1477+add_unity8_qmltest(Stages SpreadDelegate)
1478+add_unity8_qmltest(Stages SurfaceContainer)
1479+add_unity8_qmltest(Stages SessionContainer)
1480+add_unity8_qmltest(Stages TabletStage)
1481+add_unity8_qmltest(Stages WindowMoveResizeArea)
1482+add_unity8_qmltest(Stages Splash)
1483+add_unity8_qmltest(Tutorial Tutorial LIGHTDM)
1484+add_unity8_qmltest(Wizard Wizard ENVIRONMENT "OXIDE_NO_SANDBOX=1")
1485+add_unity8_qmlunittest(utils/Unity/Test UnityTest)
1486\ No newline at end of file
1487
1488=== modified file 'tests/qmltests/Components/CMakeLists.txt'
1489--- tests/qmltests/Components/CMakeLists.txt 2015-04-28 14:23:00 +0000
1490+++ tests/qmltests/Components/CMakeLists.txt 2015-05-27 14:12:22 +0000
1491@@ -16,19 +16,13 @@
1492 qt5_use_modules(DragHandleTestExec Test Core Qml Gui Quick)
1493 target_link_libraries(DragHandleTestExec UbuntuGesturesQml UbuntuGestures)
1494
1495-add_binary_qml_test(DragHandle ${CMAKE_BINARY_DIR}/plugins/Ubuntu/Gestures "" "")
1496-add_manual_qml_test(. DragHandle IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${CMAKE_BINARY_DIR}/tests/utils/modules)
1497+add_unity8_uitest(DragHandle DragHandleTestExec ENVIRONMENT LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/plugins/Ubuntu/Gestures)
1498+add_manual_qml_test(. DragHandle IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${CMAKE_BINARY_DIR}/tests/utils/modules)
1499+
1500
1501 ########## tst_EdgeDragEvaluator
1502-
1503-include_directories(
1504- ${CMAKE_SOURCE_DIR}/plugins/Ubuntu/Gestures
1505- ${CMAKE_SOURCE_DIR}/libs/UbuntuGestures
1506- ${CMAKE_CURRENT_BINARY_DIR}
1507- )
1508-
1509 add_executable(EdgeDragEvaluatorTestExec tst_EdgeDragEvaluator.cpp)
1510 qt5_use_modules(EdgeDragEvaluatorTestExec Test Core Qml Gui Quick)
1511 target_link_libraries(EdgeDragEvaluatorTestExec UbuntuGesturesQml UbuntuGestures)
1512
1513-add_binary_qml_test(EdgeDragEvaluator ${CMAKE_BINARY_DIR}/plugins/Ubuntu/Gestures "" "")
1514+add_unity8_uitest(EdgeDragEvaluator EdgeDragEvaluatorTestExec ENVIRONMENT LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/plugins/Ubuntu/Gestures)
1515
1516=== modified file 'tests/qmltests/Stages/tst_WindowMoveResizeArea.qml'
1517--- tests/qmltests/Stages/tst_WindowMoveResizeArea.qml 2015-02-11 17:12:32 +0000
1518+++ tests/qmltests/Stages/tst_WindowMoveResizeArea.qml 2015-05-27 14:12:22 +0000
1519@@ -70,6 +70,7 @@
1520 }
1521
1522 UT.UnityTestCase {
1523+ name: "WindowMoveResizeArea"
1524 when: windowShown
1525
1526 function init() {
1527
1528=== modified file 'tests/qmltests/utils/Unity/Test/tst_UnityTest.qml'
1529--- tests/qmltests/utils/Unity/Test/tst_UnityTest.qml 2013-06-05 22:03:08 +0000
1530+++ tests/qmltests/utils/Unity/Test/tst_UnityTest.qml 2015-05-27 14:12:22 +0000
1531@@ -20,6 +20,8 @@
1532 import Unity.Test 0.1
1533
1534 TestCase {
1535+ name: "UnityTest"
1536+
1537 Rectangle {
1538 id: rect
1539 }
1540@@ -28,28 +30,23 @@
1541 id: testObject
1542 }
1543
1544- // Singletons need to be bound to a property and not-named-imported
1545- // for them to be able to be properly passed back to C++.
1546- // See https://bugreports.qt-project.org/browse/QTBUG-30730
1547- property var util: Util
1548-
1549 function test_direct() {
1550 compare(Util.isInstanceOf(rect, "QQuickRectangle"), true, "rect should be an instance of QQuickRectangle");
1551- compare(Util.isInstanceOf(util, "TestUtil"), true, "Util should be an instance of TestUtil");
1552+ compare(Util.isInstanceOf(Util, "TestUtil"), true, "Util should be an instance of TestUtil");
1553 compare(Util.isInstanceOf(testObject, "MockObjectForInstanceOfTestChild"), true, "testObject should be an instance of MockObjectForInstanceOfTestChild");
1554 }
1555
1556 function test_inherited() {
1557 compare(Util.isInstanceOf(rect, "QQuickItem"), true, "rect should be an instance of QQuickItem");
1558 compare(Util.isInstanceOf(rect, "QObject"), true, "rect should be an instance of QObject");
1559- compare(Util.isInstanceOf(util, "QObject"), true, "Util should be an instance of QObject");
1560+ compare(Util.isInstanceOf(Util, "QObject"), true, "Util should be an instance of QObject");
1561 compare(Util.isInstanceOf(testObject, "MockObjectForInstanceOfTest"), true, "testObject should be an instance of MockObjectForInstanceOfTest");
1562 compare(Util.isInstanceOf(testObject, "QQuickRectangle"), true, "testObject should be an instance of QQuickRectangle");
1563 }
1564
1565 function test_negative() {
1566 compare(Util.isInstanceOf(rect, "QQuickMouseArea"), false, "rect should not be an instance of MouseArea");
1567- compare(Util.isInstanceOf(util, "QQuickItem"), false, "Util should not be an instance of QQuickItem");
1568+ compare(Util.isInstanceOf(Util, "QQuickItem"), false, "Util should not be an instance of QQuickItem");
1569 }
1570
1571 function test_undefined() {
1572
1573=== modified file 'tests/whitespace/CMakeLists.txt'
1574--- tests/whitespace/CMakeLists.txt 2013-06-05 22:03:08 +0000
1575+++ tests/whitespace/CMakeLists.txt 2015-05-27 14:12:22 +0000
1576@@ -2,4 +2,4 @@
1577 # Test that all source files, cmakefiles, etc. do not contain trailing whitespace.
1578 #
1579
1580-add_test(whitespace ${CMAKE_CURRENT_SOURCE_DIR}/check_whitespace.py ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
1581+add_test(Whitespace ${CMAKE_CURRENT_SOURCE_DIR}/check_whitespace.py ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})

Subscribers

People subscribed via source and target branches