diff options
author | Mikhail Durnev <mikhail_durnev@mentor.com> | 2015-10-20 20:57:57 +1000 |
---|---|---|
committer | Mikhail Durnev <mikhail_durnev@mentor.com> | 2015-10-23 13:23:27 +1000 |
commit | 0535df2c32dc562bd5f7704a599b982bc9e102df (patch) | |
tree | 75b95bccbc72362bd1c645ef07b8ca16279b56a1 /recipes-graphics | |
parent | d272cfddde1bffa2b31cb5af382198e300d3a619 (diff) |
wayland-ivi-extension: Build unit test apps
The wayland-ivi-extension package provides unit test applications.
The recipe was modified to build those apps and install them on the target
in a separate ipk/rpm package.
The test apps are not compatible with ptest. Ctest is required to run them
on the target.
Change-Id: I937fde52eafc20f38ab7c8ff2d2981cc4f836f33
Signed-off-by: Mikhail Durnev <mikhail_durnev@mentor.com>
Diffstat (limited to 'recipes-graphics')
3 files changed, 91 insertions, 0 deletions
diff --git a/recipes-graphics/wayland/wayland-ivi-extension/cmake-find-gtest.patch b/recipes-graphics/wayland/wayland-ivi-extension/cmake-find-gtest.patch new file mode 100644 index 000000000..5371174d5 --- /dev/null +++ b/recipes-graphics/wayland/wayland-ivi-extension/cmake-find-gtest.patch @@ -0,0 +1,22 @@ +diff -Naur old/ivi-input-api/test/CMakeLists.txt new/ivi-input-api/test/CMakeLists.txt +--- old/ivi-input-api/test/CMakeLists.txt 2015-10-19 23:31:13.000000000 +1000 ++++ new/ivi-input-api/test/CMakeLists.txt 2015-10-19 23:30:32.000000000 +1000 +@@ -18,6 +18,7 @@ + ############################################################################ + + CMAKE_MINIMUM_REQUIRED(VERSION 2.6) ++SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/modules) + + FIND_PACKAGE(gtest) + +diff -Naur old/ivi-layermanagement-api/test/CMakeLists.txt new/ivi-layermanagement-api/test/CMakeLists.txt +--- old/ivi-layermanagement-api/test/CMakeLists.txt 2015-10-19 23:31:20.000000000 +1000 ++++ new/ivi-layermanagement-api/test/CMakeLists.txt 2015-10-19 23:30:48.000000000 +1000 +@@ -18,6 +18,7 @@ + ############################################################################ + + CMAKE_MINIMUM_REQUIRED(VERSION 2.6) ++SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/modules) + + FIND_PACKAGE(gtest) + diff --git a/recipes-graphics/wayland/wayland-ivi-extension/test-path.patch b/recipes-graphics/wayland/wayland-ivi-extension/test-path.patch new file mode 100644 index 000000000..9de50187e --- /dev/null +++ b/recipes-graphics/wayland/wayland-ivi-extension/test-path.patch @@ -0,0 +1,46 @@ +diff -Naur old/ivi-input-api/test/CMakeLists.txt new/ivi-input-api/test/CMakeLists.txt +--- old/ivi-input-api/test/CMakeLists.txt 2015-10-20 00:25:36.000000000 +1000 ++++ new/ivi-input-api/test/CMakeLists.txt 2015-10-20 17:57:45.000000000 +1000 +@@ -66,14 +66,15 @@ + ADD_DEPENDENCIES(${PROJECT_NAME} ${LIBS}) + + IF(INSTALL_ILM_API_TESTS) +- INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin) ++ INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/test) ++ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/CTestTestfile.cmake DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/test/ivi-input-api) + ENDIF() + + # use CTest + ENABLE_TESTING() +- ADD_TEST(ilmCommon ${PROJECT_NAME}) +- ADD_TEST(ilmClient ${PROJECT_NAME}) +- ADD_TEST(ilmControl ${PROJECT_NAME}) +- ADD_TEST(ilmInput ${PROJECT_NAME}) ++ ADD_TEST(ilmCommon ${CMAKE_INSTALL_LIBEXECDIR}/test/${PROJECT_NAME}) ++ ADD_TEST(ilmClient ${CMAKE_INSTALL_LIBEXECDIR}/test/${PROJECT_NAME}) ++ ADD_TEST(ilmControl ${CMAKE_INSTALL_LIBEXECDIR}/test/${PROJECT_NAME}) ++ ADD_TEST(ilmInput ${CMAKE_INSTALL_LIBEXECDIR}/test/${PROJECT_NAME}) + + ENDIF() +diff -Naur old/ivi-layermanagement-api/test/CMakeLists.txt new/ivi-layermanagement-api/test/CMakeLists.txt +--- old/ivi-layermanagement-api/test/CMakeLists.txt 2015-10-20 00:25:36.000000000 +1000 ++++ new/ivi-layermanagement-api/test/CMakeLists.txt 2015-10-20 17:57:24.000000000 +1000 +@@ -64,13 +64,14 @@ + ADD_DEPENDENCIES(${PROJECT_NAME} ${LIBS}) + + IF(INSTALL_ILM_API_TESTS) +- INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin) ++ INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/test) ++ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/CTestTestfile.cmake DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/test/ivi-layermanagement-api) + ENDIF() + + # use CTest + ENABLE_TESTING() +- ADD_TEST(ilmCommon ${PROJECT_NAME}) +- ADD_TEST(ilmClient ${PROJECT_NAME}) +- ADD_TEST(ilmControl ${PROJECT_NAME}) ++ ADD_TEST(ilmCommon ${CMAKE_INSTALL_LIBEXECDIR}/test/${PROJECT_NAME}) ++ ADD_TEST(ilmClient ${CMAKE_INSTALL_LIBEXECDIR}/test/${PROJECT_NAME}) ++ ADD_TEST(ilmControl ${CMAKE_INSTALL_LIBEXECDIR}/test/${PROJECT_NAME}) + + ENDIF() diff --git a/recipes-graphics/wayland/wayland-ivi-extension_1.5.0.bbappend b/recipes-graphics/wayland/wayland-ivi-extension_1.5.0.bbappend index f30bf7f17..da97895a2 100644 --- a/recipes-graphics/wayland/wayland-ivi-extension_1.5.0.bbappend +++ b/recipes-graphics/wayland/wayland-ivi-extension_1.5.0.bbappend @@ -1,5 +1,28 @@ FILESEXTRAPATHS_append := ":${THISDIR}/${PN}" +ENABLE_TEST = "-DBUILD_ILM_API_TESTS:BOOL=TRUE \ + -DINSTALL_ILM_API_TESTS:BOOL=TRUE \ + " + +DISABLE_TEST = "-DBUILD_ILM_API_TESTS:BOOL=FALSE \ + -DINSTALL_ILM_API_TESTS:BOOL=FALSE \ + " + +PACKAGECONFIG ??= "test" +PACKAGECONFIG[test] = "${ENABLE_TEST},${DISABLE_TEST},gtest" + SRC_URI_append = "\ file://0001-wayland-ivi-extension-patch-for-wl-shell-emulator.patch \ + file://cmake-find-gtest.patch \ + file://test-path.patch \ " + +PACKAGES =+ "${PN}-test" + +FILES_${PN}-test = "${libdir}/${PN}/test/*/CTestTestfile.cmake \ + ${libdir}/${PN}/test/ivi-layermanagement-api-test \ + ${libdir}/${PN}/test/ivi-input-api-test \ + " +FILES_${PN}-dbg += "${libdir}/${PN}/test/.debug" + +RDEPENDS_${PN}-test += "cmake" |