on xenial help sign in
last fixups to make all tests run (with source dir still in place)
commitcea014f1913815f60ca1483ab9ed66723b5cfd0e authorMichael Terry <michael.terry@canonical.com> dateThu 21 Apr 2016, 15:21 (10 years ago) parentd181cb2
3 files changed+27−6
cmake/modules/QmlTest.cmake+6−1 tests/libs/UbuntuGestures/CMakeLists.txt+7−3 tests/qmltests/Components/CMakeLists.txt+14−2
cmake/modules/QmlTest.cmake+6−1
@@ -64,6 +64,7 @@ endfunction()
6464
6565function(add_qml_test_data PATH COMPONENT_NAME)
6666 set(filename "${CMAKE_CURRENT_SOURCE_DIR}/${PATH}/${COMPONENT_NAME}")
67+ file(RELATIVE_PATH relcurpath "${CMAKE_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}")
6768
6869 if (IS_DIRECTORY "${filename}")
6970 # As a convenience, allow specifying a directory and we will install
@@ -89,7 +90,7 @@ function(add_qml_test_data PATH COMPONENT_NAME)
8990 endif()
9091
9192 install(FILES "${filename}"
92− DESTINATION "${SHELL_APP_DIR}/tests/qmltests/${PATH}"
93+ DESTINATION "${SHELL_APP_DIR}/${relcurpath}/${PATH}"
9394 )
9495endfunction()
9596
@@ -302,11 +303,15 @@ function(add_test_target TARGET_NAME)
302303
303304 # Now some replacements...
304305 # replace build/source roots with their install paths
306+ string(REPLACE \"${CMAKE_BINARY_DIR}/libs\" \"${CMAKE_INSTALL_PREFIX}/${SHELL_PRIVATE_LIBDIR}\" replacestr \"\${replacestr}\")
305307 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}\")
306309 string(REPLACE \"${CMAKE_BINARY_DIR}/tests/mocks\" \"${CMAKE_INSTALL_PREFIX}/${SHELL_INSTALL_QML}/mocks\" replacestr \"\${replacestr}\")
307310 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}\")
308312 string(REPLACE \"${CMAKE_BINARY_DIR}/tests/uqmlscene\" \"${CMAKE_INSTALL_PREFIX}/${SHELL_PRIVATE_LIBDIR}\" replacestr \"\${replacestr}\")
309313 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}\")
310315 string(REPLACE \"${CMAKE_SOURCE_DIR}/tests/qmltests\" \"${CMAKE_INSTALL_PREFIX}/${SHELL_APP_DIR}/tests/qmltests\" replacestr \"\${replacestr}\")
311316 # tests like to write xml output to our builddir; we don't need that
312317 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)
77 add_executable(${CLASSNAME}TestExec tst_${CLASSNAME}.cpp)
88 qt5_use_modules(${CLASSNAME}TestExec Test Core Gui Quick)
99 target_link_libraries(${CLASSNAME}TestExec UbuntuGestures)
10−
11− add_unity8_unittest(${CLASSNAME} ${CLASSNAME}TestExec
12− ENVIRONMENT LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/libs/UbuntuGestures
10+ install(TARGETS ${CLASSNAME}TestExec
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}"
1315 )
16+
17+ add_unity8_unittest(${CLASSNAME} ${CLASSNAME}TestExec)
1418endmacro(add_gesture_test)
1519
1620add_gesture_test(TouchRegistry)
tests/qmltests/Components/CMakeLists.txt+14−2
@@ -13,8 +13,14 @@ include_directories(
1313add_executable(DragHandleTestExec tst_DragHandle.cpp)
1414qt5_use_modules(DragHandleTestExec Test Core Qml Gui Quick)
1515target_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+ )
1622
17−add_unity8_uitest(DragHandle DragHandleTestExec ENVIRONMENT LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/plugins/Ubuntu/Gestures)
23+add_unity8_uitest(DragHandle DragHandleTestExec)
1824add_manual_qml_test(. DragHandle IMPORT_PATHS ${UNITY_IMPORT_PATHS})
1925add_unity8_qmltest_data(tst_DragHandle BidirectionalShowable)
2026add_unity8_qmltest_data(tst_DragHandle HorizontalShowable)
@@ -25,5 +31,11 @@ add_unity8_qmltest_data(tst_DragHandle VerticalShowable)
2531add_executable(EdgeDragEvaluatorTestExec tst_EdgeDragEvaluator.cpp)
2632qt5_use_modules(EdgeDragEvaluatorTestExec Test Core Qml Gui Quick)
2733target_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+ )
2840
29−add_unity8_uitest(EdgeDragEvaluator EdgeDragEvaluatorTestExec ENVIRONMENT LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/plugins/Ubuntu/Gestures)
41+add_unity8_uitest(EdgeDragEvaluator EdgeDragEvaluatorTestExec)