[evolution/wip/cmake] tests/ directory and final changes to make it also run
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/wip/cmake] tests/ directory and final changes to make it also run
- Date: Tue, 4 Oct 2016 17:09:56 +0000 (UTC)
commit 6892ae1182089da5b7e91621d1f9e7e06c7ef144
Author: Milan Crha <mcrha redhat com>
Date: Tue Oct 4 19:09:59 2016 +0200
tests/ directory and final changes to make it also run
CMakeLists.txt | 5 +-
cmake/modules/IconCache.cmake | 16 ++++----
cmake/modules/InstalledTests.cmake | 43 ++++++++++++++++++++
data/icons/CMakeLists.txt | 3 +-
modules/CMakeLists.txt | 12 +++++-
modules/webkit-editor/web-extension/CMakeLists.txt | 2 +-
plugins/face/CMakeLists.txt | 14 +++---
tests/CMakeLists.txt | 10 +++++
web-extensions/CMakeLists.txt | 2 +-
9 files changed, 85 insertions(+), 22 deletions(-)
---
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ecc1050..abe928f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -40,6 +40,7 @@ set(GETTEXT_PO_DIR ${CMAKE_SOURCE_DIR}/po)
set(PROJECT_DISTCONFIGURE_PARAMS
-DENABLE_GTK_DOC=ON
-DENABLE_CONTACT_MAPS=ON
+ -DENABLE_INSTALLED_TESTS=ON
-DWITH_HELP=ON
-DWITH_GLADE_CATALOG=ON
)
@@ -680,8 +681,8 @@ add_subdirectory(plugins)
add_subdirectory(po)
add_subdirectory(shell)
add_subdirectory(sounds)
-add_subdirectory(sounds)
-#add_subdirectory(tests)
+add_subdirectory(tests)
+add_subdirectory(ui)
add_subdirectory(views)
add_subdirectory(web-extensions)
diff --git a/cmake/modules/IconCache.cmake b/cmake/modules/IconCache.cmake
index 35470a1..065a44b 100644
--- a/cmake/modules/IconCache.cmake
+++ b/cmake/modules/IconCache.cmake
@@ -4,9 +4,9 @@
# in the same directory.
#
# Macros:
-# add_icon_cache_files(_fileslistvar ...)
-# adds rules to install icons to icon cache directory; the arguments are
-# one or more list variables with file names.
+# add_icon_cache_files(_destdir _fileslistvar ...)
+# adds rules to install icons to icon cache directory with prefix _destdir;
+# the other arguments are one or more list variables with file names.
include(UninstallTarget)
@@ -38,24 +38,24 @@ endif(NOT GTK_UPDATE_ICON_CACHE)
set(_update_icon_cache_cmd ${GTK_UPDATE_ICON_CACHE} -f -t "${SHARE_INSTALL_DIR}/icons/hicolor")
-macro(process_icons _fileslistvar _install_codevar)
+macro(process_icons _destdir _fileslistvar _install_codevar)
foreach(srcfile IN LISTS ${_fileslistvar})
split_icon_components(${srcfile} theme context size iconfile)
install(FILES ${srcfile}
- DESTINATION ${SHARE_INSTALL_DIR}/icons/${theme}/${context}/${size}
+ DESTINATION ${_destdir}/icons/${theme}/${size}/${context}
RENAME ${iconfile}
)
set(${_install_codevar} "${${_install_codevar}}
- COMMAND ${CMAKE_COMMAND} -E copy_if_different
\"${CMAKE_CURRENT_SOURCE_DIR}/${srcfile}\"
\"${SHARE_INSTALL_DIR}/icons/${theme}/${context}/${size}/${iconfile}\""
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
\"${CMAKE_CURRENT_SOURCE_DIR}/${srcfile}\" \"${_destdir}/icons/${theme}/${size}/${context}/${iconfile}\""
)
endforeach(srcfile)
endmacro(process_icons)
-macro(add_icon_cache_files _fileslistvar)
+macro(add_icon_cache_files _destdir _fileslistvar)
set(_install_code)
foreach(_filesvar ${_fileslistvar} ${ARGN})
- process_icons(${_filesvar} _install_code)
+ process_icons("${_destdir}" ${_filesvar} _install_code)
endforeach(_filesvar)
if(GTK_UPDATE_ICON_CACHE)
diff --git a/cmake/modules/InstalledTests.cmake b/cmake/modules/InstalledTests.cmake
index ed1faa8..ec44553 100644
--- a/cmake/modules/InstalledTests.cmake
+++ b/cmake/modules/InstalledTests.cmake
@@ -10,6 +10,10 @@
# used for add_executable()), while the target name should match
# the executable name. The _type and _environ are used for populating
# the .test meta file.
+#
+# install_behave_tests_if_enabled(_testsvar _type _environ)
+# Adds rules to install the 'behave' tests as stored in _testsvar
+# in the current source directory.
include(PrintableOptions)
@@ -43,3 +47,42 @@ Exec=${TEST_ENVIRONMENT}${INSTALLED_TESTS_EXEC_DIR}/${_test_target}
)
endif(ENABLE_INSTALLED_TESTS)
endmacro(install_test_if_enabled)
+
+macro(install_behave_tests_if_enabled _testsvar _type _environ)
+ if(ENABLE_INSTALLED_TESTS)
+ set(TEST_TYPE ${_type})
+ set(TEST_ENVIRONMENT)
+ if(NOT ${_environ} STREQUAL "")
+ set(TEST_ENVIRONMENT "env ${_environ} ")
+ endif(NOT ${_environ} STREQUAL "")
+
+ file(GLOB BEHAVE_FEATURES ${CMAKE_CURRENT_SOURCE_DIR}/*.feature)
+ file(GLOB BEHAVE_STEP_DEFINITIONS ${CMAKE_CURRENT_SOURCE_DIR}/steps/*.py)
+ set(BEHAVE_COMMON_FILES
+ ${CMAKE_CURRENT_SOURCE_DIR}/environment.py
+ ${CMAKE_CURRENT_SOURCE_DIR}/common_steps.py
+ )
+
+ install(FILES ${BEHAVE_FEATURES} ${BEHAVE_COMMON_FILES}
+ DESTINATION ${INSTALLED_TESTS_EXEC_DIR}
+ )
+
+ install(FILES ${BEHAVE_STEP_DEFINITIONS}
+ DESTINATION ${INSTALLED_TESTS_EXEC_DIR}/steps/
+ )
+
+ foreach(_test ${${_testsvar}})
+ set(teststring "[Test]
+Type=${TEST_TYPE}
+Exec=${TEST_ENVIRONMENT}behave ${INSTALLED_TESTS_EXEC_DIR} -t ${_test} -k -f html -o ${_test}.html -f plain
+"
+)
+
+ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${_test}.test "${teststring}")
+
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${_test}.test
+ DESTINATION ${INSTALLED_TESTS_META_DIR}
+ )
+ endforeach(_test)
+ endif(ENABLE_INSTALLED_TESTS)
+endmacro(install_behave_tests_if_enabled)
diff --git a/data/icons/CMakeLists.txt b/data/icons/CMakeLists.txt
index e313828..6d8585f 100644
--- a/data/icons/CMakeLists.txt
+++ b/data/icons/CMakeLists.txt
@@ -230,4 +230,5 @@ set(noinst_icons
hicolor_status_32x32_online.svg
)
-add_icon_cache_files(public_icons private_icons stock_private_icons)
+add_icon_cache_files("${SHARE_INSTALL_DIR}" public_icons)
+add_icon_cache_files("${privdatadir}" private_icons stock_private_icons)
diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt
index 257115a..0217080 100644
--- a/modules/CMakeLists.txt
+++ b/modules/CMakeLists.txt
@@ -57,7 +57,7 @@ macro(add_evolution_module _name _sourcesvar _depsvar _defsvar _cflagsvar _incdi
add_simple_module(${_name} ${_sourcesvar} ${_depsvar} ${_defsvar} ${_cflagsvar} ${_incdirsvar}
${_ldflagsvar} ${moduledir})
endmacro(add_evolution_module)
-macro(add_webextension_module _name _sourcesvar _depsvar _defsvar _cflagsvar _incdirsvar _ldflagsvar)
+macro(add_simple_webextension_module _name _sourcesvar _depsvar _defsvar _cflagsvar _incdirsvar _ldflagsvar
_destdir)
set(wex_deps
${${_depsvar}}
edomutils
@@ -75,9 +75,17 @@ macro(add_webextension_module _name _sourcesvar _depsvar _defsvar _cflagsvar _in
${WEB_EXTENSIONS_LDFLAGS}
)
- add_simple_module(${_name} ${_sourcesvar} wex_deps ${_defsvar} wex_cflags wex_incdirs wex_ldflags
${webextensionsdir})
+ add_simple_module(${_name} ${_sourcesvar} wex_deps ${_defsvar} wex_cflags wex_incdirs wex_ldflags
${_destdir})
+endmacro(add_simple_webextension_module)
+
+macro(add_webextension_module _name _sourcesvar _depsvar _defsvar _cflagsvar _incdirsvar _ldflagsvar)
+ add_simple_webextension_module(${_name} ${_sourcesvar} ${_depsvar} ${_defsvar} ${_cflagsvar}
${_incdirsvar} ${_ldflagsvar} "${webextensionsdir}")
endmacro(add_webextension_module)
+macro(add_webextension_editor_module _name _sourcesvar _depsvar _defsvar _cflagsvar _incdirsvar _ldflagsvar)
+ add_simple_webextension_module(${_name} ${_sourcesvar} ${_depsvar} ${_defsvar} ${_cflagsvar}
${_incdirsvar} ${_ldflagsvar} "${webextensionswebkiteditordir}")
+endmacro(add_webextension_editor_module)
+
add_subdirectory(addressbook)
add_subdirectory(calendar)
add_subdirectory(mail)
diff --git a/modules/webkit-editor/web-extension/CMakeLists.txt
b/modules/webkit-editor/web-extension/CMakeLists.txt
index ba5244f..b2ccdc8 100644
--- a/modules/webkit-editor/web-extension/CMakeLists.txt
+++ b/modules/webkit-editor/web-extension/CMakeLists.txt
@@ -20,7 +20,7 @@ set(extra_cflags)
set(extra_incdirs)
set(extra_ldflags)
-add_webextension_module(module-webkit-editor-webextension
+add_webextension_editor_module(module-webkit-editor-webextension
sources
extra_deps
extra_defines
diff --git a/plugins/face/CMakeLists.txt b/plugins/face/CMakeLists.txt
index 83bb151..d9e2982 100644
--- a/plugins/face/CMakeLists.txt
+++ b/plugins/face/CMakeLists.txt
@@ -14,24 +14,24 @@ set(SOURCES
face.c
)
-add_library(liborg-gnome-face MODULE
+add_library(org-gnome-face MODULE
${SOURCES}
)
-add_dependencies(liborg-gnome-face
+add_dependencies(org-gnome-face
${DEPENDENCIES}
)
-target_compile_definitions(liborg-gnome-face PRIVATE
+target_compile_definitions(org-gnome-face PRIVATE
-DG_LOG_DOMAIN=\"face\"
)
-target_compile_options(liborg-gnome-face PUBLIC
+target_compile_options(org-gnome-face PUBLIC
${EVOLUTION_DATA_SERVER_CFLAGS}
${GNOME_PLATFORM_CFLAGS}
)
-target_include_directories(liborg-gnome-face PUBLIC
+target_include_directories(org-gnome-face PUBLIC
${CMAKE_BINARY_DIR}
${CMAKE_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
@@ -39,12 +39,12 @@ target_include_directories(liborg-gnome-face PUBLIC
${GNOME_PLATFORM_INCLUDE_DIRS}
)
-target_link_libraries(liborg-gnome-face
+target_link_libraries(org-gnome-face
${DEPENDENCIES}
${EVOLUTION_DATA_SERVER_LDFLAGS}
${GNOME_PLATFORM_LDFLAGS}
)
-install(TARGETS liborg-gnome-face
+install(TARGETS org-gnome-face
DESTINATION ${plugindir}
)
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
new file mode 100644
index 0000000..ce00177
--- /dev/null
+++ b/tests/CMakeLists.txt
@@ -0,0 +1,10 @@
+set(BEHAVE_INSTALLED_TESTS
+ addressbook_contacts
+ contacts_shortcuts
+ general_shortcuts
+ mail_shortcuts
+ memos_shortcuts
+ view_shortcuts
+)
+
+install_behave_tests_if_enabled(BEHAVE_INSTALLED_TESTS session-exclusive "")
diff --git a/web-extensions/CMakeLists.txt b/web-extensions/CMakeLists.txt
index afd04f2..ae39bff 100644
--- a/web-extensions/CMakeLists.txt
+++ b/web-extensions/CMakeLists.txt
@@ -40,7 +40,7 @@ target_link_libraries(edomutils
)
install(TARGETS edomutils
- DESTINATION ${webextensionsdir}
+ DESTINATION ${privsolibdir}
)
set(SOURCES
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]