aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-10-15 18:11:16 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-10-16 12:55:11 +0200
commit765504ef7989150fd69a0b4023d3dcc36190380a (patch)
tree1b9e3e908ff1572adc6a00107465d73f72325036
parent210e7a74326c5e01de42bcb3c2375db92a32a27c (diff)
Use a custom test-config.xml file for test widget
Bug-AGL: SPEC-1821 Change-Id: If664757a7dec8e43cd8f4776bab16d026e583752 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.sample5
-rw-r--r--test-widget/test-config.xml.in2
3 files changed, 11 insertions, 6 deletions
diff --git a/cmake/cmake.d/03-macros.cmake b/cmake/cmake.d/03-macros.cmake
index 4cd34e4..1475c28 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 "${CMAKE_SOURCE_DIR}/${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 ${CMAKE_CURRENT_SOURCE_DIR}/${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=${CMAKE_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/test-widget/test-config.xml.in -DOUTFILE=${PROJECT_PKG_TEST_DIR}/config.xml -DPROJECT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/${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 ${CMAKE_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/test-widget/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 999208a..a0b215d 100644
--- a/samples.d/config.cmake.sample
+++ b/samples.d/config.cmake.sample
@@ -110,10 +110,10 @@ set (PKG_REQUIRED_LIST
# -g
# -ggdb
# CACHE STRING "Compilation flags for DEBUG build type.")
-#set(CCOV_COMPILE_OPTIONS
+#set(COVERAGE_COMPILE_OPTIONS
# -g
# --coverage
-# CACHE STRING "Compilation flags for CCOV build type.")
+# CACHE STRING "Compilation flags for COVERAGE build type.")
#set(RELEASE_COMPILE_OPTIONS
# -O2
# -pipe
@@ -137,6 +137,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-widget/test-config.xml.in b/test-widget/test-config.xml.in
index b39d88e..a5e645b 100644
--- a/test-widget/test-config.xml.in
+++ b/test-widget/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>