Hello community, here is the log from the commit of package extra-cmake-modules for openSUSE:Factory checked in at 2015-06-23 12:05:31 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/extra-cmake-modules (Old) and /work/SRC/openSUSE:Factory/.extra-cmake-modules.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "extra-cmake-modules" Changes: -------- --- /work/SRC/openSUSE:Factory/extra-cmake-modules/extra-cmake-modules.changes 2015-05-11 19:47:31.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.extra-cmake-modules.new/extra-cmake-modules.changes 2015-06-23 12:05:32.000000000 +0200 @@ -1,0 +2,8 @@ +Sun Jun 7 19:07:07 UTC 2015 - hrvoje.sen...@gmail.com + +- Update to 5.11.0 + * New arguments for ecm_add_tests(). (kde#345797) + * For more details please see: + https://www.kde.org/announcements/kde-frameworks-5.11.0.php + +------------------------------------------------------------------- Old: ---- extra-cmake-modules-5.10.0.tar.xz New: ---- extra-cmake-modules-5.11.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ extra-cmake-modules.spec ++++++ --- /var/tmp/diff_new_pack.KDmi4Q/_old 2015-06-23 12:05:32.000000000 +0200 +++ /var/tmp/diff_new_pack.KDmi4Q/_new 2015-06-23 12:05:32.000000000 +0200 @@ -16,13 +16,13 @@ # -%define _tar_path 5.10 +%define _tar_path 5.11 Name: extra-cmake-modules Summary: CMake modules License: BSD-3-Clause Group: Development/Tools/Other Url: https://projects.kde.org/projects/kdesupport/extra-cmake-modules -Version: 5.10.0 +Version: 5.11.0 Release: 0 Source: http://download.kde.org/stable/frameworks/%{_tar_path}/%{name}-%{version}.tar.xz BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ extra-cmake-modules-5.10.0.tar.xz -> extra-cmake-modules-5.11.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-cmake-modules-5.10.0/CMakeLists.txt new/extra-cmake-modules-5.11.0/CMakeLists.txt --- old/extra-cmake-modules-5.10.0/CMakeLists.txt 2015-04-25 17:11:39.000000000 +0200 +++ new/extra-cmake-modules-5.11.0/CMakeLists.txt 2015-06-06 10:10:46.000000000 +0200 @@ -3,7 +3,7 @@ project(extra-cmake-modules NONE) set(ECM_MAJOR_VERSION 5) -set(ECM_MINOR_VERSION 10) +set(ECM_MINOR_VERSION 11) set(ECM_PATCH_VERSION 0) set(ECM_VERSION ${ECM_MAJOR_VERSION}.${ECM_MINOR_VERSION}.${ECM_PATCH_VERSION}) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-cmake-modules-5.10.0/modules/ECMAddTests.cmake new/extra-cmake-modules-5.11.0/modules/ECMAddTests.cmake --- old/extra-cmake-modules-5.10.0/modules/ECMAddTests.cmake 2015-04-25 17:11:39.000000000 +0200 +++ new/extra-cmake-modules-5.11.0/modules/ECMAddTests.cmake 2015-06-06 10:10:46.000000000 +0200 @@ -2,45 +2,59 @@ # ECMAddTests # ----------- # -# Add test executables. +# Convenience functions for adding tests. # # :: # -# ecm_add_test(<sources> LINK_LIBRARIES <library> [<library> [...]] -# [TEST_NAME <name>] -# [NAME_PREFIX <prefix>] -# [GUI]) -# -# Add a new unit test using the passed source files. The parameter TEST_NAME is -# used to set the name of the resulting test, and the target built for and run -# by the test. It may be omitted if there is exactly one source file. In that -# case the name of the source file (without the file extension) will be used as -# the test name. +# ecm_add_tests(<sources> LINK_LIBRARIES <library> [<library> [...]] +# [NAME_PREFIX <prefix>] +# [GUI] +# [TARGET_NAMES_VAR <target_names_var>] +# [TEST_NAMES_VAR <test_names_var>]) +# +# A convenience function for adding multiple tests, each consisting of a +# single source file. For each file in <sources>, an executable target will be +# created (the name of which will be the basename of the source file). This +# will be linked against the libraries given with LINK_LIBRARIES. Each +# executable will be added as a test with the same name. # -# If NAME_PREFIX is given, this prefix will be prepended to the test name, but -# not the target name. As a result, it will not prevent clashes between tests +# If NAME_PREFIX is given, this prefix will be prepended to the test names, but +# not the target names. As a result, it will not prevent clashes between tests # with the same name in different parts of the project, but it can be used to # give an indication of where to look for a failing test. # -# If the flag GUI is passed the test binary will be a GUI executable, otherwise -# the resulting binary will be a console application. The test will be linked -# against the libraries and/or targets passed to LINK_LIBRARIES. +# If the flag GUI is passed the test binaries will be GUI executables, otherwise +# the resulting binaries will be console applications (regardless of the value +# of CMAKE_WIN32_EXECUTABLE or CMAKE_MACOSX_BUNDLE). Be aware that this changes +# the executable entry point on Windows (although some frameworks, such as Qt, +# abstract this difference away). +# +# The TARGET_NAMES_VAR and TEST_NAMES_VAR arguments, if given, should specify a +# variable name to receive the list of generated target and test names, +# respectively. This makes it convenient to apply properties to them as a +# whole, for example, using set_target_properties() or set_tests_properties(). # +# The generated target executables will have the effects of ecm_mark_as_test() +# (from the :module:`ECMMarkAsTest` module) applied to it. # # :: # -# ecm_add_tests(<sources> LINK_LIBRARIES <library> [<library> [...]] -# [NAME_PREFIX <prefix>] -# [GUI]) +# ecm_add_test(<sources> LINK_LIBRARIES <library> [<library> [...]] +# [TEST_NAME <name>] +# [NAME_PREFIX <prefix>] +# [GUI]) +# +# This is a single-test form of ecm_add_tests that allows multiple source files +# to be used for a single test. If using multiple source files, TEST_NAME must +# be given; this will be used for both the target and test names (and, as with +# ecm_add_tests(), the NAME_PREFIX argument will be prepended to the test name). # -# This is a convenient version of ecm_add_test() for when you have many tests -# that consist of a single source file each. It behaves like calling -# ecm_add_test() once for each source file, with the same named arguments. # # Since pre-1.0.0. #============================================================================= # Copyright 2013 Alexander Richardson <arichardson....@gmail.com> +# Copyright 2015 Alex Merry <alex.me...@kde.org> # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file COPYING-CMAKE-SCRIPTS for details. @@ -52,18 +66,21 @@ # (To distribute this file outside of extra-cmake-modules, substitute the full # License text for the above reference.) +include(CMakeParseArguments) include(ECMMarkAsTest) include(ECMMarkNonGuiExecutable) function(ecm_add_test) set(options GUI) - set(oneValueArgs TEST_NAME NAME_PREFIX) + # TARGET_NAME_VAR and TEST_NAME_VAR are undocumented args used by + # ecm_add_tests + set(oneValueArgs TEST_NAME NAME_PREFIX TARGET_NAME_VAR TEST_NAME_VAR) set(multiValueArgs LINK_LIBRARIES) - cmake_parse_arguments(ECM_ADD_TEST "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - set(_sources ${ECM_ADD_TEST_UNPARSED_ARGUMENTS}) + cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + set(_sources ${ARG_UNPARSED_ARGUMENTS}) list(LENGTH _sources _sourceCount) - if(ECM_ADD_TEST_TEST_NAME) - set(_targetname ${ECM_ADD_TEST_TEST_NAME}) + if(ARG_TEST_NAME) + set(_targetname ${ARG_TEST_NAME}) elseif(${_sourceCount} EQUAL "1") #use the source file name without extension as the testname get_filename_component(_targetname ${_sources} NAME_WE) @@ -72,31 +89,53 @@ message(FATAL_ERROR "ecm_add_test() called with multiple source files but without setting \"TEST_NAME\"") endif() - set(_testname "${ECM_ADD_TEST_NAME_PREFIX}${_targetname}") - add_executable(${_targetname} ${_sources}) - if(NOT ECM_ADD_TEST_GUI) + set(_testname ${ARG_NAME_PREFIX}${_targetname}) + set(gui_args) + if(ARG_GUI) + set(gui_args WIN32 MACOSX_BUNDLE) + endif() + add_executable(${_targetname} ${gui_args} ${_sources}) + if(NOT ARG_GUI) ecm_mark_nongui_executable(${_targetname}) endif() add_test(NAME ${_testname} COMMAND ${_targetname}) - target_link_libraries(${_targetname} ${ECM_ADD_TEST_LINK_LIBRARIES}) + target_link_libraries(${_targetname} ${ARG_LINK_LIBRARIES}) ecm_mark_as_test(${_targetname}) + if (ARG_TARGET_NAME_VAR) + set(${ARG_TARGET_NAME_VAR} "${_targetname}" PARENT_SCOPE) + endif() + if (ARG_TEST_NAME_VAR) + set(${ARG_TEST_NAME_VAR} "${_testname}" PARENT_SCOPE) + endif() endfunction() function(ecm_add_tests) set(options GUI) - set(oneValueArgs NAME_PREFIX) + set(oneValueArgs NAME_PREFIX TARGET_NAMES_VAR TEST_NAMES_VAR) set(multiValueArgs LINK_LIBRARIES) - cmake_parse_arguments(ECM_ADD_TESTS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - if(ECM_ADD_TESTS_GUI) + cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + if(ARG_GUI) set(_exe_type GUI) else() set(_exe_type "") endif() - foreach(_test_source ${ECM_ADD_TESTS_UNPARSED_ARGUMENTS}) + set(test_names) + set(target_names) + foreach(_test_source ${ARG_UNPARSED_ARGUMENTS}) ecm_add_test(${_test_source} - NAME_PREFIX ${ECM_ADD_TESTS_NAME_PREFIX} - LINK_LIBRARIES ${ECM_ADD_TESTS_LINK_LIBRARIES} - ${_exe_type} + NAME_PREFIX ${ARG_NAME_PREFIX} + LINK_LIBRARIES ${ARG_LINK_LIBRARIES} + TARGET_NAME_VAR target_name + TEST_NAME_VAR test_name + ${_exe_type} ) + list(APPEND _test_names "${test_name}") + list(APPEND _target_names "${target_name}") endforeach() + if (ARG_TARGET_NAMES_VAR) + set(${ARG_TARGET_NAMES_VAR} "${_target_names}" PARENT_SCOPE) + endif() + if (ARG_TEST_NAMES_VAR) + set(${ARG_TEST_NAMES_VAR} "${_test_names}" PARENT_SCOPE) + endif() endfunction() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-cmake-modules-5.10.0/tests/CMakeLists.txt new/extra-cmake-modules-5.11.0/tests/CMakeLists.txt --- old/extra-cmake-modules-5.10.0/tests/CMakeLists.txt 2015-04-25 17:11:39.000000000 +0200 +++ new/extra-cmake-modules-5.11.0/tests/CMakeLists.txt 2015-06-06 10:10:46.000000000 +0200 @@ -4,6 +4,7 @@ # with other files (as ECM itself is architecture-independent). project(ECMTests C) +add_subdirectory(ECMAddTests) add_subdirectory(ECMGenerateHeadersTest) add_subdirectory(ECMSetupVersionTest) add_subdirectory(ECMGeneratePkgConfigFile) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-cmake-modules-5.10.0/tests/ECMAddTests/CMakeLists.txt new/extra-cmake-modules-5.11.0/tests/ECMAddTests/CMakeLists.txt --- old/extra-cmake-modules-5.10.0/tests/ECMAddTests/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/extra-cmake-modules-5.11.0/tests/ECMAddTests/CMakeLists.txt 2015-06-06 10:10:46.000000000 +0200 @@ -0,0 +1,49 @@ +macro(add_check NAME) + string(REPLACE "." "/" dir "${NAME}") + string(REGEX REPLACE "[^.]*\\." "" proj "${NAME}") + add_test( + NAME ecm_add_tests-${NAME} + COMMAND + ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMAKE_CURRENT_SOURCE_DIR}/${dir}" + "${CMAKE_CURRENT_BINARY_DIR}/${dir}" + --build-two-config + --build-generator ${CMAKE_GENERATOR} + --build-makeprogram ${CMAKE_MAKE_PROGRAM} + --build-project ${proj} + --build-options -DBUILD_TESTING:BOOL=ON + ${${NAME}_EXTRA_OPTIONS} + --test-command "${CMAKE_CTEST_COMMAND}" + ) + add_test( + NAME ecm_add_tests_did_run-${NAME} + COMMAND "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_SOURCE_DIR}/check_files.cmake" ${ARGN} + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${dir}" + ) + set_property(TEST ecm_add_tests_did_run-${NAME} + APPEND + PROPERTY DEPENDS "ecm_add_tests-${NAME}" + ) +endmacro() + +add_check(single_tests + test1.txt + test2.txt + test3.txt + test4.txt + test5.txt + test6.txt + ) +add_check(multi_tests + test1.txt + test2.txt + test3.txt + test4.txt + test5.txt + test6.txt + test7.txt + test8.txt + test9.txt + ) + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-cmake-modules-5.10.0/tests/ECMAddTests/check_files.cmake new/extra-cmake-modules-5.11.0/tests/ECMAddTests/check_files.cmake --- old/extra-cmake-modules-5.10.0/tests/ECMAddTests/check_files.cmake 1970-01-01 01:00:00.000000000 +0100 +++ new/extra-cmake-modules-5.11.0/tests/ECMAddTests/check_files.cmake 2015-06-06 10:10:46.000000000 +0200 @@ -0,0 +1,15 @@ +set(i 0) +set(in_file_args FALSE) +while (i LESS CMAKE_ARGC) + if (in_file_args) + if (NOT EXISTS "${CMAKE_ARGV${i}}") + message(FATAL_ERROR "${CMAKE_ARGV${i}} does not exist") + endif() + elseif (CMAKE_ARGV${i} STREQUAL "-P") + # skip script name + math(EXPR i "${i} + 1") + set(in_file_args TRUE) + endif() + math(EXPR i "${i} + 1") +endwhile() + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-cmake-modules-5.10.0/tests/ECMAddTests/multi_tests/CMakeLists.txt new/extra-cmake-modules-5.11.0/tests/ECMAddTests/multi_tests/CMakeLists.txt --- old/extra-cmake-modules-5.10.0/tests/ECMAddTests/multi_tests/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/extra-cmake-modules-5.11.0/tests/ECMAddTests/multi_tests/CMakeLists.txt 2015-06-06 10:10:46.000000000 +0200 @@ -0,0 +1,155 @@ +project(ECMAddTests) +cmake_minimum_required(VERSION 2.8.12) + +set(ECM_MODULE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../modules) +set(CMAKE_MODULE_PATH "${ECM_MODULE_DIR}") + +add_library(testhelper STATIC ../testhelper.cpp) +target_include_directories(testhelper PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/..") + +enable_testing() + +include(ECMAddTests) +include(../../test_helpers.cmake) + +# clean up to avoid false-positives from check_files.cmake +file(REMOVE + "${CMAKE_CURRENT_BINARY_DIR}/test1.txt" + "${CMAKE_CURRENT_BINARY_DIR}/test2.txt" + "${CMAKE_CURRENT_BINARY_DIR}/test3.txt" + "${CMAKE_CURRENT_BINARY_DIR}/test4.txt" + "${CMAKE_CURRENT_BINARY_DIR}/test5.txt" + "${CMAKE_CURRENT_BINARY_DIR}/test6.txt" + "${CMAKE_CURRENT_BINARY_DIR}/test7.txt" + "${CMAKE_CURRENT_BINARY_DIR}/test8.txt" + "${CMAKE_CURRENT_BINARY_DIR}/test9.txt" + ) + +set(exp_target_names "test1;test2;test3") +set(exp_test_names "test1;test2;test3") +ecm_add_tests( + test1.cpp + test2.cpp + test3.cpp + LINK_LIBRARIES testhelper + TARGET_NAMES_VAR target_names + TEST_NAMES_VAR test_names + ) +assert_vars_setequal(target_names exp_target_names) +assert_vars_setequal(test_names exp_test_names) +# check targets exist +get_property(_dummy TARGET test1 PROPERTY TYPE) +get_property(_dummy TARGET test2 PROPERTY TYPE) +get_property(_dummy TARGET test3 PROPERTY TYPE) +# check tests exists +get_property(_dummy TEST test1 PROPERTY TIMEOUT) +get_property(_dummy TEST test2 PROPERTY TIMEOUT) +get_property(_dummy TEST test3 PROPERTY TIMEOUT) +get_property(_is_win32 TARGET test1 PROPERTY WIN32_EXECUTABLE) +if (_is_win32) + message(FATAL_ERROR "test1 is a WIN32 executable when it should not be") +endif() +get_property(_is_bundle TARGET test1 PROPERTY MACOSX_BUNDLE) +if (_is_bundle) + message(FATAL_ERROR "test1 is an OS/X bundle when it should not be") +endif() +get_property(_is_win32 TARGET test2 PROPERTY WIN32_EXECUTABLE) +if (_is_win32) + message(FATAL_ERROR "test2 is a WIN32 executable when it should not be") +endif() +get_property(_is_bundle TARGET test2 PROPERTY MACOSX_BUNDLE) +if (_is_bundle) + message(FATAL_ERROR "test2 is an OS/X bundle when it should not be") +endif() + + +ecm_add_tests( + test4.cpp + test5.cpp + LINK_LIBRARIES testhelper + NAME_PREFIX pref_ + ) +get_property(_dummy TARGET test4 PROPERTY TYPE) +get_property(_dummy TARGET test5 PROPERTY TYPE) +get_property(_dummy TEST pref_test4 PROPERTY TIMEOUT) +get_property(_dummy TEST pref_test5 PROPERTY TIMEOUT) +get_property(_is_win32 TARGET test4 PROPERTY WIN32_EXECUTABLE) +if (_is_win32) + message(FATAL_ERROR "test4 is a WIN32 executable when it should not be") +endif() +get_property(_is_bundle TARGET test4 PROPERTY MACOSX_BUNDLE) +if (_is_bundle) + message(FATAL_ERROR "test4 is an OS/X bundle when it should not be") +endif() +get_property(_is_win32 TARGET test5 PROPERTY WIN32_EXECUTABLE) +if (_is_win32) + message(FATAL_ERROR "test5 is a WIN32 executable when it should not be") +endif() +get_property(_is_bundle TARGET test5 PROPERTY MACOSX_BUNDLE) +if (_is_bundle) + message(FATAL_ERROR "test5 is an OS/X bundle when it should not be") +endif() + + +ecm_add_tests( + test6.cpp + test7.cpp + LINK_LIBRARIES testhelper + GUI + ) +get_property(_dummy TARGET test6 PROPERTY TYPE) +get_property(_dummy TARGET test7 PROPERTY TYPE) +get_property(_dummy TEST test6 PROPERTY TIMEOUT) +get_property(_dummy TEST test7 PROPERTY TIMEOUT) +get_property(_is_win32 TARGET test6 PROPERTY WIN32_EXECUTABLE) +if (NOT _is_win32) + message(FATAL_ERROR "test6 is not a WIN32 executable when it should be") +endif() +get_property(_is_bundle TARGET test6 PROPERTY MACOSX_BUNDLE) +if (NOT _is_bundle) + message(FATAL_ERROR "test6 is not an OS/X bundle when it should be") +endif() +get_property(_is_win32 TARGET test7 PROPERTY WIN32_EXECUTABLE) +if (NOT _is_win32) + message(FATAL_ERROR "test7 is not a WIN32 executable when it should be") +endif() +get_property(_is_bundle TARGET test7 PROPERTY MACOSX_BUNDLE) +if (NOT _is_bundle) + message(FATAL_ERROR "test7 is not an OS/X bundle when it should be") +endif() + + +set(exp_target_names "test8;test9") +set(exp_test_names "p_test8;p_test9") +ecm_add_tests( + test8.cpp + test9.cpp + LINK_LIBRARIES testhelper + NAME_PREFIX p_ + GUI + TARGET_NAMES_VAR target_names + TEST_NAMES_VAR test_names + ) +assert_vars_setequal(target_names exp_target_names) +assert_vars_setequal(test_names exp_test_names) +get_property(_dummy TARGET test8 PROPERTY TYPE) +get_property(_dummy TARGET test9 PROPERTY TYPE) +get_property(_dummy TEST p_test8 PROPERTY TIMEOUT) +get_property(_dummy TEST p_test9 PROPERTY TIMEOUT) +get_property(_is_win32 TARGET test8 PROPERTY WIN32_EXECUTABLE) +if (NOT _is_win32) + message(FATAL_ERROR "test8 is not a WIN32 executable when it should be") +endif() +get_property(_is_bundle TARGET test8 PROPERTY MACOSX_BUNDLE) +if (NOT _is_bundle) + message(FATAL_ERROR "test8 is not an OS/X bundle when it should be") +endif() +get_property(_is_win32 TARGET test9 PROPERTY WIN32_EXECUTABLE) +if (NOT _is_win32) + message(FATAL_ERROR "test9 is not a WIN32 executable when it should be") +endif() +get_property(_is_bundle TARGET test9 PROPERTY MACOSX_BUNDLE) +if (NOT _is_bundle) + message(FATAL_ERROR "test9 is not an OS/X bundle when it should be") +endif() + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-cmake-modules-5.10.0/tests/ECMAddTests/multi_tests/test1.cpp new/extra-cmake-modules-5.11.0/tests/ECMAddTests/multi_tests/test1.cpp --- old/extra-cmake-modules-5.10.0/tests/ECMAddTests/multi_tests/test1.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/extra-cmake-modules-5.11.0/tests/ECMAddTests/multi_tests/test1.cpp 2015-06-06 10:10:46.000000000 +0200 @@ -0,0 +1,8 @@ +#include "testhelper.h" + +int main() +{ + make_test_file("test1.txt"); + return 0; +} + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-cmake-modules-5.10.0/tests/ECMAddTests/multi_tests/test2.cpp new/extra-cmake-modules-5.11.0/tests/ECMAddTests/multi_tests/test2.cpp --- old/extra-cmake-modules-5.10.0/tests/ECMAddTests/multi_tests/test2.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/extra-cmake-modules-5.11.0/tests/ECMAddTests/multi_tests/test2.cpp 2015-06-06 10:10:46.000000000 +0200 @@ -0,0 +1,8 @@ +#include "testhelper.h" + +int main() +{ + make_test_file("test2.txt"); + return 0; +} + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-cmake-modules-5.10.0/tests/ECMAddTests/multi_tests/test3.cpp new/extra-cmake-modules-5.11.0/tests/ECMAddTests/multi_tests/test3.cpp --- old/extra-cmake-modules-5.10.0/tests/ECMAddTests/multi_tests/test3.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/extra-cmake-modules-5.11.0/tests/ECMAddTests/multi_tests/test3.cpp 2015-06-06 10:10:46.000000000 +0200 @@ -0,0 +1,8 @@ +#include "testhelper.h" + +int main() +{ + make_test_file("test3.txt"); + return 0; +} + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-cmake-modules-5.10.0/tests/ECMAddTests/multi_tests/test4.cpp new/extra-cmake-modules-5.11.0/tests/ECMAddTests/multi_tests/test4.cpp --- old/extra-cmake-modules-5.10.0/tests/ECMAddTests/multi_tests/test4.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/extra-cmake-modules-5.11.0/tests/ECMAddTests/multi_tests/test4.cpp 2015-06-06 10:10:46.000000000 +0200 @@ -0,0 +1,8 @@ +#include "testhelper.h" + +int main() +{ + make_test_file("test4.txt"); + return 0; +} + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-cmake-modules-5.10.0/tests/ECMAddTests/multi_tests/test5.cpp new/extra-cmake-modules-5.11.0/tests/ECMAddTests/multi_tests/test5.cpp --- old/extra-cmake-modules-5.10.0/tests/ECMAddTests/multi_tests/test5.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/extra-cmake-modules-5.11.0/tests/ECMAddTests/multi_tests/test5.cpp 2015-06-06 10:10:46.000000000 +0200 @@ -0,0 +1,8 @@ +#include "testhelper.h" + +int main() +{ + make_test_file("test5.txt"); + return 0; +} + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-cmake-modules-5.10.0/tests/ECMAddTests/multi_tests/test6.cpp new/extra-cmake-modules-5.11.0/tests/ECMAddTests/multi_tests/test6.cpp --- old/extra-cmake-modules-5.10.0/tests/ECMAddTests/multi_tests/test6.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/extra-cmake-modules-5.11.0/tests/ECMAddTests/multi_tests/test6.cpp 2015-06-06 10:10:46.000000000 +0200 @@ -0,0 +1,8 @@ +#include "testhelper.h" + +int main() +{ + make_test_file("test6.txt"); + return 0; +} + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-cmake-modules-5.10.0/tests/ECMAddTests/multi_tests/test7.cpp new/extra-cmake-modules-5.11.0/tests/ECMAddTests/multi_tests/test7.cpp --- old/extra-cmake-modules-5.10.0/tests/ECMAddTests/multi_tests/test7.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/extra-cmake-modules-5.11.0/tests/ECMAddTests/multi_tests/test7.cpp 2015-06-06 10:10:46.000000000 +0200 @@ -0,0 +1,8 @@ +#include "testhelper.h" + +int main() +{ + make_test_file("test7.txt"); + return 0; +} + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-cmake-modules-5.10.0/tests/ECMAddTests/multi_tests/test8.cpp new/extra-cmake-modules-5.11.0/tests/ECMAddTests/multi_tests/test8.cpp --- old/extra-cmake-modules-5.10.0/tests/ECMAddTests/multi_tests/test8.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/extra-cmake-modules-5.11.0/tests/ECMAddTests/multi_tests/test8.cpp 2015-06-06 10:10:46.000000000 +0200 @@ -0,0 +1,8 @@ +#include "testhelper.h" + +int main() +{ + make_test_file("test8.txt"); + return 0; +} + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-cmake-modules-5.10.0/tests/ECMAddTests/multi_tests/test9.cpp new/extra-cmake-modules-5.11.0/tests/ECMAddTests/multi_tests/test9.cpp --- old/extra-cmake-modules-5.10.0/tests/ECMAddTests/multi_tests/test9.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/extra-cmake-modules-5.11.0/tests/ECMAddTests/multi_tests/test9.cpp 2015-06-06 10:10:46.000000000 +0200 @@ -0,0 +1,8 @@ +#include "testhelper.h" + +int main() +{ + make_test_file("test9.txt"); + return 0; +} + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-cmake-modules-5.10.0/tests/ECMAddTests/single_tests/CMakeLists.txt new/extra-cmake-modules-5.11.0/tests/ECMAddTests/single_tests/CMakeLists.txt --- old/extra-cmake-modules-5.10.0/tests/ECMAddTests/single_tests/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/extra-cmake-modules-5.11.0/tests/ECMAddTests/single_tests/CMakeLists.txt 2015-06-06 10:10:46.000000000 +0200 @@ -0,0 +1,122 @@ +project(ECMAddTests) +cmake_minimum_required(VERSION 2.8.12) + +set(ECM_MODULE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../modules) +set(CMAKE_MODULE_PATH "${ECM_MODULE_DIR}") + +add_library(testhelper STATIC ../testhelper.cpp) +target_include_directories(testhelper PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/..") + +enable_testing() + +include(ECMAddTests) + +# clean up to avoid false-positives from check_files.cmake +file(REMOVE + "${CMAKE_CURRENT_BINARY_DIR}/test1.txt" + "${CMAKE_CURRENT_BINARY_DIR}/test2.txt" + "${CMAKE_CURRENT_BINARY_DIR}/test3.txt" + "${CMAKE_CURRENT_BINARY_DIR}/test4.txt" + "${CMAKE_CURRENT_BINARY_DIR}/test5.txt" + "${CMAKE_CURRENT_BINARY_DIR}/test6.txt" + ) + +ecm_add_test(test1.cpp + LINK_LIBRARIES testhelper + ) +# check target exists +get_property(_dummy TARGET test1 PROPERTY TYPE) +# check test exists +get_property(_dummy TEST test1 PROPERTY TIMEOUT) +get_property(_is_win32 TARGET test1 PROPERTY WIN32_EXECUTABLE) +if (_is_win32) + message(FATAL_ERROR "test1 is a WIN32 executable when it should not be") +endif() +get_property(_is_bundle TARGET test1 PROPERTY MACOSX_BUNDLE) +if (_is_bundle) + message(FATAL_ERROR "test1 is an OS/X bundle when it should not be") +endif() + + +ecm_add_test(test2.cpp + LINK_LIBRARIES testhelper + TEST_NAME named_test + ) +get_property(_dummy TARGET named_test PROPERTY TYPE) +get_property(_dummy TEST named_test PROPERTY TIMEOUT) +get_property(_is_win32 TARGET named_test PROPERTY WIN32_EXECUTABLE) +if (_is_win32) + message(FATAL_ERROR "named_test is a WIN32 executable when it should not be") +endif() +get_property(_is_bundle TARGET named_test PROPERTY MACOSX_BUNDLE) +if (_is_bundle) + message(FATAL_ERROR "named_test is an OS/X bundle when it should not be") +endif() + + +ecm_add_test(test3.cpp + LINK_LIBRARIES testhelper + NAME_PREFIX prefix_ + ) +get_property(_dummy TARGET test3 PROPERTY TYPE) +get_property(_dummy TEST prefix_test3 PROPERTY TIMEOUT) +get_property(_is_win32 TARGET test3 PROPERTY WIN32_EXECUTABLE) +if (_is_win32) + message(FATAL_ERROR "test3 is a WIN32 executable when it should not be") +endif() +get_property(_is_bundle TARGET test3 PROPERTY MACOSX_BUNDLE) +if (_is_bundle) + message(FATAL_ERROR "test3 is an OS/X bundle when it should not be") +endif() + + +ecm_add_test(test4.cpp + LINK_LIBRARIES testhelper + GUI + ) +get_property(_dummy TARGET test4 PROPERTY TYPE) +get_property(_dummy TEST test4 PROPERTY TIMEOUT) +get_property(_is_win32 TARGET test4 PROPERTY WIN32_EXECUTABLE) +if (NOT _is_win32) + message(FATAL_ERROR "test4 is not a WIN32 executable when it should be") +endif() +get_property(_is_bundle TARGET test4 PROPERTY MACOSX_BUNDLE) +if (NOT _is_bundle) + message(FATAL_ERROR "test4 is not an OS/X bundle when it should be") +endif() + + +ecm_add_test(test5.cpp + LINK_LIBRARIES testhelper + TEST_NAME combined_test + NAME_PREFIX another_prefix_ + GUI + ) +get_property(_dummy TARGET combined_test PROPERTY TYPE) +get_property(_dummy TEST another_prefix_combined_test PROPERTY TIMEOUT) +get_property(_is_win32 TARGET combined_test PROPERTY WIN32_EXECUTABLE) +if (NOT _is_win32) + message(FATAL_ERROR "combined_test is not a WIN32 executable when it should be") +endif() +get_property(_is_bundle TARGET combined_test PROPERTY MACOSX_BUNDLE) +if (NOT _is_bundle) + message(FATAL_ERROR "combined_test is not an OS/X bundle when it should be") +endif() + + +ecm_add_test(test6.cpp test6body.cpp + LINK_LIBRARIES testhelper + TEST_NAME multifile_test + ) +get_property(_dummy TARGET multifile_test PROPERTY TYPE) +get_property(_dummy TEST multifile_test PROPERTY TIMEOUT) +get_property(_is_win32 TARGET multifile_test PROPERTY WIN32_EXECUTABLE) +if (_is_win32) + message(FATAL_ERROR "multifile_test is a WIN32 executable when it should not be") +endif() +get_property(_is_bundle TARGET multifile_test PROPERTY MACOSX_BUNDLE) +if (_is_bundle) + message(FATAL_ERROR "multifile_test is an OS/X bundle when it should not be") +endif() + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-cmake-modules-5.10.0/tests/ECMAddTests/single_tests/test1.cpp new/extra-cmake-modules-5.11.0/tests/ECMAddTests/single_tests/test1.cpp --- old/extra-cmake-modules-5.10.0/tests/ECMAddTests/single_tests/test1.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/extra-cmake-modules-5.11.0/tests/ECMAddTests/single_tests/test1.cpp 2015-06-06 10:10:46.000000000 +0200 @@ -0,0 +1,8 @@ +#include "testhelper.h" + +int main() +{ + make_test_file("test1.txt"); + return 0; +} + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-cmake-modules-5.10.0/tests/ECMAddTests/single_tests/test2.cpp new/extra-cmake-modules-5.11.0/tests/ECMAddTests/single_tests/test2.cpp --- old/extra-cmake-modules-5.10.0/tests/ECMAddTests/single_tests/test2.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/extra-cmake-modules-5.11.0/tests/ECMAddTests/single_tests/test2.cpp 2015-06-06 10:10:46.000000000 +0200 @@ -0,0 +1,8 @@ +#include "testhelper.h" + +int main() +{ + make_test_file("test2.txt"); + return 0; +} + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-cmake-modules-5.10.0/tests/ECMAddTests/single_tests/test3.cpp new/extra-cmake-modules-5.11.0/tests/ECMAddTests/single_tests/test3.cpp --- old/extra-cmake-modules-5.10.0/tests/ECMAddTests/single_tests/test3.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/extra-cmake-modules-5.11.0/tests/ECMAddTests/single_tests/test3.cpp 2015-06-06 10:10:46.000000000 +0200 @@ -0,0 +1,8 @@ +#include "testhelper.h" + +int main() +{ + make_test_file("test3.txt"); + return 0; +} + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-cmake-modules-5.10.0/tests/ECMAddTests/single_tests/test4.cpp new/extra-cmake-modules-5.11.0/tests/ECMAddTests/single_tests/test4.cpp --- old/extra-cmake-modules-5.10.0/tests/ECMAddTests/single_tests/test4.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/extra-cmake-modules-5.11.0/tests/ECMAddTests/single_tests/test4.cpp 2015-06-06 10:10:46.000000000 +0200 @@ -0,0 +1,8 @@ +#include "testhelper.h" + +int main() +{ + make_test_file("test4.txt"); + return 0; +} + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-cmake-modules-5.10.0/tests/ECMAddTests/single_tests/test5.cpp new/extra-cmake-modules-5.11.0/tests/ECMAddTests/single_tests/test5.cpp --- old/extra-cmake-modules-5.10.0/tests/ECMAddTests/single_tests/test5.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/extra-cmake-modules-5.11.0/tests/ECMAddTests/single_tests/test5.cpp 2015-06-06 10:10:46.000000000 +0200 @@ -0,0 +1,8 @@ +#include "testhelper.h" + +int main() +{ + make_test_file("test5.txt"); + return 0; +} + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-cmake-modules-5.10.0/tests/ECMAddTests/single_tests/test6.cpp new/extra-cmake-modules-5.11.0/tests/ECMAddTests/single_tests/test6.cpp --- old/extra-cmake-modules-5.10.0/tests/ECMAddTests/single_tests/test6.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/extra-cmake-modules-5.11.0/tests/ECMAddTests/single_tests/test6.cpp 2015-06-06 10:10:46.000000000 +0200 @@ -0,0 +1,8 @@ +void test_body(); + +int main() +{ + test_body(); + return 0; +} + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-cmake-modules-5.10.0/tests/ECMAddTests/single_tests/test6body.cpp new/extra-cmake-modules-5.11.0/tests/ECMAddTests/single_tests/test6body.cpp --- old/extra-cmake-modules-5.10.0/tests/ECMAddTests/single_tests/test6body.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/extra-cmake-modules-5.11.0/tests/ECMAddTests/single_tests/test6body.cpp 2015-06-06 10:10:46.000000000 +0200 @@ -0,0 +1,7 @@ +#include "testhelper.h" + +void test_body() +{ + make_test_file("test6.txt"); +} + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-cmake-modules-5.10.0/tests/ECMAddTests/testhelper.cpp new/extra-cmake-modules-5.11.0/tests/ECMAddTests/testhelper.cpp --- old/extra-cmake-modules-5.10.0/tests/ECMAddTests/testhelper.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/extra-cmake-modules-5.11.0/tests/ECMAddTests/testhelper.cpp 2015-06-06 10:10:46.000000000 +0200 @@ -0,0 +1,8 @@ +#include "testhelper.h" +#include <fstream> +#include <string> + +void make_test_file(const char *filename) +{ + std::ofstream(filename) << "test" << std::endl; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-cmake-modules-5.10.0/tests/ECMAddTests/testhelper.h new/extra-cmake-modules-5.11.0/tests/ECMAddTests/testhelper.h --- old/extra-cmake-modules-5.10.0/tests/ECMAddTests/testhelper.h 1970-01-01 01:00:00.000000000 +0100 +++ new/extra-cmake-modules-5.11.0/tests/ECMAddTests/testhelper.h 2015-06-06 10:10:46.000000000 +0200 @@ -0,0 +1 @@ +void make_test_file(const char *filename); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-cmake-modules-5.10.0/tests/ExecuteKDEModules/CMakeLists.txt new/extra-cmake-modules-5.11.0/tests/ExecuteKDEModules/CMakeLists.txt --- old/extra-cmake-modules-5.10.0/tests/ExecuteKDEModules/CMakeLists.txt 2015-04-25 17:11:39.000000000 +0200 +++ new/extra-cmake-modules-5.11.0/tests/ExecuteKDEModules/CMakeLists.txt 2015-06-06 10:10:46.000000000 +0200 @@ -7,11 +7,12 @@ KDECMakeSettings KDECompilerSettings KDEFrameworkCompilerSettings + ECMMarkNonGuiExecutable ) set(ECM_KDE_MODULE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../kde-modules) set(ECM_MODULE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../modules) -set(CMAKE_MODULE_PATH "${ECM_KDE_MODULE_DIR}") +set(CMAKE_MODULE_PATH "${ECM_KDE_MODULE_DIR}" "${ECM_MODULE_DIR}") foreach(module ${all_kde_modules}) message(STATUS "module: ${module}") @@ -19,4 +20,6 @@ endforeach() add_executable(dummy main.c) +ecm_mark_nongui_executable(dummy) + set_target_properties(dummy PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-cmake-modules-5.10.0/tests/test_helpers.cmake new/extra-cmake-modules-5.11.0/tests/test_helpers.cmake --- old/extra-cmake-modules-5.10.0/tests/test_helpers.cmake 2015-04-25 17:11:39.000000000 +0200 +++ new/extra-cmake-modules-5.11.0/tests/test_helpers.cmake 2015-06-06 10:10:46.000000000 +0200 @@ -62,3 +62,31 @@ endif() endmacro() +function(assert_vars_setequal varname exp_varname) + if(ARGC LESS 3 OR NOT "${ARGV2}" STREQUAL "ALLOW_UNDEFINED") + assert_var_defined(${varname}) + endif() + # need real variables + set(list1 "${${varname}}") + set(list2 "${${exp_varname}}") + list(LENGTH list1 list1_len) + list(LENGTH list2 list2_len) + set(same_els FALSE) + if(list1_len EQUAL list2_len) + set(same_els TRUE) + foreach(item ${list1}) + list(FIND list2 "${item}" pos) + if(pos EQUAL "-1") + set(same_els FALSE) + break() + else() + # deal nicely with duplicates + list(REMOVE_AT list2 "${pos}") + endif() + endforeach() + endif() + if(NOT same_els) + message(SEND_ERROR "${varname} is '${${varname}}', expecting '${${exp_varname}}'.") + endif() +endfunction() +