Merge lp:~mzanetti/unity8/make-xvfbtestSomething into lp:unity8

Proposed by Michael Zanetti
Status: Superseded
Proposed branch: lp:~mzanetti/unity8/make-xvfbtestSomething
Merge into: lp:unity8
Diff against target: 149 lines (+58/-8)
6 files modified
build (+1/-0)
cmake/modules/QmlTest.cmake (+27/-3)
tests/CMakeLists.txt (+2/-2)
tests/plugins/Ubuntu/Gestures/CMakeLists.txt (+14/-2)
tests/qmltests/Components/CMakeLists.txt (+13/-1)
tests/qmltests/Components/tst_LazyImage.qml (+1/-0)
To merge this branch: bzr merge lp:~mzanetti/unity8/make-xvfbtestSomething
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Andrea Cimitan (community) Abstain
Review via email: mp+211522@code.launchpad.net

This proposal has been superseded by a proposal from 2014-03-18.

Commit message

add "make xvfbtestSomething" target to run qml tests in xvfb

Description of the change

* Are there any related MPs required for this MP to build/function as expected? Please list.

N/A

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

Yes

* 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.
776. By Michael Zanetti

use long options, add auto-servernum, only add xvfbtest to qmluitests

777. By Michael Zanetti

apply same to tests not added by that macro

778. By Michael Zanetti

fix flakyness in tst_LazyImage with xvfb

779. By Michael Zanetti

add xvfb as a dep to ./build

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Andrea Cimitan (cimi) wrote :

I think we need to make xvfb optional in ./build, otherwise it might not work on the devices without X (like mobile)

review: Needs Fixing
Revision history for this message
Michael Zanetti (mzanetti) wrote :

> I think we need to make xvfb optional in ./build, otherwise it might not work
> on the devices without X (like mobile)

this is only installed with ./build -s. For running on the device you should use ./run_on_device -s

Revision history for this message
Andrea Cimitan (cimi) :
review: Abstain
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
780. By Michael Zanetti

merge single test function branch as a prereq

781. By Michael Zanetti

always add NO_ADD_TEST to xvfb target

782. By Michael Zanetti

abstract binary qml test targets into add_binary_qml_test macro

783. By Michael Zanetti

make it a bit more generic

784. By Michael Zanetti

set LD_LIBRARY_PATH conditionally, depending on the availability of gcc

785. By Michael Zanetti

