on xenial help sign in
last fixups to make all tests run (with source dir still in place)
cea014fMichael Terry
cmake/modules/QmlTest.cmake+6−1
@@ -64,6 +64,7 @@ endfunction()
64
64
65function(add_qml_test_data PATH COMPONENT_NAME)
65function(add_qml_test_data PATH COMPONENT_NAME)
66 set(filename "${CMAKE_CURRENT_SOURCE_DIR}/${PATH}/${COMPONENT_NAME}")
66 set(filename "${CMAKE_CURRENT_SOURCE_DIR}/${PATH}/${COMPONENT_NAME}")
67+ file(RELATIVE_PATH relcurpath "${CMAKE_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}")
67
68
68 if (IS_DIRECTORY "${filename}")
69 if (IS_DIRECTORY "${filename}")
69 # As a convenience, allow specifying a directory and we will install
70 # As a convenience, allow specifying a directory and we will install
@@ -89,7 +90,7 @@ function(add_qml_test_data PATH COMPONENT_NAME)
89 endif()
90 endif()
90
91
91 install(FILES "${filename}"
92 install(FILES "${filename}"
92− DESTINATION "${SHELL_APP_DIR}/tests/qmltests/${PATH}"
93+ DESTINATION "${SHELL_APP_DIR}/${relcurpath}/${PATH}"
93 )
94 )
94endfunction()
95endfunction()
95
96
@@ -302,11 +303,15 @@ function(add_test_target TARGET_NAME)
302
303
303 # Now some replacements...
304 # Now some replacements...
304 # replace build/source roots with their install paths
305 # replace build/source roots with their install paths
306+ string(REPLACE \"${CMAKE_BINARY_DIR}/libs\" \"${CMAKE_INSTALL_PREFIX}/${SHELL_PRIVATE_LIBDIR}\" replacestr \"\${replacestr}\")
305 string(REPLACE \"${CMAKE_BINARY_DIR}/plugins\" \"${CMAKE_INSTALL_PREFIX}/${SHELL_INSTALL_QML}\" replacestr \"\${replacestr}\")
307 string(REPLACE \"${CMAKE_BINARY_DIR}/plugins\" \"${CMAKE_INSTALL_PREFIX}/${SHELL_INSTALL_QML}\" replacestr \"\${replacestr}\")
308+ string(REPLACE \"${CMAKE_BINARY_DIR}/tests/libs\" \"${CMAKE_INSTALL_PREFIX}/${SHELL_PRIVATE_LIBDIR}/tests/libs\" replacestr \"\${replacestr}\")
306 string(REPLACE \"${CMAKE_BINARY_DIR}/tests/mocks\" \"${CMAKE_INSTALL_PREFIX}/${SHELL_INSTALL_QML}/mocks\" replacestr \"\${replacestr}\")
309 string(REPLACE \"${CMAKE_BINARY_DIR}/tests/mocks\" \"${CMAKE_INSTALL_PREFIX}/${SHELL_INSTALL_QML}/mocks\" replacestr \"\${replacestr}\")
307 string(REPLACE \"${CMAKE_BINARY_DIR}/tests/plugins\" \"${CMAKE_INSTALL_PREFIX}/${SHELL_PRIVATE_LIBDIR}/tests/plugins\" replacestr \"\${replacestr}\")
310 string(REPLACE \"${CMAKE_BINARY_DIR}/tests/plugins\" \"${CMAKE_INSTALL_PREFIX}/${SHELL_PRIVATE_LIBDIR}/tests/plugins\" replacestr \"\${replacestr}\")
311+ string(REPLACE \"${CMAKE_BINARY_DIR}/tests/qmltests\" \"${CMAKE_INSTALL_PREFIX}/${SHELL_PRIVATE_LIBDIR}/tests/qmltests\" replacestr \"\${replacestr}\")
308 string(REPLACE \"${CMAKE_BINARY_DIR}/tests/uqmlscene\" \"${CMAKE_INSTALL_PREFIX}/${SHELL_PRIVATE_LIBDIR}\" replacestr \"\${replacestr}\")
312 string(REPLACE \"${CMAKE_BINARY_DIR}/tests/uqmlscene\" \"${CMAKE_INSTALL_PREFIX}/${SHELL_PRIVATE_LIBDIR}\" replacestr \"\${replacestr}\")
309 string(REPLACE \"${CMAKE_BINARY_DIR}/tests/utils/modules\" \"${CMAKE_INSTALL_PREFIX}/${SHELL_INSTALL_QML}/utils\" replacestr \"\${replacestr}\")
313 string(REPLACE \"${CMAKE_BINARY_DIR}/tests/utils/modules\" \"${CMAKE_INSTALL_PREFIX}/${SHELL_INSTALL_QML}/utils\" replacestr \"\${replacestr}\")
314+ string(REPLACE \"${CMAKE_SOURCE_DIR}/tests/plugins\" \"${CMAKE_INSTALL_PREFIX}/${SHELL_APP_DIR}/tests/plugins\" replacestr \"\${replacestr}\")
310 string(REPLACE \"${CMAKE_SOURCE_DIR}/tests/qmltests\" \"${CMAKE_INSTALL_PREFIX}/${SHELL_APP_DIR}/tests/qmltests\" replacestr \"\${replacestr}\")
315 string(REPLACE \"${CMAKE_SOURCE_DIR}/tests/qmltests\" \"${CMAKE_INSTALL_PREFIX}/${SHELL_APP_DIR}/tests/qmltests\" replacestr \"\${replacestr}\")
311 # tests like to write xml output to our builddir; we don't need that
316 # tests like to write xml output to our builddir; we don't need that
312 string(REGEX REPLACE \"( '--parameter')? '-o'( '--parameter')? '[^ ]*,xunitxml' \" \" \" replacestr \"\${replacestr}\")
317 string(REGEX REPLACE \"( '--parameter')? '-o'( '--parameter')? '[^ ]*,xunitxml' \" \" \" replacestr \"\${replacestr}\")
tests/libs/UbuntuGestures/CMakeLists.txt+7−3
@@ -7,10 +7,14 @@ macro(add_gesture_test CLASSNAME)
7 add_executable(${CLASSNAME}TestExec tst_${CLASSNAME}.cpp)
7 add_executable(${CLASSNAME}TestExec tst_${CLASSNAME}.cpp)
8 qt5_use_modules(${CLASSNAME}TestExec Test Core Gui Quick)
8 qt5_use_modules(${CLASSNAME}TestExec Test Core Gui Quick)
9 target_link_libraries(${CLASSNAME}TestExec UbuntuGestures)
9 target_link_libraries(${CLASSNAME}TestExec UbuntuGestures)
10−
11− add_unity8_unittest(${CLASSNAME} ${CLASSNAME}TestExec
10+ install(TARGETS ${CLASSNAME}TestExec
12− ENVIRONMENT LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/libs/UbuntuGestures
11+ DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/libs/UbuntuGestures"
12+ )
13+ set_target_properties(${CLASSNAME}TestExec PROPERTIES
14+ INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${SHELL_PRIVATE_LIBDIR}"
13 )
15 )
16+
17+ add_unity8_unittest(${CLASSNAME} ${CLASSNAME}TestExec)
14endmacro(add_gesture_test)
18endmacro(add_gesture_test)
15
19
16add_gesture_test(TouchRegistry)
20add_gesture_test(TouchRegistry)
tests/qmltests/Components/CMakeLists.txt+14−2
@@ -13,8 +13,14 @@ include_directories(
13add_executable(DragHandleTestExec tst_DragHandle.cpp)
13add_executable(DragHandleTestExec tst_DragHandle.cpp)
14qt5_use_modules(DragHandleTestExec Test Core Qml Gui Quick)
14qt5_use_modules(DragHandleTestExec Test Core Qml Gui Quick)
15target_link_libraries(DragHandleTestExec UbuntuGesturesQml UbuntuGestures)
15target_link_libraries(DragHandleTestExec UbuntuGesturesQml UbuntuGestures)
16+install(TARGETS DragHandleTestExec
17+ DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/qmltests/Components"
18+ )
19+set_target_properties(DragHandleTestExec PROPERTIES
20+ INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${SHELL_INSTALL_QML}/Ubuntu/Gestures:${CMAKE_INSTALL_PREFIX}/${SHELL_PRIVATE_LIBDIR}"
21+ )
16
22
17−add_unity8_uitest(DragHandle DragHandleTestExec ENVIRONMENT LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/plugins/Ubuntu/Gestures)
23+add_unity8_uitest(DragHandle DragHandleTestExec)
18add_manual_qml_test(. DragHandle IMPORT_PATHS ${UNITY_IMPORT_PATHS})
24add_manual_qml_test(. DragHandle IMPORT_PATHS ${UNITY_IMPORT_PATHS})
19add_unity8_qmltest_data(tst_DragHandle BidirectionalShowable)
25add_unity8_qmltest_data(tst_DragHandle BidirectionalShowable)
20add_unity8_qmltest_data(tst_DragHandle HorizontalShowable)
26add_unity8_qmltest_data(tst_DragHandle HorizontalShowable)
@@ -25,5 +31,11 @@ add_unity8_qmltest_data(tst_DragHandle VerticalShowable)
25add_executable(EdgeDragEvaluatorTestExec tst_EdgeDragEvaluator.cpp)
31add_executable(EdgeDragEvaluatorTestExec tst_EdgeDragEvaluator.cpp)
26qt5_use_modules(EdgeDragEvaluatorTestExec Test Core Qml Gui Quick)
32qt5_use_modules(EdgeDragEvaluatorTestExec Test Core Qml Gui Quick)
27target_link_libraries(EdgeDragEvaluatorTestExec UbuntuGesturesQml UbuntuGestures)
33target_link_libraries(EdgeDragEvaluatorTestExec UbuntuGesturesQml UbuntuGestures)
34+install(TARGETS EdgeDragEvaluatorTestExec
35+ DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/qmltests/Components"
36+ )
37+set_target_properties(EdgeDragEvaluatorTestExec PROPERTIES
38+ INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${SHELL_INSTALL_QML}/Ubuntu/Gestures:${CMAKE_INSTALL_PREFIX}/${SHELL_PRIVATE_LIBDIR}"
39+ )
28
40
29−add_unity8_uitest(EdgeDragEvaluator EdgeDragEvaluatorTestExec ENVIRONMENT LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/plugins/Ubuntu/Gestures)
41+add_unity8_uitest(EdgeDragEvaluator EdgeDragEvaluatorTestExec)