summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-10-12 11:04:53 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-10-23 20:54:23 +0200
commit0fdb0715e1e0e927ff8c34297674e7e746046ffe (patch)
tree86321cac3f2a596d4415b4a5e2e078390c561e8d
parent6dddf0f9f5f6769db5b3cc41a5d74c371ff93bf9 (diff)
Use a custom test-config.xml file for test widget
Change-Id: I2c71f5cd1bbfa6d6e2d2c48aaf004b24811dbee1 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
-rw-r--r--cmake/cmake.d/03-macros.cmake10
-rw-r--r--samples.d/config.cmake.sample6
-rw-r--r--test-wgt/test-config.xml.in2
3 files changed, 12 insertions, 6 deletions
diff --git a/cmake/cmake.d/03-macros.cmake b/cmake/cmake.d/03-macros.cmake
index bb5e2b5..2aa35d8 100644
--- a/cmake/cmake.d/03-macros.cmake
+++ b/cmake/cmake.d/03-macros.cmake
@@ -470,6 +470,10 @@ macro(remote_targets_populate)
endmacro(remote_targets_populate)
macro(wgt_package_build)
+ if(NOT EXISTS ${TEST_WIDGET_CONFIG_TEMPLATE})
+ MESSAGE(STATUS "${BoldBlue}Notice!:Using default test widget configuration's file.\n-- If you want to use a customized test-config.xml template then specify TEST_WIDGET_CONFIG_TEMPLATE in your config.cmake file.${ColourReset}")
+ set(TEST_WIDGET_CONFIG_TEMPLATE "${PROJECT_APP_TEMPLATES_DIR}/test-wgt/test-config.xml.in" CACHE PATH "Path to the test widget config file template (test-config.xml.in)")
+ endif()
if(NOT EXISTS ${WIDGET_CONFIG_TEMPLATE})
MESSAGE(FATAL_ERROR "${Red}WARNING ! Missing mandatory files to build widget file.\nYou need a config.xml template: please specify WIDGET_CONFIG_TEMPLATE correctly.${ColourReset}")
endif()
@@ -528,8 +532,8 @@ macro(wgt_package_build)
COMMAND ${CMAKE_COMMAND} -DINFILE=${WIDGET_CONFIG_TEMPLATE} -DOUTFILE=${PROJECT_PKG_BUILD_DIR}/config.xml -DPROJECT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${PROJECT_APP_TEMPLATES_DIR}/cmake/configure_file.cmake
COMMAND cp ${ICON_PATH} ${PROJECT_PKG_BUILD_DIR}/${PROJECT_ICON}
)
- add_custom_command(OUTPUT ${PROJECT_PKG_TEST_DIR}/test-config.xml ${PROJECT_PKG_TEST_DIR}/bin/launcher
- COMMAND ${CMAKE_COMMAND} -DINFILE=${PROJECT_APP_TEMPLATES_DIR}/test-wgt/test-config.xml.in -DOUTFILE=${PROJECT_PKG_TEST_DIR}/config.xml -DPROJECT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${PROJECT_APP_TEMPLATES_DIR}/cmake/configure_file.cmake
+ add_custom_command(OUTPUT ${PROJECT_PKG_TEST_DIR}/config.xml ${PROJECT_PKG_TEST_DIR}/bin/launcher
+ COMMAND ${CMAKE_COMMAND} -DINFILE=${TEST_WIDGET_CONFIG_TEMPLATE} -DOUTFILE=${PROJECT_PKG_TEST_DIR}/config.xml -DPROJECT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${PROJECT_APP_TEMPLATES_DIR}/cmake/configure_file.cmake
COMMAND mkdir -p ${PROJECT_PKG_TEST_DIR}/bin
COMMAND cp ${ICON_PATH} ${PROJECT_PKG_TEST_DIR}/${PROJECT_ICON}
COMMAND cp ${PROJECT_APP_TEMPLATES_DIR}/test-wgt/launcher.sh.in ${PROJECT_PKG_TEST_DIR}/bin/launcher
@@ -546,7 +550,7 @@ macro(wgt_package_build)
)
if(${BUILD_TEST_WGT})
- add_custom_target(packaging_wgt DEPENDS ${PROJECT_PKG_BUILD_DIR}/config.xml ${PROJECT_PKG_TEST_DIR}/test-config.xml ${PROJECT_PKG_TEST_DIR}/bin/launcher)
+ add_custom_target(packaging_wgt DEPENDS ${PROJECT_PKG_BUILD_DIR}/config.xml ${PROJECT_PKG_TEST_DIR}/config.xml ${PROJECT_PKG_TEST_DIR}/bin/launcher)
add_custom_target(widget DEPENDS ${WGT_NAME}.wgt ${WGT_NAME}-test.wgt)
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${CMAKE_CURRENT_BINARY_DIR}/${WGT_NAME}-test.wgt")
else()
diff --git a/samples.d/config.cmake.sample b/samples.d/config.cmake.sample
index 5b75557..2681113 100644
--- a/samples.d/config.cmake.sample
+++ b/samples.d/config.cmake.sample
@@ -106,10 +106,11 @@ set (PKG_REQUIRED_LIST
# -g
# -ggdb
# CACHE STRING "Compilation flags for DEBUG build type.")
-#set(CCOV_COMPILE_OPTIONS
+#set(COVERAGE_COMPILE_OPTIONS
# -g
+# -O0
# --coverage
-# CACHE STRING "Compilation flags for CCOV build type.")
+# CACHE STRING "Compilation flags for COVERAGE build type.")
#set(RELEASE_COMPILE_OPTIONS
# -O2
# -pipe
@@ -133,6 +134,7 @@ set (PKG_REQUIRED_LIST
# -----------------------------------------
#set(WIDGET_ICON "conf.d/wgt/${PROJECT_ICON}" CACHE PATH "Path to the widget icon")
#set(WIDGET_CONFIG_TEMPLATE "${CMAKE_CURRENT_SOURCE_DIR}/conf.d/wgt/config.xml.in" CACHE PATH "Path to widget config file template (config.xml.in)")
+#set(TEST_WIDGET_CONFIG_TEMPLATE "${CMAKE_CURRENT_SOURCE_DIR}/conf.d/wgt/test-config.xml.in" CACHE PATH "Path to the test widget config file template (test-config.xml.in)")
# Mandatory widget Mimetype specification of the main unit
# --------------------------------------------------------------------------
diff --git a/test-wgt/test-config.xml.in b/test-wgt/test-config.xml.in
index b39d88e..a5e645b 100644
--- a/test-wgt/test-config.xml.in
+++ b/test-wgt/test-config.xml.in
@@ -3,7 +3,7 @@
<name>@PROJECT_NAME@-test</name>
<icon src="@PROJECT_ICON@"/>
<content src="bin/launcher" type="application/vnd.agl.native"/>
- <description>Supplementary widget used to launch tests for the project @PROJECT_NAME@</description>
+ <description>Test widget used to launch tests for the project @PROJECT_NAME@</description>
<author>Romain Forlot &lt;romain.forlot@iot.bzh&gt;</author>
<license>APL2.0</license>