merge trunk

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'build'
2--- build 2014-01-29 19:12:48 +0000
3+++ build 2014-03-18 16:20:45 +0000
4@@ -52,6 +52,7 @@
5 unity-scope-home \
6 unity-lens-applications \
7 unity-plugin-scopes \
8+ xvfb \
9 || exit 5
10 }
11
12
13=== modified file 'cmake/modules/QmlTest.cmake'
14--- cmake/modules/QmlTest.cmake 2013-06-18 12:47:43 +0000
15+++ cmake/modules/QmlTest.cmake 2014-03-18 16:20:45 +0000
16@@ -65,6 +65,7 @@
17 cmake_parse_arguments(qmltest "${options}" "" "${multi_value_keywords}" ${ARGN})
18
19 set(qmltest_TARGET test${COMPONENT_NAME})
20+ set(qmltest_xvfb_TARGET xvfbtest${COMPONENT_NAME})
21 set(qmltest_FILE ${SUBPATH}/tst_${COMPONENT_NAME})
22
23 set(qmltestrunner_imports "")
24@@ -80,13 +81,37 @@
25 endforeach(IMPORT_PATH)
26 endif()
27
28+ string(TOLOWER "${CMAKE_GENERATOR}" cmake_generator_lower)
29+ if(cmake_generator_lower STREQUAL "unix makefiles")
30+ set(function_ARGS $(FUNCTION))
31+ else()
32+ set(function_ARGS "")
33+ endif()
34+
35 set(qmltest_command
36 env ${qmltest_ENVIRONMENT}
37 ${qmltestrunner_exe} -input ${CMAKE_CURRENT_SOURCE_DIR}/${qmltest_FILE}.qml
38 ${qmltestrunner_imports}
39 -o ${CMAKE_BINARY_DIR}/${qmltest_TARGET}.xml,xunitxml
40 -o -,txt
41- )
42+ ${function_ARGS}
43+ )
44+ set(qmltest_xvfb_command
45+ env ${qmltest_ENVIRONMENT} LD_PRELOAD=/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1
46+ xvfb-run --server-args "-screen 0 1024x768x24" --auto-servernum
47+ ${qmltestrunner_exe} -input ${CMAKE_CURRENT_SOURCE_DIR}/${qmltest_FILE}.qml
48+ ${qmltestrunner_imports}
49+ -o ${CMAKE_BINARY_DIR}/${qmltest_TARGET}.xml,xunitxml
50+ -o -,txt
51+ ${function_ARGS}
52+ )
53+
54+ add_qmltest_target(${qmltest_TARGET} "${qmltest_command}" TRUE)
55+ add_qmltest_target(${qmltest_xvfb_TARGET} "${qmltest_xvfb_command}" ${qmltest_NO_TARGETS})
56+ add_manual_qml_test(${SUBPATH} ${COMPONENT_NAME} ${ARGN})
57+endmacro(add_qml_test)
58+
59+macro(add_qmltest_target qmltest_TARGET qmltest_command qmltest_NO_TARGETS)
60 add_custom_target(${qmltest_TARGET} ${qmltest_command})
61
62 if(NOT "${qmltest_PROPERTIES}" STREQUAL "")
63@@ -117,5 +142,4 @@
64 endif()
65 endif("${qmltest_NO_TARGETS}" STREQUAL "FALSE")
66
67- add_manual_qml_test(${SUBPATH} ${COMPONENT_NAME} ${ARGN})
68-endmacro(add_qml_test)
69+endmacro(add_qmltest_target)
70
71=== modified file 'tests/CMakeLists.txt'
72--- tests/CMakeLists.txt 2013-07-04 14:47:47 +0000
73+++ tests/CMakeLists.txt 2014-03-18 16:20:45 +0000
74@@ -1,7 +1,7 @@
75-# QML tests that do not require graphical capabitlies.
76+# QML tests that do not require graphical capabilities.
77 add_custom_target(qmlunittests)
78
79-# QML tests that require graphical capabitlies.
80+# QML tests that require graphical capabilities.
81 add_custom_target(qmluitests)
82
83 add_custom_target(qmltests)
84
85=== modified file 'tests/plugins/Ubuntu/Gestures/CMakeLists.txt'
86--- tests/plugins/Ubuntu/Gestures/CMakeLists.txt 2013-12-17 14:56:25 +0000
87+++ tests/plugins/Ubuntu/Gestures/CMakeLists.txt 2014-03-18 16:20:45 +0000
88@@ -22,8 +22,20 @@
89 -o -,txt)
90
91 add_custom_target(test${CLASSNAME} ${testCommand})
92- add_dependencies(qmluitests test${CLASSNAME})
93- add_dependencies(test${CLASSNAME} ${CLASSNAME}TestExec UbuntuGesturesTestQmlFiles)
94+ add_dependencies(test${CLASSNAME} ${CLASSNAME}TestExec UbuntuGesturesTestQmlFiles)
95+
96+ set(xvfbtestCommand
97+ LD_PRELOAD=/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1
98+ LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/plugins/Ubuntu/Gestures
99+ xvfb-run --server-args "-screen 0 1024x768x24" --auto-servernum
100+ ${CMAKE_CURRENT_BINARY_DIR}/${CLASSNAME}TestExec
101+ -o ${CMAKE_BINARY_DIR}/${CLASSNAME}Test.xml,xunitxml
102+ -o -,txt)
103+
104+ add_custom_target(xvfbtest${CLASSNAME} ${xvfbtestCommand})
105+ add_dependencies(test${CLASSNAME} ${CLASSNAME}TestExec UbuntuGesturesTestQmlFiles)
106+
107+ add_dependencies(qmluitests xvfbtest${CLASSNAME})
108
109 add_executable(${CLASSNAME}TestExec tst_${CLASSNAME}.cpp GestureTest.cpp)
110 qt5_use_modules(${CLASSNAME}TestExec Test Core Qml Gui Quick)
111
112=== modified file 'tests/qmltests/Components/CMakeLists.txt'
113--- tests/qmltests/Components/CMakeLists.txt 2013-12-17 14:56:25 +0000
114+++ tests/qmltests/Components/CMakeLists.txt 2014-03-18 16:20:45 +0000
115@@ -13,9 +13,21 @@
116 -o -,txt)
117
118 add_custom_target(testDragHandle ${testCommand})
119-add_dependencies(qmluitests testDragHandle)
120 add_dependencies(testDragHandle DragHandleTestExec)
121
122+set(xvfbtestCommand
123+ LD_PRELOAD=/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1
124+ LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/plugins/Ubuntu/Gestures
125+ xvfb-run --server-args "-screen 0 1024x768x24" --auto-servernum
126+ ${CMAKE_CURRENT_BINARY_DIR}/DragHandleTestExec
127+ -o ${CMAKE_BINARY_DIR}/DragHandleTest.xml,xunitxml
128+ -o -,txt)
129+
130+add_custom_target(xvfbtestDragHandle ${xvfbtestCommand})
131+add_dependencies(xvfbtestDragHandle DragHandleTestExec)
132+
133+add_dependencies(qmluitests xvfbtestDragHandle)
134+
135 add_executable(DragHandleTestExec tst_DragHandle.cpp)
136 qt5_use_modules(DragHandleTestExec Test Core Qml Gui Quick)
137 target_link_libraries(DragHandleTestExec UbuntuGestureQml)
138
139=== modified file 'tests/qmltests/Components/tst_LazyImage.qml'
140--- tests/qmltests/Components/tst_LazyImage.qml 2014-02-28 15:15:31 +0000
141+++ tests/qmltests/Components/tst_LazyImage.qml 2014-03-18 16:20:45 +0000
142@@ -152,6 +152,7 @@
143
144 function test_lazyimage(data) {
145 data.func();
146+ waitForRendering(baseRect);
147
148 if (data.transition) {
149 // wait for the transition to complete

Subscribers

People subscribed via source and target branches