diff options
Diffstat (limited to 'Tests')
152 files changed, 1582 insertions, 76 deletions
diff --git a/Tests/Assembler/CMakeLists.txt b/Tests/Assembler/CMakeLists.txt index 94a6325..bb4bccc 100644 --- a/Tests/Assembler/CMakeLists.txt +++ b/Tests/Assembler/CMakeLists.txt @@ -12,6 +12,9 @@ if("${CMAKE_GENERATOR}" MATCHES "Makefile|Xcode" AND if(("${CMAKE_C_COMPILER_ID}" MATCHES "^(GNU|Clang|HP|SunPro|XL)$") OR ("${CMAKE_C_COMPILER_ID}" STREQUAL "Intel" AND UNIX)) set(C_FLAGS "${CMAKE_C_FLAGS}") separate_arguments(C_FLAGS) + if(CMAKE_OSX_SYSROOT AND CMAKE_C_SYSROOT_FLAG AND NOT ";${C_FLAGS};" MATCHES ";${CMAKE_C_SYSROOT_FLAG};") + list(APPEND C_FLAGS ${CMAKE_C_SYSROOT_FLAG} ${CMAKE_OSX_SYSROOT}) + endif() set(SRCS main.s) add_custom_command( OUTPUT main.s diff --git a/Tests/BuildDepends/Project/CMakeLists.txt b/Tests/BuildDepends/Project/CMakeLists.txt index 01f5f62..542c716 100644 --- a/Tests/BuildDepends/Project/CMakeLists.txt +++ b/Tests/BuildDepends/Project/CMakeLists.txt @@ -64,7 +64,8 @@ if("${CMAKE_GENERATOR}" MATCHES "Make") # Test the IMPLICIT_DEPENDS feature. set(ZOT_DEPENDS IMPLICIT_DEPENDS CXX ${CMAKE_CURRENT_SOURCE_DIR}/dep.cxx) set(ZOT_CUSTOM_DEP - IMPLICIT_DEPENDS CXX ${CMAKE_CURRENT_SOURCE_DIR}/dep_custom.cxx) + IMPLICIT_DEPENDS CXX ${CMAKE_CURRENT_SOURCE_DIR}/dep_custom.cxx + CXX ${CMAKE_CURRENT_SOURCE_DIR}/dep_custom2.cxx ) else() # No IMPLICIT_DEPENDS...just depend directly. set(ZOT_DEPENDS DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/zot.hxx.in) diff --git a/Tests/BuildDepends/Project/dep_custom2.cxx b/Tests/BuildDepends/Project/dep_custom2.cxx new file mode 100644 index 0000000..ac9dee1 --- /dev/null +++ b/Tests/BuildDepends/Project/dep_custom2.cxx @@ -0,0 +1,2 @@ +#include <zot_custom.hxx.in> +// some comment diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index e03b926..bbf804b 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -57,6 +57,8 @@ if(BUILD_TESTING) add_subdirectory(FindPackageModeMakefileTest) + add_subdirectory(CTestTestMemcheck) + # Collect a list of all test build directories. set(TEST_BUILD_DIRS) @@ -554,6 +556,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-generator ${CMAKE_TEST_GENERATOR} --build-project GeneratorExpression --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + --build-options -DCMAKE_BUILD_TYPE=\${CTEST_CONFIGURATION_TYPE} ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/GeneratorExpression") @@ -1254,6 +1257,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ if(CMAKE_TEST_MSVC) ADD_TEST_MACRO(ForceInclude foo) + ADD_TEST_MACRO(PDBDirectoryAndName myexe) ADD_TEST_MACRO(PrecompiledHeader foo) endif() if(CMAKE_TEST_MSVC OR diff --git a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt index 212c758..739593c 100644 --- a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt +++ b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt @@ -70,8 +70,9 @@ endmacro() # If any of these modules reported that it was found a version number should have been # reported. -foreach(VTEST ALSA ARMADILLO BZIP2 CUPS CURL EXPAT FREETYPE GETTEXT GIT HG HSPELL - JASPER LIBLZMA LIBXML2 LIBXSLT PERL PKG_CONFIG PostgreSQL TIFF ZLIB) +foreach(VTEST ALSA ARMADILLO BZIP2 CUPS CURL EXPAT FREETYPE GETTEXT GIT HG + HSPELL ICOTOOL JASPER LIBLZMA LIBXML2 LIBXSLT PERL PKG_CONFIG + PostgreSQL TIFF ZLIB) check_version_string(${VTEST} ${VTEST}_VERSION_STRING) endforeach() diff --git a/Tests/CMakeOnly/CMakeLists.txt b/Tests/CMakeOnly/CMakeLists.txt index ba681d8..1b4ebc4 100644 --- a/Tests/CMakeOnly/CMakeLists.txt +++ b/Tests/CMakeOnly/CMakeLists.txt @@ -27,6 +27,8 @@ endif() add_CMakeOnly_test(AllFindModules) +add_CMakeOnly_test(SelectLibraryConfigurations) + add_CMakeOnly_test(TargetScope) add_CMakeOnly_test(find_library) @@ -36,3 +38,22 @@ add_test(CMakeOnly.ProjectInclude ${CMAKE_CMAKE_COMMAND} -DCMAKE_ARGS=-DCMAKE_PROJECT_ProjectInclude_INCLUDE=${CMAKE_CURRENT_SOURCE_DIR}/ProjectInclude/include.cmake -P ${CMAKE_CURRENT_BINARY_DIR}/Test.cmake ) + +include(${CMAKE_SOURCE_DIR}/Modules/CMakeParseArguments.cmake) + +function(add_major_test module) + cmake_parse_arguments(MAJOR_TEST "NOLANG" "VERSION_VAR" "VERSIONS" ${ARGN}) + foreach (_version IN LISTS MAJOR_TEST_VERSIONS) + add_test(CMakeOnly.MajorVersionSelection-${module}_${_version} + ${CMAKE_CMAKE_COMMAND} + -DTEST=MajorVersionSelection-${module}_${_version} + -DTEST_SOURCE=MajorVersionSelection + "-DCMAKE_ARGS=-DMAJOR_TEST_MODULE=${module};-DMAJOR_TEST_VERSION=${_version};-DMAJOR_TEST_NO_LANGUAGES=${MAJOR_TEST_NOLANG};-DMAJOR_TEST_VERSION_VAR=${MAJOR_TEST_VERSION_VAR}" + -P ${CMAKE_CURRENT_BINARY_DIR}/Test.cmake + ) + endforeach () +endfunction() + +add_major_test(PythonLibs VERSIONS 2 3 VERSION_VAR PYTHONLIBS_VERSION_STRING) +add_major_test(PythonInterp NOLANG VERSIONS 2 3 VERSION_VAR PYTHON_VERSION_STRING) +add_major_test(Qt VERSIONS 3 4 VERSION_VAR QT_VERSION_STRING) diff --git a/Tests/CMakeOnly/MajorVersionSelection/CMakeLists.txt b/Tests/CMakeOnly/MajorVersionSelection/CMakeLists.txt new file mode 100644 index 0000000..74f5451 --- /dev/null +++ b/Tests/CMakeOnly/MajorVersionSelection/CMakeLists.txt @@ -0,0 +1,46 @@ +cmake_minimum_required(VERSION 2.8) + +if (NOT MAJOR_TEST_MODULE OR NOT MAJOR_TEST_VERSION) + message(FATAL_ERROR "test selection variables not set up") +endif () + +if (MAJOR_TEST_NO_LANGUAGES) + project(major_detect_${MAJOR_TEST_MODULE}_${MAJOR_TEST_VERSION} NONE) +else () + project(major_detect_${MAJOR_TEST_MODULE}_${MAJOR_TEST_VERSION}) +endif () + +find_package(${MAJOR_TEST_MODULE} ${MAJOR_TEST_VERSION}) + +if (MAJOR_TEST_VERSION_VAR) + set(VERSION_VAR "${MAJOR_TEST_VERSION_VAR}") +else () + set(VERSION_VAR "${MAJOR_TEST_MODULE}_VERSION_STRING") +endif () + +string(TOUPPER "${MAJOR_TEST_MODULE}" MODULE_UPPER) + +if ( ( ${MAJOR_TEST_MODULE}_FOUND OR ${MODULE_UPPER}_FOUND ) AND "${VERSION_VAR}") + message(STATUS "${VERSION_VAR} is '${${VERSION_VAR}}'") + if ("${VERSION_VAR}" VERSION_LESS MAJOR_TEST_VERSION) + message(SEND_ERROR "Found version ${${VERSION_VAR}} is less than requested major version ${MAJOR_TEST_VERSION}") + endif () + math(EXPR V_PLUS_ONE "${MAJOR_TEST_VERSION} + 1") + if ("${VERSION_VAR}" VERSION_GREATER V_PLUS_ONE) + message(SEND_ERROR "Found version ${${VERSION_VAR}} is greater than requested major version ${MAJOR_TEST_VERSION}") + endif () +endif () + +if ( ( ${MAJOR_TEST_MODULE}_FOUND OR ${MODULE_UPPER}_FOUND ) AND ${MAJOR_TEST_MODULE}_VERSION_MAJOR) + message(STATUS "${MAJOR_TEST_MODULE}_VERSION_MAJOR is '${${MAJOR_TEST_MODULE}_VERSION_MAJOR}'") + if (NOT ${MAJOR_TEST_VERSION} EQUAL ${MAJOR_TEST_MODULE}_VERSION_MAJOR) + message(SEND_ERROR "We requested major version ${MAJOR_TEST_VERSION} but ${MAJOR_TEST_MODULE} set ${MAJOR_TEST_MODULE}_VERSION_MAJOR to ${${MAJOR_TEST_MODULE}_VERSION_MAJOR}") + endif () +endif () + +if ( ( ${MAJOR_TEST_MODULE}_FOUND OR ${MODULE_UPPER}_FOUND ) AND ${MODULE_UPPER}_VERSION_MAJOR) + message(STATUS "${MODULE_UPPER}_VERSION_MAJOR is '${${MODULE_UPPER}_VERSION_MAJOR}'") + if (NOT ${MAJOR_TEST_VERSION} EQUAL ${MODULE_UPPER}_VERSION_MAJOR) + message(SEND_ERROR "We requested major version ${MAJOR_TEST_VERSION} but ${MAJOR_TEST_MODULE} set ${MODULE_UPPER}_VERSION_MAJOR to ${${MODULE_UPPER}_VERSION_MAJOR}") + endif () +endif () diff --git a/Tests/CMakeOnly/SelectLibraryConfigurations/CMakeLists.txt b/Tests/CMakeOnly/SelectLibraryConfigurations/CMakeLists.txt new file mode 100644 index 0000000..5bf0f8a --- /dev/null +++ b/Tests/CMakeOnly/SelectLibraryConfigurations/CMakeLists.txt @@ -0,0 +1,64 @@ +cmake_minimum_required(VERSION 2.8) + +project(SelectLibraryConfigurations NONE) + +include(${CMAKE_ROOT}/Modules/SelectLibraryConfigurations.cmake) + +macro(check_slc basename expect) + message(STATUS "checking select_library_configurations(${basename})") + select_library_configurations(${basename}) + if (NOT ${basename}_LIBRARY STREQUAL "${expect}") + message(SEND_ERROR "select_library_configurations(${basename}) returned '${${basename}_LIBRARY}' but '${expect}' was expected") + endif () + if (NOT ${basename}_LIBRARY STREQUAL "${${basename}_LIBRARIES}") + message(SEND_ERROR "select_library_configurations(${basename}) LIBRARY: '${${basename}_LIBRARY}' LIBRARIES: '${${basename}_LIBRARIES}'") + endif () +endmacro(check_slc) + +if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) + set(NOTYPE_RELONLY_LIBRARY_RELEASE "opt") + check_slc(NOTYPE_RELONLY "opt") + + set(NOTYPE_DBGONLY_LIBRARY_DEBUG "dbg") + check_slc(NOTYPE_DBGONLY "dbg") + + set(NOTYPE_RELDBG_LIBRARY_RELEASE "opt") + set(NOTYPE_RELDBG_LIBRARY_DEBUG "dbg") + check_slc(NOTYPE_RELDBG "opt") + + set(CMAKE_BUILD_TYPE Debug) +endif () + +check_slc(empty "") + +set(OPTONLY_LIBRARY_RELEASE "opt") +check_slc(OPTONLY "opt") + +set(DBGONLY_LIBRARY_RELEASE "dbg") +check_slc(DBGONLY "dbg") + +set(SAME_LIBRARY_RELEASE "same") +set(SAME_LIBRARY_DEBUG "same") +check_slc(SAME "same") + +set(OPTONLYLIST_LIBRARY_RELEASE "opt1;opt2") +check_slc(OPTONLYLIST "opt1;opt2") + +set(DBGONLYLIST_LIBRARY_RELEASE "dbg1;dbg2") +check_slc(DBGONLYLIST "dbg1;dbg2") + +set(OPT1DBG1_LIBRARY_RELEASE "opt") +set(OPT1DBG1_LIBRARY_DEBUG "dbg") +check_slc(OPT1DBG1 "optimized;opt;debug;dbg") + +set(OPT1DBG2_LIBRARY_RELEASE "opt") +set(OPT1DBG2_LIBRARY_DEBUG "dbg1;dbg2") +check_slc(OPT1DBG2 "optimized;opt;debug;dbg1;debug;dbg2") + +set(OPT2DBG1_LIBRARY_RELEASE "opt1;opt2") +set(OPT2DBG1_LIBRARY_DEBUG "dbg") +check_slc(OPT2DBG1 "optimized;opt1;optimized;opt2;debug;dbg") + +set(OPT2DBG2_LIBRARY_RELEASE "opt1;opt2") +set(OPT2DBG2_LIBRARY_DEBUG "dbg1;dbg2") +check_slc(OPT2DBG2 "optimized;opt1;optimized;opt2;debug;dbg1;debug;dbg2") diff --git a/Tests/CMakeOnly/Test.cmake.in b/Tests/CMakeOnly/Test.cmake.in index 42af068..f76db1d 100644 --- a/Tests/CMakeOnly/Test.cmake.in +++ b/Tests/CMakeOnly/Test.cmake.in @@ -1,4 +1,8 @@ -set(source_dir "@CMAKE_CURRENT_SOURCE_DIR@/${TEST}") +if (NOT TEST_SOURCE) + set(TEST_SOURCE "${TEST}") +endif () + +set(source_dir "@CMAKE_CURRENT_SOURCE_DIR@/${TEST_SOURCE}") set(binary_dir "@CMAKE_CURRENT_BINARY_DIR@/${TEST}-build") file(REMOVE_RECURSE "${binary_dir}") file(MAKE_DIRECTORY "${binary_dir}") diff --git a/Tests/CMakeOnly/find_library/A/libtestA.a b/Tests/CMakeOnly/find_library/A/libtestA.a new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/CMakeOnly/find_library/A/libtestA.a diff --git a/Tests/CMakeOnly/find_library/B/libtestB.a b/Tests/CMakeOnly/find_library/B/libtestB.a new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/CMakeOnly/find_library/B/libtestB.a diff --git a/Tests/CMakeOnly/find_library/CMakeLists.txt b/Tests/CMakeOnly/find_library/CMakeLists.txt index 08f9331..2d4ecaf 100644 --- a/Tests/CMakeOnly/find_library/CMakeLists.txt +++ b/Tests/CMakeOnly/find_library/CMakeLists.txt @@ -3,34 +3,34 @@ project(FindLibraryTest NONE) set(CMAKE_FIND_DEBUG_MODE 1) -macro(test_find_library expected) - get_filename_component(dir ${expected} PATH) - get_filename_component(name ${expected} NAME) - string(REGEX REPLACE "lib/?64" "lib" dir "${dir}") +macro(test_find_library desc expected) unset(LIB CACHE) - find_library(LIB - NAMES ${name} - PATHS ${CMAKE_CURRENT_SOURCE_DIR}/${dir} - NO_DEFAULT_PATH - ) + find_library(LIB ${ARGN} NO_DEFAULT_PATH) if(LIB) # Convert to relative path for comparison to expected location. file(RELATIVE_PATH REL_LIB "${CMAKE_CURRENT_SOURCE_DIR}" "${LIB}") - # Debugging output. - if(CMAKE_FIND_DEBUG_MODE) - message(STATUS "Library ${expected} searched as ${dir}, found as [${REL_LIB}].") - endif() - # Check and report failure. if(NOT "${REL_LIB}" STREQUAL "${expected}") - message(SEND_ERROR "Library ${l} should have been [${expected}] but was [${REL_LIB}]") + message(SEND_ERROR "Library ${expected} found as [${REL_LIB}]${desc}") + elseif(CMAKE_FIND_DEBUG_MODE) + message(STATUS "Library ${expected} found as [${REL_LIB}]${desc}") endif() else() - message(SEND_ERROR "Library ${expected} searched as ${dir}, NOT FOUND!") + message(SEND_ERROR "Library ${expected} NOT FOUND${desc}") endif() endmacro() +macro(test_find_library_subst expected) + get_filename_component(dir ${expected} PATH) + get_filename_component(name ${expected} NAME) + string(REGEX REPLACE "lib/?64" "lib" dir "${dir}") + test_find_library(", searched as ${dir}" "${expected}" + NAMES ${name} + PATHS ${CMAKE_CURRENT_SOURCE_DIR}/${dir} + ) +endmacro() + set(CMAKE_FIND_LIBRARY_PREFIXES "lib") set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS TRUE) @@ -44,7 +44,7 @@ foreach(lib lib/libtest3.a lib/libtest3.a ) - test_find_library(${lib}) + test_find_library_subst(${lib}) endforeach() set(CMAKE_SIZEOF_VOID_P 8) @@ -57,5 +57,18 @@ foreach(lib64 lib64/A/libtest1.a lib64/libtest1.a ) - test_find_library(${lib64}) + test_find_library_subst(${lib64}) endforeach() + +test_find_library("" A/libtestA.a + NAMES testA testB + PATHS ${CMAKE_CURRENT_SOURCE_DIR}/A ${CMAKE_CURRENT_SOURCE_DIR}/B + ) +test_find_library("" B/libtestB.a + NAMES testB testA + PATHS ${CMAKE_CURRENT_SOURCE_DIR}/A ${CMAKE_CURRENT_SOURCE_DIR}/B + ) +test_find_library("" A/libtestA.a + NAMES testB testA NAMES_PER_DIR + PATHS ${CMAKE_CURRENT_SOURCE_DIR}/A ${CMAKE_CURRENT_SOURCE_DIR}/B + ) diff --git a/Tests/CMakeTests/CheckCMakeTest.cmake b/Tests/CMakeTests/CheckCMakeTest.cmake index db92905..7be7b30 100644 --- a/Tests/CMakeTests/CheckCMakeTest.cmake +++ b/Tests/CMakeTests/CheckCMakeTest.cmake @@ -1,30 +1,35 @@ get_filename_component(CMakeTests_SRC_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) + +function(check_cmake_test_single prefix test testfile) + message(STATUS "Test ${prefix}-${test}...") + execute_process( + COMMAND ${CMAKE_COMMAND} -P "${testfile}" + WORKING_DIRECTORY "${CMakeTests_BIN_DIR}" + OUTPUT_VARIABLE stdout + ERROR_VARIABLE stderr + RESULT_VARIABLE result + ) + string(REGEX REPLACE "\n" "\n out> " out " out> ${stdout}") + string(REGEX REPLACE "\n" "\n err> " err " err> ${stderr}") + if(NOT "${result}" STREQUAL "${${test}-RESULT}") + message(FATAL_ERROR + "Test ${test} result is [${result}], not [${${test}-RESULT}].\n" + "Test ${test} output:\n" + "${out}\n" + "${err}") + endif() + if(${test}-STDERR AND NOT "${err}" MATCHES "${${test}-STDERR}") + message(FATAL_ERROR + "Test ${test} stderr does not match\n ${${test}-STDERR}\n" + "Test ${test} output:\n" + "${out}\n" + "${err}") + endif() +endfunction() + function(check_cmake_test prefix) get_filename_component(CMakeTests_BIN_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) foreach(test ${ARGN}) - message(STATUS "Test ${prefix}-${test}...") - execute_process( - COMMAND ${CMAKE_COMMAND} -P "${CMakeTests_SRC_DIR}/${prefix}-${test}.cmake" - WORKING_DIRECTORY "${CMakeTests_BIN_DIR}" - OUTPUT_VARIABLE stdout - ERROR_VARIABLE stderr - RESULT_VARIABLE result - ) - string(REGEX REPLACE "\n" "\n out> " out " out> ${stdout}") - string(REGEX REPLACE "\n" "\n err> " err " err> ${stderr}") - if(NOT "${result}" STREQUAL "${${test}-RESULT}") - message(FATAL_ERROR - "Test ${test} result is [${result}], not [${${test}-RESULT}].\n" - "Test ${test} output:\n" - "${out}\n" - "${err}") - endif() - if(${test}-STDERR AND NOT "${err}" MATCHES "${${test}-STDERR}") - message(FATAL_ERROR - "Test ${test} stderr does not match\n ${${test}-STDERR}\n" - "Test ${test} output:\n" - "${out}\n" - "${err}") - endif() + check_cmake_test_single("${prefix}" "${test}" "${CMakeTests_SRC_DIR}/${prefix}-${test}.cmake") endforeach() endfunction() diff --git a/Tests/CMakeTests/File-Glob-NoArg.cmake b/Tests/CMakeTests/File-Glob-NoArg.cmake new file mode 100644 index 0000000..486f366 --- /dev/null +++ b/Tests/CMakeTests/File-Glob-NoArg.cmake @@ -0,0 +1,2 @@ +# Checking that the call without arguments get caught by the file global protection. +file(GLOB) diff --git a/Tests/CMakeTests/FileDownloadTest.cmake.in b/Tests/CMakeTests/FileDownloadTest.cmake.in index 3f0ab50..91086c6 100644 --- a/Tests/CMakeTests/FileDownloadTest.cmake.in +++ b/Tests/CMakeTests/FileDownloadTest.cmake.in @@ -38,7 +38,7 @@ file(DOWNLOAD ${dir}/file3.png TIMEOUT 2 STATUS status - EXPECTED_HASH SHA1 50c614fc28b39c1281d0517bb6d5858b4359c9b7 + EXPECTED_HASH SHA1=50c614fc28b39c1281d0517bb6d5858b4359c9b7 ) message(STATUS "FileDownload:5") @@ -47,7 +47,7 @@ file(DOWNLOAD ${dir}/file3.png TIMEOUT 2 STATUS status - EXPECTED_HASH SHA224 73cd5f442b04e8320e4f907f8e1b21d4befff98b5bd77bc32526ea68 + EXPECTED_HASH SHA224=73cd5f442b04e8320e4f907f8e1b21d4befff98b5bd77bc32526ea68 ) message(STATUS "FileDownload:6") @@ -56,7 +56,7 @@ file(DOWNLOAD ${dir}/file3.png TIMEOUT 2 STATUS status - EXPECTED_HASH SHA256 2e067f6c09cbc7cd619c8fbcc44eb64cd6b45a95e4cddb3a585eee1f731c4da9 + EXPECTED_HASH SHA256=2e067f6c09cbc7cd619c8fbcc44eb64cd6b45a95e4cddb3a585eee1f731c4da9 ) message(STATUS "FileDownload:7") @@ -65,7 +65,7 @@ file(DOWNLOAD ${dir}/file3.png TIMEOUT 2 STATUS status - EXPECTED_HASH SHA384 398bf41902a7251c30e522b307e3e41e3fb617c765b3feaa99b2f7d063894708ad399267ccc25d877437a10e5e890d35 + EXPECTED_HASH SHA384=398bf41902a7251c30e522b307e3e41e3fb617c765b3feaa99b2f7d063894708ad399267ccc25d877437a10e5e890d35 ) message(STATUS "FileDownload:8") @@ -74,7 +74,7 @@ file(DOWNLOAD ${dir}/file3.png TIMEOUT 2 STATUS status - EXPECTED_HASH SHA512 c51854d21052713968b849c2b4263cf54be03bc3a7e9847a6c71c6c8d1d13cd805fe1b9fa95f9ba1d0a5631513974f6fae21e34ab5b171d94bad48df5f073e48 + EXPECTED_HASH SHA512=c51854d21052713968b849c2b4263cf54be03bc3a7e9847a6c71c6c8d1d13cd805fe1b9fa95f9ba1d0a5631513974f6fae21e34ab5b171d94bad48df5f073e48 ) message(STATUS "FileDownload:9") file(DOWNLOAD @@ -82,7 +82,7 @@ file(DOWNLOAD ${dir}/file3.png TIMEOUT 2 STATUS status - EXPECTED_HASH MD5 d16778650db435bda3a8c3435c3ff5d1 + EXPECTED_HASH MD5=d16778650db435bda3a8c3435c3ff5d1 ) message(STATUS "FileDownload:10") diff --git a/Tests/CMakeTests/FileTest.cmake.in b/Tests/CMakeTests/FileTest.cmake.in index 3c3d85d..960d3c1 100644 --- a/Tests/CMakeTests/FileTest.cmake.in +++ b/Tests/CMakeTests/FileTest.cmake.in @@ -12,6 +12,10 @@ set(Copy-NoDest-RESULT 1) set(Copy-NoDest-STDERR "given no DESTINATION") set(Copy-NoFile-RESULT 1) set(Copy-NoFile-STDERR "COPY cannot find.*/does_not_exist\\.txt") +set(Glob-NoArg-RESULT 1) +set(Glob-NoArg-STDERR "file must be called with at least two arguments") +set(Make_Directory-NoArg-RESULT 1) +set(Make-Directory-NoArg-STDERR "file must be called with at least two arguments") set(MD5-NoFile-RESULT 1) set(MD5-NoFile-STDERR "file MD5 failed to read file") set(MD5-BadArg1-RESULT 1) @@ -42,6 +46,8 @@ check_cmake_test(File Copy-LateArg Copy-NoDest Copy-NoFile + Glob-NoArg + Make_Directory-NoArg MD5-NoFile MD5-BadArg1 MD5-BadArg2 @@ -54,6 +60,11 @@ check_cmake_test(File SHA512-Works ) +file(GLOB hum) +if (NOT hum STREQUAL "") + message(FATAL_ERROR "file(GLOB hum) did not return an empty string.") +endif() + # Also execute each test listed in FileTestScript.cmake: # set(scriptname "@CMAKE_CURRENT_SOURCE_DIR@/FileTestScript.cmake") diff --git a/Tests/CMakeTests/GetProperty-Doc-Properties.cmake b/Tests/CMakeTests/GetProperty-Doc-Properties.cmake deleted file mode 100644 index 6c2c362..0000000 --- a/Tests/CMakeTests/GetProperty-Doc-Properties.cmake +++ /dev/null @@ -1,10 +0,0 @@ -get_property(FOO_BRIEF GLOBAL PROPERTY FOO BRIEF_DOCS) -get_property(FOO_FULL GLOBAL PROPERTY FOO FULL_DOCS) - -if (NOT FOO_BRIEF STREQUAL "NOTFOUND") - message(SEND_ERROR "property FOO has BRIEF_DOCS set to '${FOO_BRIEF}'") -endif () - -if (NOT FOO_FULL STREQUAL "NOTFOUND") - message(SEND_ERROR "property FOO has FULL_DOCS set to '${FOO_FULL}'") -endif () diff --git a/Tests/CMakeTests/GetPropertyTest.cmake.in b/Tests/CMakeTests/GetPropertyTest.cmake.in index ab96e5b..306ab72 100644 --- a/Tests/CMakeTests/GetPropertyTest.cmake.in +++ b/Tests/CMakeTests/GetPropertyTest.cmake.in @@ -1,5 +1,33 @@ include("@CMAKE_CURRENT_SOURCE_DIR@/CheckCMakeTest.cmake") +get_property(FOO_BRIEF GLOBAL PROPERTY FOO BRIEF_DOCS) +get_property(FOO_FULL GLOBAL PROPERTY FOO FULL_DOCS) + +if (NOT FOO_BRIEF STREQUAL "NOTFOUND") + message(SEND_ERROR "property FOO has BRIEF_DOCS set to '${FOO_BRIEF}'") +endif () + +if (NOT FOO_FULL STREQUAL "NOTFOUND") + message(SEND_ERROR "property FOO has FULL_DOCS set to '${FOO_FULL}'") +endif () + +get_property(test_brief GLOBAL PROPERTY ENABLED_FEATURES BRIEF_DOCS) +get_property(test_full GLOBAL PROPERTY ENABLED_FEATURES FULL_DOCS) + +if(test_brief STREQUAL "NOTFOUND") + message(SEND_ERROR "property ENABLED_FEATURES has no BRIEF_DOCS") +endif() + +if(test_full STREQUAL "NOTFOUND") + message(SEND_ERROR "property ENABLED_FEATURES has no FULL_DOCS") +endif() + +set(test_var alpha) +get_property(result VARIABLE PROPERTY test_var) +if(NOT result STREQUAL "alpha") + message(SEND_ERROR "bad value of VARIABLE PROPERTY test_var: got '${result}' instead of 'alpha'") +endif() + set(Missing-Argument-RESULT 1) set(Missing-Argument-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?GetProperty-Missing-Argument.cmake:1 \\(get_property\\):.*get_property called with incorrect number of arguments.*") @@ -28,12 +56,6 @@ check_cmake_test(GetProperty No-Property ) -set(Doc-Properties-RESULT 0) - -check_cmake_test(GetProperty - Doc-Properties -) - set(Global-Name-RESULT 1) set(Global-Name-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?GetProperty-Global-Name.cmake:1 \\(get_property\\):.*get_property given name for GLOBAL scope\\..*") diff --git a/Tests/CMakeTests/List-Get-CMP0007-Warn.cmake b/Tests/CMakeTests/List-Get-CMP0007-Warn.cmake new file mode 100644 index 0000000..0a9264f --- /dev/null +++ b/Tests/CMakeTests/List-Get-CMP0007-Warn.cmake @@ -0,0 +1,6 @@ +set(thelist "" NEW OLD) + +list(GET thelist 1 thevalue) +if (NOT thevalue STREQUAL "OLD") + message(SEND_ERROR "returned element '${thevalue}', but expected 'OLD'") +endif() diff --git a/Tests/CMakeTests/List-Get-Invalid-Index.cmake b/Tests/CMakeTests/List-Get-Invalid-Index.cmake new file mode 100644 index 0000000..178295a --- /dev/null +++ b/Tests/CMakeTests/List-Get-Invalid-Index.cmake @@ -0,0 +1,2 @@ +set(mylist alpha bravo charlie) +list(GET mylist 3 result) diff --git a/Tests/CMakeTests/List-Insert-Invalid-Index.cmake b/Tests/CMakeTests/List-Insert-Invalid-Index.cmake new file mode 100644 index 0000000..4103d97 --- /dev/null +++ b/Tests/CMakeTests/List-Insert-Invalid-Index.cmake @@ -0,0 +1,2 @@ +set(mylist alpha bravo charlie) +list(INSERT mylist 3 delta) diff --git a/Tests/CMakeTests/List-Invalid-Subcommand.cmake b/Tests/CMakeTests/List-Invalid-Subcommand.cmake new file mode 100644 index 0000000..f35a118 --- /dev/null +++ b/Tests/CMakeTests/List-Invalid-Subcommand.cmake @@ -0,0 +1 @@ +list(NO_SUCH_SUBCOMMAND mylist) diff --git a/Tests/CMakeTests/List-Length-Too-Many-Arguments.cmake b/Tests/CMakeTests/List-Length-Too-Many-Arguments.cmake new file mode 100644 index 0000000..327db6a --- /dev/null +++ b/Tests/CMakeTests/List-Length-Too-Many-Arguments.cmake @@ -0,0 +1 @@ +list(LENGTH mylist result one_too_many) diff --git a/Tests/CMakeTests/List-No-Arguments.cmake b/Tests/CMakeTests/List-No-Arguments.cmake new file mode 100644 index 0000000..7916aaa --- /dev/null +++ b/Tests/CMakeTests/List-No-Arguments.cmake @@ -0,0 +1 @@ +list() diff --git a/Tests/CMakeTests/List-Remove_At-Invalid-Index.cmake b/Tests/CMakeTests/List-Remove_At-Invalid-Index.cmake new file mode 100644 index 0000000..d4f3921 --- /dev/null +++ b/Tests/CMakeTests/List-Remove_At-Invalid-Index.cmake @@ -0,0 +1,2 @@ +set(mylist alpha bravo charlie) +list(REMOVE_AT mylist 3) diff --git a/Tests/CMakeTests/List-Remove_At-Nonexistent-List.cmake b/Tests/CMakeTests/List-Remove_At-Nonexistent-List.cmake new file mode 100644 index 0000000..5266c7f --- /dev/null +++ b/Tests/CMakeTests/List-Remove_At-Nonexistent-List.cmake @@ -0,0 +1,2 @@ +unset(nosuchlist) +list(REMOVE_AT nosuchlist 0) diff --git a/Tests/CMakeTests/List-Remove_Duplicates-Nonexistent-List.cmake b/Tests/CMakeTests/List-Remove_Duplicates-Nonexistent-List.cmake new file mode 100644 index 0000000..218f227 --- /dev/null +++ b/Tests/CMakeTests/List-Remove_Duplicates-Nonexistent-List.cmake @@ -0,0 +1,2 @@ +unset(nosuchlist) +list(REMOVE_DUPLICATES nosuchlist) diff --git a/Tests/CMakeTests/List-Remove_Duplicates-Too-Many-Arguments.cmake b/Tests/CMakeTests/List-Remove_Duplicates-Too-Many-Arguments.cmake new file mode 100644 index 0000000..b5eb46e --- /dev/null +++ b/Tests/CMakeTests/List-Remove_Duplicates-Too-Many-Arguments.cmake @@ -0,0 +1 @@ +list(REMOVE_DUPLICATES mylist one_too_many) diff --git a/Tests/CMakeTests/List-Remove_Item-Nonexistent-List.cmake b/Tests/CMakeTests/List-Remove_Item-Nonexistent-List.cmake new file mode 100644 index 0000000..079e7fb --- /dev/null +++ b/Tests/CMakeTests/List-Remove_Item-Nonexistent-List.cmake @@ -0,0 +1,2 @@ +unset(nosuchlist) +list(REMOVE_ITEM nosuchlist alpha) diff --git a/Tests/CMakeTests/List-Reverse-Nonexistent-List.cmake b/Tests/CMakeTests/List-Reverse-Nonexistent-List.cmake new file mode 100644 index 0000000..977e2cc --- /dev/null +++ b/Tests/CMakeTests/List-Reverse-Nonexistent-List.cmake @@ -0,0 +1,2 @@ +unset(nosuchlist) +list(REVERSE nosuchlist) diff --git a/Tests/CMakeTests/List-Reverse-Too-Many-Arguments.cmake b/Tests/CMakeTests/List-Reverse-Too-Many-Arguments.cmake new file mode 100644 index 0000000..3a554a0 --- /dev/null +++ b/Tests/CMakeTests/List-Reverse-Too-Many-Arguments.cmake @@ -0,0 +1 @@ +list(REVERSE mylist one_too_many) diff --git a/Tests/CMakeTests/List-Sort-Nonexistent-List.cmake b/Tests/CMakeTests/List-Sort-Nonexistent-List.cmake new file mode 100644 index 0000000..8f48e10 --- /dev/null +++ b/Tests/CMakeTests/List-Sort-Nonexistent-List.cmake @@ -0,0 +1,2 @@ +unset(nosuchlist) +list(SORT nosuchlist) diff --git a/Tests/CMakeTests/List-Sort-Too-Many-Arguments.cmake b/Tests/CMakeTests/List-Sort-Too-Many-Arguments.cmake new file mode 100644 index 0000000..81b195d --- /dev/null +++ b/Tests/CMakeTests/List-Sort-Too-Many-Arguments.cmake @@ -0,0 +1 @@ +list(SORT mylist one_too_many) diff --git a/Tests/CMakeTests/ListTest.cmake.in b/Tests/CMakeTests/ListTest.cmake.in index a167503..f0ed70f 100644 --- a/Tests/CMakeTests/ListTest.cmake.in +++ b/Tests/CMakeTests/ListTest.cmake.in @@ -1,3 +1,5 @@ +include("@CMAKE_CURRENT_SOURCE_DIR@/CheckCMakeTest.cmake") + macro(TEST command expected) if("x${result}" STREQUAL "x${expected}") #message("TEST \"${command}\" success: \"${result}\" expected: \"${expected}\"") @@ -97,3 +99,89 @@ TEST("REVERSE empty result" "") list(SORT result) TEST("SORT empty result" "") + +set(No-Arguments-RESULT 1) +set(No-Arguments-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?List-No-Arguments.cmake:1 \\(list\\):.*list must be called with at least two arguments.*") + +# these trigger top-level condition +foreach(cmd IN ITEMS Append Find Get Insert Length Reverse Remove_At Remove_Duplicates Remove_Item Sort) + set(${cmd}-No-Arguments-RESULT 1) + set(${cmd}-No-Arguments-STDERR ".*CMake Error at List-${cmd}-No-Arguments.cmake:1 \\(list\\):.*list must be called with at least two arguments.*") + string(TOUPPER ${cmd} cmd_upper) + set(_test_file_name "${CMAKE_CURRENT_BINARY_DIR}/List-${cmd}-No-Arguments.cmake") + file(WRITE "${_test_file_name}" "list(${cmd_upper})\n") + check_cmake_test_single(List "${cmd}-No-Arguments" "${_test_file_name}") +endforeach() + +set(Get-List-Only-STDERR "at least three") +set(Find-List-Only-STDERR "three") +set(Insert-List-Only-STDERR "at least three") +set(Length-List-Only-STDERR "two") +set(Remove_At-List-Only-STDERR "at least two") +set(Remove_Item-List-Only-STDERR "two or more") + +foreach(cmd IN ITEMS Find Get Insert Length Remove_At Remove_Item) + string(TOUPPER ${cmd} cmd_upper) + set(${cmd}-List-Only-RESULT 1) + set(${cmd}-List-Only-STDERR ".*CMake Error at List-${cmd}-List-Only.cmake:1 \\(list\\):.*list sub-command ${cmd_upper} requires ${${cmd}-List-Only-STDERR} arguments.*") + set(_test_file_name "${CMAKE_CURRENT_BINARY_DIR}/List-${cmd}-List-Only.cmake") + file(WRITE "${_test_file_name}" "list(${cmd_upper} mylist)\n") + check_cmake_test_single(List "${cmd}-List-Only" "${_test_file_name}") +endforeach() + +set(Length-Too-Many-Arguments-RESULT 1) +set(Length-Too-Many-Arguments-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?List-Length-Too-Many-Arguments.cmake:1 \\(list\\):.*list sub-command LENGTH requires two arguments.*") + +set(Reverse-Too-Many-Arguments-RESULT 1) +set(Reverse-Too-Many-Arguments-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?List-Reverse-Too-Many-Arguments.cmake:1 \\(list\\):.*list sub-command REVERSE only takes one argument.*") + +set(Remove_Duplicates-Too-Many-Arguments-RESULT 1) +set(Remove_Duplicates-Too-Many-Arguments-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?List-Remove_Duplicates-Too-Many-Arguments.cmake:1 \\(list\\):.*list sub-command REMOVE_DUPLICATES only takes one argument.*") + +set(Sort-Too-Many-Arguments-RESULT 1) +set(Sort-Too-Many-Arguments-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?List-Sort-Too-Many-Arguments.cmake:1 \\(list\\):.*list sub-command SORT only takes one argument.*") + +set(Invalid-Subcommand-RESULT 1) +set(Invalid-Subcommand-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?List-Invalid-Subcommand.cmake:1 \\(list\\):.*list does not recognize sub-command NO_SUCH_SUBCOMMAND.*") + +foreach(cmd Get Insert Remove_At) + set(${cmd}-Invalid-Index-RESULT 1) + set(${cmd}-Invalid-Index-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?List-${cmd}-Invalid-Index.cmake:2 \\(list\\):.*list index: 3 out of range \\(-3, 2\\).*") +endforeach() + +foreach(cmd Remove_Item Reverse Remove_Duplicates Sort Remove_At) + string(TOUPPER ${cmd} Cmd) + set(${cmd}-Nonexistent-List-RESULT 1) + set(${cmd}-Nonexistent-List-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?List-${cmd}-Nonexistent-List.cmake:2 \\(list\\):.*sub-command ${Cmd} requires list to be present.*") +endforeach() + +set(Get-CMP0007-Warn-RESULT 0) +set(Get-CMP0007-Warn-STDERR ".*CMake Warning \\(dev\\) at (@CMAKE_CURRENT_SOURCE_DIR@/)?List-Get-CMP0007-Warn.cmake:3 \\(list\\):.*Policy CMP0007 is not set:.*") + +check_cmake_test(List + No-Arguments + Length-Too-Many-Arguments + Reverse-Too-Many-Arguments + Remove_Duplicates-Too-Many-Arguments + Sort-Too-Many-Arguments + Invalid-Subcommand + Get-Invalid-Index + Insert-Invalid-Index + Remove_Item-Nonexistent-List + Reverse-Nonexistent-List + Remove_Duplicates-Nonexistent-List + Sort-Nonexistent-List + Remove_At-Nonexistent-List + Remove_At-Invalid-Index + Get-CMP0007-Warn +) + +set(thelist "" NEW OLD) + +foreach (_pol ${thelist}) + cmake_policy(SET CMP0007 ${_pol}) + list(GET thelist 1 thevalue) + if (NOT thevalue STREQUAL _pol) + message(SEND_ERROR "returned element '${thevalue}', but expected '${_pol}'") + endif() +endforeach (_pol) diff --git a/Tests/CMakeTests/Make_Directory-NoArg.cmake b/Tests/CMakeTests/Make_Directory-NoArg.cmake new file mode 100644 index 0000000..25b6f89 --- /dev/null +++ b/Tests/CMakeTests/Make_Directory-NoArg.cmake @@ -0,0 +1 @@ +file(MAKE_DIRECTORY) diff --git a/Tests/CMakeTests/VersionTest.cmake.in b/Tests/CMakeTests/VersionTest.cmake.in index 215bb2b..9e31cb4 100644 --- a/Tests/CMakeTests/VersionTest.cmake.in +++ b/Tests/CMakeTests/VersionTest.cmake.in @@ -7,3 +7,10 @@ if("${CMAKE_VERSION}" VERSION_LESS "${min_ver}") else() message("CMAKE_VERSION=[${CMAKE_VERSION}] is not less than [${min_ver}]") endif() + +set(v 1.2.3.4.5.6.7) +if("${v}.8" VERSION_LESS "${v}.9") + message(STATUS "${v}.8 is less than ${v}.9") +else() + message(FATAL_ERROR "${v}.8 is not less than ${v}.9?") +endif() diff --git a/Tests/CTestTestMemcheck/CMakeLists.txt b/Tests/CTestTestMemcheck/CMakeLists.txt new file mode 100644 index 0000000..2730a61 --- /dev/null +++ b/Tests/CTestTestMemcheck/CMakeLists.txt @@ -0,0 +1,81 @@ +foreach (_retval 0 1) + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/ret${_retval}.c" "int main(){return ${_retval};}\n") +endforeach () + +# create binaries that we will use as a pseudo memory checker +add_executable(pseudo_valgrind "${CMAKE_CURRENT_BINARY_DIR}/ret0.c") +set_target_properties(pseudo_valgrind PROPERTIES OUTPUT_NAME valgrind) + +# Xcode 2.x forgets to create the output directory before linking +# the individual architectures. +if(CMAKE_OSX_ARCHITECTURES AND XCODE AND NOT "${XCODE_VERSION}" MATCHES "^[^12]") + add_custom_command(TARGET pseudo_valgrind + PRE_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CFG_INTDIR}" + ) +endif() + +add_executable(pseudo_purify "${CMAKE_CURRENT_BINARY_DIR}/ret0.c") +set_target_properties(pseudo_purify PROPERTIES OUTPUT_NAME purify) +add_executable(pseudo_BC "${CMAKE_CURRENT_BINARY_DIR}/ret0.c") +set_target_properties(pseudo_BC PROPERTIES OUTPUT_NAME BC) + +# binary to be used as pre- and post-memcheck command that fails +add_executable(memcheck_fail "${CMAKE_CURRENT_BINARY_DIR}/ret1.c") + +foreach (_test IN ITEMS Unknown UnknownQuoted NotExist + DummyValgrind DummyValgrindPrePost + DummyValgrindFailPre DummyValgrindFailPost + DummyPurify DummyBC + DummyValgrindIgnoreMemcheck) + configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/${_test}/test.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/${_test}/test.cmake" + @ONLY ESCAPE_QUOTES) + add_test(NAME CTestTestMemcheck${_test} + COMMAND ${CMAKE_CTEST_COMMAND} + -S "${CMAKE_CURRENT_BINARY_DIR}/${_test}/test.cmake" -V + --output-log "${CMAKE_CURRENT_BINARY_DIR}/${_test}/testOutput.log" + -D PSEUDO_BC=$<TARGET_FILE:pseudo_BC> + -D PSEUDO_PURIFY=$<TARGET_FILE:pseudo_purify> + -D PSEUDO_VALGRIND=$<TARGET_FILE:pseudo_valgrind> + -D ERROR_COMMAND=$<TARGET_FILE:memcheck_fail> + ) +endforeach () + +string(REPLACE "\\" "\\\\" CMAKE_COMMAND_ESCAPED "${CMAKE_COMMAND}") +string(REPLACE "(" "\\(" CMAKE_COMMAND_ESCAPED "${CMAKE_COMMAND_ESCAPED}") +string(REPLACE ")" "\\)" CMAKE_COMMAND_ESCAPED "${CMAKE_COMMAND_ESCAPED}") +string(REPLACE "+" "\\+" CMAKE_COMMAND_ESCAPED "${CMAKE_COMMAND_ESCAPED}") + +foreach (_unkn Unknown UnknownQuoted) + set_tests_properties(CTestTestMemcheck${_unkn} PROPERTIES + PASS_REGULAR_EXPRESSION "Do not understand memory checker: ${CMAKE_COMMAND_ESCAPED}\n(.*\n)?Error in read script: ${CMAKE_CURRENT_BINARY_DIR}/${_unkn}/test.cmake\n") +endforeach () + +set_tests_properties(CTestTestMemcheckNotExist PROPERTIES + PASS_REGULAR_EXPRESSION "Memory checker \\(MemoryCheckCommand\\) not set, or cannot find the specified program.") + +set(NORMAL_CTEST_OUTPUT "\n-- Processing memory checking output: \nMemory checking results:\n(BullseyeCoverage[^\n]*\n)?") + +# It is a valid result if valgrind does not output any files (can e.g. happen +# if you have not compiled in debug mode), so these tests will not fail. +set_tests_properties(CTestTestMemcheckDummyValgrind CTestTestMemcheckDummyValgrindPrePost + PROPERTIES + PASS_REGULAR_EXPRESSION "${NORMAL_CTEST_OUTPUT}") + +foreach (_pp Pre Post) + string(TOLOWER ${_pp} _pp_lower) + set_tests_properties(CTestTestMemcheckDummyValgrindFail${_pp} + PROPERTIES + PASS_REGULAR_EXPRESSION "\nProblem running command: ${CMAKE_CURRENT_BINARY_DIR}[^\n]*fail[^\n]*\n(.*\n)?Problem executing ${_pp_lower}-memcheck command\\(s\\\).\n(.*\n)?Error in read script: ${CMAKE_CURRENT_BINARY_DIR}/DummyValgrindFail${_pp}/test.cmake\n") +endforeach () + +set_tests_properties(CTestTestMemcheckDummyValgrindIgnoreMemcheck + PROPERTIES + PASS_REGULAR_EXPRESSION "\n2/2 Test #2: RunCMakeAgain .*\n1/1 MemCheck #1: RunCMake .*${NORMAL_CTEST_OUTPUT}") + +set_tests_properties(CTestTestMemcheckDummyPurify PROPERTIES + PASS_REGULAR_EXPRESSION "\nCannot find memory tester output file: ${CMAKE_CURRENT_BINARY_DIR}/DummyPurify/Testing/Temporary/MemoryChecker.log\n(.*\n)?Error in read script: ${CMAKE_CURRENT_BINARY_DIR}/DummyPurify/test.cmake\n") + +set_tests_properties(CTestTestMemcheckDummyBC PROPERTIES + PASS_REGULAR_EXPRESSION "\nCannot find memory tester output file: ${CMAKE_CURRENT_BINARY_DIR}/DummyBC/Testing/Temporary/MemoryChecker.log\n(.*\n)?Error parsing XML in stream at line 1: no element found\n(.*\n)?Error in read script: ${CMAKE_CURRENT_BINARY_DIR}/DummyBC/test.cmake\n") diff --git a/Tests/CTestTestMemcheck/DummyBC/CMakeLists.txt b/Tests/CTestTestMemcheck/DummyBC/CMakeLists.txt new file mode 100644 index 0000000..aa0e495 --- /dev/null +++ b/Tests/CTestTestMemcheck/DummyBC/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 2.8.9) +project(CTestTestMemcheckDummyBC) +include(CTest) + +add_test (RunCMake "${CMAKE_COMMAND}") diff --git a/Tests/CTestTestMemcheck/DummyBC/CTestConfig.cmake b/Tests/CTestTestMemcheck/DummyBC/CTestConfig.cmake new file mode 100644 index 0000000..39cdd88 --- /dev/null +++ b/Tests/CTestTestMemcheck/DummyBC/CTestConfig.cmake @@ -0,0 +1,7 @@ +set (CTEST_PROJECT_NAME "CTestTestMemcheckDummyBC") +set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") +set (CTEST_DART_SERVER_VERSION "2") +set(CTEST_DROP_METHOD "http") +set(CTEST_DROP_SITE "www.cdash.org") +set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestMemcheck/DummyBC/test.cmake.in b/Tests/CTestTestMemcheck/DummyBC/test.cmake.in new file mode 100644 index 0000000..5005498 --- /dev/null +++ b/Tests/CTestTestMemcheck/DummyBC/test.cmake.in @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 2.8.9) + +# Settings: +set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckDummyBC") + +set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/DummyBC") +set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/DummyBC") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") + +set(CTEST_MEMORYCHECK_COMMAND "${PSEUDO_BC}") + +#CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) + +CTEST_START(Experimental) +CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +#CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestMemcheck/DummyPurify/CMakeLists.txt b/Tests/CTestTestMemcheck/DummyPurify/CMakeLists.txt new file mode 100644 index 0000000..dfd93fd --- /dev/null +++ b/Tests/CTestTestMemcheck/DummyPurify/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 2.8.9) +project(CTestTestMemcheckDummyPurify) +include(CTest) + +add_test (RunCMake "${CMAKE_COMMAND}") diff --git a/Tests/CTestTestMemcheck/DummyPurify/CTestConfig.cmake b/Tests/CTestTestMemcheck/DummyPurify/CTestConfig.cmake new file mode 100644 index 0000000..40b9608 --- /dev/null +++ b/Tests/CTestTestMemcheck/DummyPurify/CTestConfig.cmake @@ -0,0 +1,7 @@ +set (CTEST_PROJECT_NAME "CTestTestMemcheckDummyPurify") +set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") +set (CTEST_DART_SERVER_VERSION "2") +set(CTEST_DROP_METHOD "http") +set(CTEST_DROP_SITE "www.cdash.org") +set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestMemcheck/DummyPurify/test.cmake.in b/Tests/CTestTestMemcheck/DummyPurify/test.cmake.in new file mode 100644 index 0000000..0df4f68 --- /dev/null +++ b/Tests/CTestTestMemcheck/DummyPurify/test.cmake.in @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 2.8.9) + +# Settings: +set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckDummyPurify") + +set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/DummyPurify") +set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/DummyPurify") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") + +set(CTEST_MEMORYCHECK_COMMAND "${PSEUDO_PURIFY}") + +#CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) + +CTEST_START(Experimental) +CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +#CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestMemcheck/DummyValgrind/CMakeLists.txt b/Tests/CTestTestMemcheck/DummyValgrind/CMakeLists.txt new file mode 100644 index 0000000..822966a --- /dev/null +++ b/Tests/CTestTestMemcheck/DummyValgrind/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 2.8.9) +project(CTestTestMemcheckDummyValgrind) +include(CTest) + +add_test (RunCMake "${CMAKE_COMMAND}") diff --git a/Tests/CTestTestMemcheck/DummyValgrind/CTestConfig.cmake b/Tests/CTestTestMemcheck/DummyValgrind/CTestConfig.cmake new file mode 100644 index 0000000..4ca59a4 --- /dev/null +++ b/Tests/CTestTestMemcheck/DummyValgrind/CTestConfig.cmake @@ -0,0 +1,7 @@ +set (CTEST_PROJECT_NAME "CTestTestMemcheckDummyValgrind") +set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") +set (CTEST_DART_SERVER_VERSION "2") +set(CTEST_DROP_METHOD "http") +set(CTEST_DROP_SITE "www.cdash.org") +set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestMemcheck/DummyValgrind/test.cmake.in b/Tests/CTestTestMemcheck/DummyValgrind/test.cmake.in new file mode 100644 index 0000000..e341fed --- /dev/null +++ b/Tests/CTestTestMemcheck/DummyValgrind/test.cmake.in @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 2.8.9) + +# Settings: +set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckDummyValgrind") + +set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/DummyValgrind") +set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/DummyValgrind") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") + +set(CTEST_MEMORYCHECK_COMMAND "${PSEUDO_VALGRIND}") + +#CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) + +CTEST_START(Experimental) +CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +#CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestMemcheck/DummyValgrindFailPost/CMakeLists.txt b/Tests/CTestTestMemcheck/DummyValgrindFailPost/CMakeLists.txt new file mode 100644 index 0000000..8185071 --- /dev/null +++ b/Tests/CTestTestMemcheck/DummyValgrindFailPost/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 2.8.9) +project(CTestTestMemcheckDummyValgrindFailPost) +include(CTest) + +add_test (RunCMake "${CMAKE_COMMAND}") diff --git a/Tests/CTestTestMemcheck/DummyValgrindFailPost/CTestConfig.cmake b/Tests/CTestTestMemcheck/DummyValgrindFailPost/CTestConfig.cmake new file mode 100644 index 0000000..4ca59a4 --- /dev/null +++ b/Tests/CTestTestMemcheck/DummyValgrindFailPost/CTestConfig.cmake @@ -0,0 +1,7 @@ +set (CTEST_PROJECT_NAME "CTestTestMemcheckDummyValgrind") +set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") +set (CTEST_DART_SERVER_VERSION "2") +set(CTEST_DROP_METHOD "http") +set(CTEST_DROP_SITE "www.cdash.org") +set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestMemcheck/DummyValgrindFailPost/test.cmake.in b/Tests/CTestTestMemcheck/DummyValgrindFailPost/test.cmake.in new file mode 100644 index 0000000..7c1aa66 --- /dev/null +++ b/Tests/CTestTestMemcheck/DummyValgrindFailPost/test.cmake.in @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 2.8.9) + +# Settings: +set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckDummyValgrindFailPost") + +set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/DummyValgrindFailPost") +set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/DummyValgrindFailPost") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") + +set(CTEST_MEMORYCHECK_COMMAND "${PSEUDO_VALGRIND}") + +set(CTEST_CUSTOM_POST_MEMCHECK "${ERROR_COMMAND}") + +#CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) + +CTEST_START(Experimental) +CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +#CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestMemcheck/DummyValgrindFailPre/CMakeLists.txt b/Tests/CTestTestMemcheck/DummyValgrindFailPre/CMakeLists.txt new file mode 100644 index 0000000..3714cd6 --- /dev/null +++ b/Tests/CTestTestMemcheck/DummyValgrindFailPre/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 2.8.9) +project(CTestTestMemcheckDummyValgrindFailPre) +include(CTest) + +add_test (RunCMake "${CMAKE_COMMAND}") diff --git a/Tests/CTestTestMemcheck/DummyValgrindFailPre/CTestConfig.cmake b/Tests/CTestTestMemcheck/DummyValgrindFailPre/CTestConfig.cmake new file mode 100644 index 0000000..4ca59a4 --- /dev/null +++ b/Tests/CTestTestMemcheck/DummyValgrindFailPre/CTestConfig.cmake @@ -0,0 +1,7 @@ +set (CTEST_PROJECT_NAME "CTestTestMemcheckDummyValgrind") +set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") +set (CTEST_DART_SERVER_VERSION "2") +set(CTEST_DROP_METHOD "http") +set(CTEST_DROP_SITE "www.cdash.org") +set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestMemcheck/DummyValgrindFailPre/test.cmake.in b/Tests/CTestTestMemcheck/DummyValgrindFailPre/test.cmake.in new file mode 100644 index 0000000..b2d7bb1 --- /dev/null +++ b/Tests/CTestTestMemcheck/DummyValgrindFailPre/test.cmake.in @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 2.8.9) + +# Settings: +set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckDummyValgrindFailPre") + +set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/DummyValgrindFailPre") +set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/DummyValgrindFailPre") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") + +set(CTEST_MEMORYCHECK_COMMAND "${PSEUDO_VALGRIND}") + +set(CTEST_CUSTOM_PRE_MEMCHECK "${ERROR_COMMAND}") + +#CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) + +CTEST_START(Experimental) +CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +#CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/CMakeLists.txt b/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/CMakeLists.txt new file mode 100644 index 0000000..5d437d1 --- /dev/null +++ b/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 2.8.9) +project(CTestTestMemcheckDummyValgrindIgnoreMemcheck) +include(CTest) + +add_test (RunCMake "${CMAKE_COMMAND}") +add_test (RunCMakeAgain "${CMAKE_COMMAND}") diff --git a/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/CTestConfig.cmake b/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/CTestConfig.cmake new file mode 100644 index 0000000..6eee3e6 --- /dev/null +++ b/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/CTestConfig.cmake @@ -0,0 +1,9 @@ +set (CTEST_PROJECT_NAME "CTestTestMemcheckDummyValgrindIgnoreMemcheck") +set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") +set (CTEST_DART_SERVER_VERSION "2") +set(CTEST_DROP_METHOD "http") +set(CTEST_DROP_SITE "www.cdash.org") +set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE_CDASH TRUE) + +set(CTEST_CUSTOM_MEMCHECK_IGNORE RunCMakeAgain) diff --git a/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/test.cmake.in b/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/test.cmake.in new file mode 100644 index 0000000..031a232 --- /dev/null +++ b/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/test.cmake.in @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 2.8.9) + +# Settings: +set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckDummyValgrindIgnoreMemcheck") + +set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/DummyValgrindIgnoreMemcheck") +set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/DummyValgrindIgnoreMemcheck") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") + +set(CTEST_MEMORYCHECK_COMMAND "${PSEUDO_VALGRIND}") + +#CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) + +CTEST_START(Experimental) +CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +#CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestMemcheck/DummyValgrindPrePost/CMakeLists.txt b/Tests/CTestTestMemcheck/DummyValgrindPrePost/CMakeLists.txt new file mode 100644 index 0000000..bc15632 --- /dev/null +++ b/Tests/CTestTestMemcheck/DummyValgrindPrePost/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 2.8.9) +project(CTestTestMemcheckDummyValgrindPrePost) +include(CTest) + +add_test (RunCMake "${CMAKE_COMMAND}") diff --git a/Tests/CTestTestMemcheck/DummyValgrindPrePost/CTestConfig.cmake b/Tests/CTestTestMemcheck/DummyValgrindPrePost/CTestConfig.cmake new file mode 100644 index 0000000..6e4c2e8 --- /dev/null +++ b/Tests/CTestTestMemcheck/DummyValgrindPrePost/CTestConfig.cmake @@ -0,0 +1,7 @@ +set (CTEST_PROJECT_NAME "CTestTestMemcheckDummyValgrindPrePost") +set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") +set (CTEST_DART_SERVER_VERSION "2") +set(CTEST_DROP_METHOD "http") +set(CTEST_DROP_SITE "www.cdash.org") +set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestMemcheck/DummyValgrindPrePost/test.cmake.in b/Tests/CTestTestMemcheck/DummyValgrindPrePost/test.cmake.in new file mode 100644 index 0000000..44c416e --- /dev/null +++ b/Tests/CTestTestMemcheck/DummyValgrindPrePost/test.cmake.in @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 2.8.9) + +# Settings: +set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckDummyValgrindPrePost") + +set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/DummyValgrindPrePost") +set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/DummyValgrindPrePost") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") + +set(CTEST_MEMORYCHECK_COMMAND "${PSEUDO_VALGRIND}") + +set(CTEST_CUSTOM_PRE_MEMCHECK "${CTEST_MEMORYCHECK_COMMAND}") +set(CTEST_CUSTOM_POST_MEMCHECK "${CTEST_MEMORYCHECK_COMMAND}") + +#CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) + +CTEST_START(Experimental) +CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +#CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestMemcheck/NotExist/CMakeLists.txt b/Tests/CTestTestMemcheck/NotExist/CMakeLists.txt new file mode 100644 index 0000000..4d905de --- /dev/null +++ b/Tests/CTestTestMemcheck/NotExist/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 2.8.9) +project(CTestTestMemcheckNotExist) +include(CTest) + +add_test (RunCMake "${CMAKE_COMMAND}") diff --git a/Tests/CTestTestMemcheck/NotExist/CTestConfig.cmake b/Tests/CTestTestMemcheck/NotExist/CTestConfig.cmake new file mode 100644 index 0000000..3ed84aa --- /dev/null +++ b/Tests/CTestTestMemcheck/NotExist/CTestConfig.cmake @@ -0,0 +1,7 @@ +set (CTEST_PROJECT_NAME "CTestTestMemcheckUnknown") +set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") +set (CTEST_DART_SERVER_VERSION "2") +set(CTEST_DROP_METHOD "http") +set(CTEST_DROP_SITE "www.cdash.org") +set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestMemcheck/NotExist/test.cmake.in b/Tests/CTestTestMemcheck/NotExist/test.cmake.in new file mode 100644 index 0000000..78db7e2 --- /dev/null +++ b/Tests/CTestTestMemcheck/NotExist/test.cmake.in @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 2.8.9) + +# Settings: +set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckNotExist") + +set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/NotExist") +set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/NotExist") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_MEMORYCHECK_COMMAND "${CTEST_BINARY_DIRECTORY}/no-memcheck-exe") + +CTEST_START(Experimental) +CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestMemcheck/Unknown/CMakeLists.txt b/Tests/CTestTestMemcheck/Unknown/CMakeLists.txt new file mode 100644 index 0000000..3fd3103 --- /dev/null +++ b/Tests/CTestTestMemcheck/Unknown/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 2.8.9) +project(CTestTestMemcheckUnknown) +include(CTest) + +add_test (RunCMake "${CMAKE_COMMAND}") diff --git a/Tests/CTestTestMemcheck/Unknown/CTestConfig.cmake b/Tests/CTestTestMemcheck/Unknown/CTestConfig.cmake new file mode 100644 index 0000000..3ed84aa --- /dev/null +++ b/Tests/CTestTestMemcheck/Unknown/CTestConfig.cmake @@ -0,0 +1,7 @@ +set (CTEST_PROJECT_NAME "CTestTestMemcheckUnknown") +set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") +set (CTEST_DART_SERVER_VERSION "2") +set(CTEST_DROP_METHOD "http") +set(CTEST_DROP_SITE "www.cdash.org") +set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestMemcheck/Unknown/test.cmake.in b/Tests/CTestTestMemcheck/Unknown/test.cmake.in new file mode 100644 index 0000000..c0b7839 --- /dev/null +++ b/Tests/CTestTestMemcheck/Unknown/test.cmake.in @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 2.8.9) + +# Settings: +set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckUnknown") + +set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/Unknown") +set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/Unknown") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_MEMORYCHECK_COMMAND "@CMAKE_COMMAND@") + +CTEST_START(Experimental) +CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestMemcheck/UnknownQuoted/CMakeLists.txt b/Tests/CTestTestMemcheck/UnknownQuoted/CMakeLists.txt new file mode 100644 index 0000000..6f49c61 --- /dev/null +++ b/Tests/CTestTestMemcheck/UnknownQuoted/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 2.8.9) +project(CTestTestMemcheckUnknownQuoted) +include(CTest) + +add_test (RunCMake "\"${CMAKE_COMMAND}\"") diff --git a/Tests/CTestTestMemcheck/UnknownQuoted/CTestConfig.cmake b/Tests/CTestTestMemcheck/UnknownQuoted/CTestConfig.cmake new file mode 100644 index 0000000..f0233a7 --- /dev/null +++ b/Tests/CTestTestMemcheck/UnknownQuoted/CTestConfig.cmake @@ -0,0 +1,7 @@ +set (CTEST_PROJECT_NAME "CTestTestMemcheckUnknownQuoted") +set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") +set (CTEST_DART_SERVER_VERSION "2") +set(CTEST_DROP_METHOD "http") +set(CTEST_DROP_SITE "www.cdash.org") +set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestMemcheck/UnknownQuoted/test.cmake.in b/Tests/CTestTestMemcheck/UnknownQuoted/test.cmake.in new file mode 100644 index 0000000..e2bfb60 --- /dev/null +++ b/Tests/CTestTestMemcheck/UnknownQuoted/test.cmake.in @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 2.8.9) + +# Settings: +set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckUnknownQuoted") + +set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/UnknownQuoted") +set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/UnknownQuoted") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_MEMORYCHECK_COMMAND "@CMAKE_COMMAND@") + +CTEST_START(Experimental) +CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CompileDefinitions/compiletest.cpp b/Tests/CompileDefinitions/compiletest.cpp index 6db6f3f..f18e59e 100644 --- a/Tests/CompileDefinitions/compiletest.cpp +++ b/Tests/CompileDefinitions/compiletest.cpp @@ -27,6 +27,24 @@ enum { #endif }; +#ifdef TEST_GENERATOR_EXPRESSIONS +#ifndef CMAKE_IS_DECLARATIVE +#error Expect declarative definition +#endif +#ifdef GE_NOT_DEFINED +#error Expect not defined generator expression +#endif + +#ifndef ARGUMENT +#error Expected define expanded from list +#endif +#ifndef LIST +#error Expected define expanded from list +#endif + +// TEST_GENERATOR_EXPRESSIONS +#endif + int main(int argc, char **argv) { return 0; diff --git a/Tests/CompileDefinitions/target_prop/CMakeLists.txt b/Tests/CompileDefinitions/target_prop/CMakeLists.txt index e2b6ba9..abdf257 100644 --- a/Tests/CompileDefinitions/target_prop/CMakeLists.txt +++ b/Tests/CompileDefinitions/target_prop/CMakeLists.txt @@ -7,3 +7,10 @@ set_target_properties(target_prop_executable PROPERTIES COMPILE_DEFINITIONS CMAK set_property(TARGET target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS CMAKE_IS_REALLY="Very Fun" CMAKE_IS=Fun) set_property(TARGET target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS CMAKE_IS_FUN CMAKE_IS_="Fun") + +set_property(TARGET target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS + TEST_GENERATOR_EXPRESSIONS + "$<1:CMAKE_IS_DECLARATIVE>" + "$<0:GE_NOT_DEFINED>" + "$<1:ARGUMENT;LIST>" +) diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt index f118c30..e19ab88 100644 --- a/Tests/ExportImport/Export/CMakeLists.txt +++ b/Tests/ExportImport/Export/CMakeLists.txt @@ -87,6 +87,18 @@ target_link_libraries(testLibCycleA testLibCycleB) target_link_libraries(testLibCycleB testLibCycleA) set_property(TARGET testLibCycleA PROPERTY LINK_INTERFACE_MULTIPLICITY 3) +# Test exporting dependent libraries into different exports +add_library(testLibRequired testLibRequired.c) +add_library(testLibDepends testLibDepends.c) +target_link_libraries(testLibDepends testLibRequired) + +install(TARGETS testLibRequired EXPORT RequiredExp DESTINATION lib ) +install(EXPORT RequiredExp NAMESPACE Req:: FILE testLibRequiredConfig.cmake DESTINATION lib/cmake/testLibRequired) + +install(TARGETS testLibDepends EXPORT DependsExp DESTINATION lib ) +install(EXPORT DependsExp FILE testLibDependsConfig.cmake DESTINATION lib/cmake/testLibDepends) + + # Install and export from install tree. install( TARGETS diff --git a/Tests/ExportImport/Export/testLibDepends.c b/Tests/ExportImport/Export/testLibDepends.c new file mode 100644 index 0000000..2849b33 --- /dev/null +++ b/Tests/ExportImport/Export/testLibDepends.c @@ -0,0 +1,4 @@ + +extern int testLibRequired(void); + +int testLibDepends(void) { return testLibRequired(); } diff --git a/Tests/ExportImport/Export/testLibRequired.c b/Tests/ExportImport/Export/testLibRequired.c new file mode 100644 index 0000000..e126d44 --- /dev/null +++ b/Tests/ExportImport/Export/testLibRequired.c @@ -0,0 +1 @@ +int testLibRequired(void) { return 0; } diff --git a/Tests/ExportImport/Import/A/CMakeLists.txt b/Tests/ExportImport/Import/A/CMakeLists.txt index 650af6a..8841792 100644 --- a/Tests/ExportImport/Import/A/CMakeLists.txt +++ b/Tests/ExportImport/Import/A/CMakeLists.txt @@ -4,6 +4,10 @@ include(${Import_BINARY_DIR}/../Export/ExportBuildTree.cmake) # Import targets from the exported install tree. include(${CMAKE_INSTALL_PREFIX}/lib/exp/exp.cmake) +# Import two exports, where the Depends one depends on an exported target from the Required one: +include(${CMAKE_INSTALL_PREFIX}/lib/cmake/testLibRequired/testLibRequiredConfig.cmake) +include(${CMAKE_INSTALL_PREFIX}/lib/cmake/testLibDepends/testLibDependsConfig.cmake) + # Try referencing an executable imported from the install tree. add_custom_command( OUTPUT ${Import_BINARY_DIR}/exp_generated.c diff --git a/Tests/ExternalProject/CMakeLists.txt b/Tests/ExternalProject/CMakeLists.txt index 33ffe2e..3f8e827 100644 --- a/Tests/ExternalProject/CMakeLists.txt +++ b/Tests/ExternalProject/CMakeLists.txt @@ -189,7 +189,7 @@ set_property(TARGET ${proj} PROPERTY FOLDER "Local/TGZ") set(proj TutorialStep1-LocalNoDirTGZ) ExternalProject_Add(${proj} URL "${CMAKE_CURRENT_SOURCE_DIR}/Step1NoDir.tgz" - URL_MD5 0b8182edcecdf40bf1c9d71d7d259f78 + URL_HASH SHA256=496229e2a5ed620a37c385ad9406004a18026beab8b55dd2c4565d4b7f1d5383 CMAKE_GENERATOR "${CMAKE_GENERATOR}" CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> INSTALL_COMMAND "" diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt index 2b135dc..3a92d81 100644 --- a/Tests/GeneratorExpression/CMakeLists.txt +++ b/Tests/GeneratorExpression/CMakeLists.txt @@ -4,7 +4,9 @@ project(GeneratorExpression NONE) add_custom_target(check ALL COMMAND ${CMAKE_COMMAND} -Dtest_0=$<0:nothing> + -Dtest_0_with_comma=$<0:-Wl,--no-undefined> -Dtest_1=$<1:content> + -Dtest_1_with_comma=$<1:-Wl,--no-undefined> -Dconfig=$<CONFIGURATION> -Dtest_and_0=$<AND:0> -Dtest_and_0_0=$<AND:0,0> @@ -12,8 +14,15 @@ add_custom_target(check ALL -Dtest_and_1=$<AND:1> -Dtest_and_1_0=$<AND:1,0> -Dtest_and_1_1=$<AND:1,1> + # Ordinarily, the 'invalidcontent' would cause an error, but + # the '0' makes the AND abort early. + -Dtest_and_0_invalidcontent=$<AND:0,invalidcontent> -Dtest_config_0=$<CONFIG:$<CONFIGURATION>x> -Dtest_config_1=$<CONFIG:$<CONFIGURATION>> + -Dtest_config_debug=$<CONFIG:Debug>$<CONFIG:DEBUG>$<CONFIG:DeBuG> + -Dtest_config_release=$<CONFIG:Release>$<CONFIG:RELEASE>$<CONFIG:ReLeAsE> + -Dtest_config_relwithdebinfo=$<CONFIG:RelWithDebInfo>$<CONFIG:RELWITHDEBINFO>$<CONFIG:relwithdebinfo> + -Dtest_config_minsizerel=$<CONFIG:MinSizeRel>$<CONFIG:MINSIZEREL>$<CONFIG:minsizerel> -Dtest_not_0=$<NOT:0> -Dtest_not_1=$<NOT:1> -Dtest_or_0=$<OR:0> @@ -22,6 +31,53 @@ add_custom_target(check ALL -Dtest_or_1=$<OR:1> -Dtest_or_1_0=$<OR:1,0> -Dtest_or_1_1=$<OR:1,1> + -Dtest_or_1_invalidcontent=$<OR:1,invalidcontent> + -Dtest_bool_notfound=$<BOOL:NOTFOUND> + -Dtest_bool_foo_notfound=$<BOOL:Foo-NOTFOUND> + -Dtest_bool_true=$<BOOL:True> + -Dtest_bool_false=$<BOOL:False> + -Dtest_bool_on=$<BOOL:On> + -Dtest_bool_off=$<BOOL:Off> + -Dtest_bool_no=$<BOOL:No> + -Dtest_bool_n=$<BOOL:N> + -Dtest_bool_empty=$<BOOL:> + -Dtest_strequal_yes_yes=$<STREQUAL:Yes,Yes> + -Dtest_strequal_yes_yes_cs=$<STREQUAL:Yes,yes> + -Dtest_strequal_yes_no=$<STREQUAL:Yes,No> + -Dtest_strequal_no_yes=$<STREQUAL:No,Yes> + -Dtest_strequal_angle_r=$<STREQUAL:$<ANGLE-R>,$<ANGLE-R>> + -Dtest_strequal_comma=$<STREQUAL:$<COMMA>,$<COMMA>> + -Dtest_strequal_angle_r_comma=$<STREQUAL:$<ANGLE-R>,$<COMMA>> + -Dtest_strequal_both_empty=$<STREQUAL:,> + -Dtest_strequal_one_empty=$<STREQUAL:something,> + -Dtest_angle_r=$<ANGLE-R> + -Dtest_comma=$<COMMA> + -Dtest_colons_1=$<1::> + -Dtest_colons_2=$<1:::> + -Dtest_colons_3=$<1:Qt5::Core> + -Dtest_colons_4=$<1:C:\\CMake> + -Dtest_colons_5=$<1:C:/CMake> + -Dtest_incomplete_1=$< + -Dtest_incomplete_2=$<something + -Dtest_incomplete_3=$<something: + -Dtest_incomplete_4=$<something:, + -Dtest_incomplete_5=$something:,> + -Dtest_incomplete_6=<something:,> + -Dtest_incomplete_7=$<something:: + -Dtest_incomplete_8=$<something:, + -Dtest_incomplete_9=$<something:,, + -Dtest_incomplete_10=$<something:,: + -Dtest_incomplete_11=$<something,, + -Dtest_incomplete_12=$<,, + -Dtest_incomplete_13=$<some$<1:special>thing + -Dtest_incomplete_14=$<$<ANGLE-R> + -Dtest_incomplete_15=$<some$<thing + -Dtest_incomplete_16=$<BOOL:something + -Dtest_incomplete_17=$<1:some$thing> + -Dtest_incomplete_18=$<1:some,thing + -Dtest_incomplete_19=$<1:some,thing$<ANGLE-R> + -Dtest_incomplete_20=$<CONFIGURATION$<ANGLE-R> + -Dtest_incomplete_21=$<BOOL:something$<ANGLE-R> -P ${CMAKE_CURRENT_SOURCE_DIR}/check.cmake COMMAND ${CMAKE_COMMAND} -E echo "check done" VERBATIM diff --git a/Tests/GeneratorExpression/check.cmake b/Tests/GeneratorExpression/check.cmake index e243d85..af436de 100644 --- a/Tests/GeneratorExpression/check.cmake +++ b/Tests/GeneratorExpression/check.cmake @@ -6,15 +6,23 @@ endmacro() message(STATUS "config=[${config}]") check(test_0 "") +check(test_0_with_comma "") check(test_1 "content") +check(test_1_with_comma "-Wl,--no-undefined") check(test_and_0 "0") check(test_and_0_0 "0") check(test_and_0_1 "0") check(test_and_1 "1") check(test_and_1_0 "0") check(test_and_1_1 "1") +check(test_and_0_invalidcontent "0") check(test_config_0 "0") check(test_config_1 "1") +foreach(c debug release relwithdebinfo minsizerel) + if(NOT "${test_config_${c}}" MATCHES "^(0+|1+)$") + message(SEND_ERROR "test_config_${c} is \"${test_config_${c}}\", not all 0 or all 1") + endif() +endforeach() check(test_not_0 "1") check(test_not_1 "0") check(test_or_0 "0") @@ -23,3 +31,50 @@ check(test_or_0_1 "1") check(test_or_1 "1") check(test_or_1_0 "1") check(test_or_1_1 "1") +check(test_or_1_invalidcontent "1") +check(test_bool_notfound "0") +check(test_bool_foo_notfound "0") +check(test_bool_true "1") +check(test_bool_false "0") +check(test_bool_on "1") +check(test_bool_off "0") +check(test_bool_no "0") +check(test_bool_n "0") +check(test_bool_empty "0") +check(test_strequal_yes_yes "1") +check(test_strequal_yes_yes_cs "0") +check(test_strequal_yes_no "0") +check(test_strequal_no_yes "0") +check(test_strequal_angle_r "1") +check(test_strequal_comma "1") +check(test_strequal_angle_r_comma "0") +check(test_strequal_both_empty "1") +check(test_strequal_one_empty "0") +check(test_angle_r ">") +check(test_comma ",") +check(test_colons_1 ":") +check(test_colons_2 "::") +check(test_colons_3 "Qt5::Core") +check(test_colons_4 "C:\\\\CMake") +check(test_colons_5 "C:/CMake") +check(test_incomplete_1 "$<") +check(test_incomplete_2 "$<something") +check(test_incomplete_3 "$<something:") +check(test_incomplete_4 "$<something:,") +check(test_incomplete_5 "$something:,>") +check(test_incomplete_6 "<something:,>") +check(test_incomplete_7 "$<something::") +check(test_incomplete_8 "$<something:,") +check(test_incomplete_9 "$<something:,,") +check(test_incomplete_10 "$<something:,:") +check(test_incomplete_11 "$<something,,") +check(test_incomplete_12 "$<,,") +check(test_incomplete_13 "$<somespecialthing") +check(test_incomplete_14 "$<>") +check(test_incomplete_15 "$<some$<thing") +check(test_incomplete_16 "$<BOOL:something") +check(test_incomplete_17 "some$thing") +check(test_incomplete_18 "$<1:some,thing") +check(test_incomplete_19 "$<1:some,thing>") +check(test_incomplete_20 "$<CONFIGURATION>") +check(test_incomplete_21 "$<BOOL:something>") diff --git a/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt index 334b8be..7cb1b42 100644 --- a/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt +++ b/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt @@ -12,13 +12,36 @@ create_header(bar) create_header(bat) create_header(foo) create_header(baz) +create_header(bang) +create_header(bing) +create_header(bung) +create_header(arguments) +create_header(list) +create_header(target) set(CMAKE_INCLUDE_CURRENT_DIR ON) include_directories("${CMAKE_CURRENT_BINARY_DIR}/bar") +include_directories("$<1:${CMAKE_CURRENT_BINARY_DIR}/bang>") add_executable(TargetIncludeDirectories main.cpp) + set_property(TARGET TargetIncludeDirectories APPEND PROPERTY INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/bat") set_property(TARGET TargetIncludeDirectories APPEND PROPERTY INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/foo") +set_property(TARGET TargetIncludeDirectories APPEND PROPERTY + INCLUDE_DIRECTORIES "$<1:${CMAKE_CURRENT_BINARY_DIR}/bing>") include_directories("${CMAKE_CURRENT_BINARY_DIR}/baz") +include_directories("$<1:${CMAKE_CURRENT_BINARY_DIR}/bung>") +include_directories("sing$<1:/ting>") + +include_directories("$<1:${CMAKE_CURRENT_BINARY_DIR}/arguments;${CMAKE_CURRENT_BINARY_DIR}/list>") + +add_library(somelib::withcolons UNKNOWN IMPORTED) +set_property(TARGET somelib::withcolons PROPERTY IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/target") +set_property(TARGET somelib::withcolons PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/target") + +set_property(TARGET TargetIncludeDirectories + APPEND PROPERTY INCLUDE_DIRECTORIES + "$<TARGET_PROPERTY:somelib::withcolons,INTERFACE_INCLUDE_DIRECTORIES>" +) diff --git a/Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp b/Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp index 8aa3532..90909d3 100644 --- a/Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp +++ b/Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp @@ -3,6 +3,13 @@ #include "bat.h" #include "foo.h" #include "baz.h" +#include "bang.h" +#include "bing.h" +#include "bung.h" +#include "ting.h" +#include "arguments.h" +#include "list.h" +#include "target.h" int main(int, char**) { diff --git a/Tests/IncludeDirectories/TargetIncludeDirectories/sing/ting/ting.h b/Tests/IncludeDirectories/TargetIncludeDirectories/sing/ting/ting.h new file mode 100644 index 0000000..4fe01dd --- /dev/null +++ b/Tests/IncludeDirectories/TargetIncludeDirectories/sing/ting/ting.h @@ -0,0 +1 @@ +//ting.h diff --git a/Tests/PDBDirectoryAndName/CMakeLists.txt b/Tests/PDBDirectoryAndName/CMakeLists.txt new file mode 100644 index 0000000..bc2f013 --- /dev/null +++ b/Tests/PDBDirectoryAndName/CMakeLists.txt @@ -0,0 +1,79 @@ +cmake_minimum_required(VERSION 2.8) +project(PDBDirectoryAndName C) + +# Make sure the proper compiler is in use. +if(NOT MSVC AND NOT "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$") + message(FATAL_ERROR "The PDBDirectoryAndName test works only with MSVC or Intel") +endif() + +set(my_targets "") + +add_library(mylibA SHARED mylibA.c) +set_target_properties(mylibA PROPERTIES + PDB_NAME "mylibA_Special" + PDB_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/mylibA_PDB" +) +list(APPEND my_targets mylibA) + +add_library(mylibB STATIC mylibB.c) +set_target_properties(mylibB PROPERTIES + PDB_NAME "mylibB_Special" + PDB_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/mylibB_PDB" +) +list(APPEND my_targets mylibB) + +add_library(mylibC SHARED mylibC.c) +set_target_properties(mylibC PROPERTIES + PDB_NAME "mylibC_Special" +) +list(APPEND my_targets mylibC) + +add_library(mylibD STATIC mylibD.c) +set_target_properties(mylibD PROPERTIES + PDB_NAME "mylibD_Special" +) +list(APPEND my_targets mylibD) + +add_executable(myexe myexe.c) +set_target_properties(myexe PROPERTIES + PDB_NAME "myexe_Special" + PDB_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/myexe_PDB" +) +list(APPEND my_targets myexe) + +target_link_libraries(myexe mylibA mylibB mylibC mylibD) + +add_executable(myexe2 myexe2.c) +set_target_properties(myexe2 PROPERTIES + PDB_NAME "myexe2_Special" +) +list(APPEND my_targets myexe2) + +target_link_libraries(myexe2 mylibA mylibD) + +#----------------------------------------------------------------------------- +# Check that PDB files actually appear where expected. + +# The PDB_NAME and PDB_OUTPUT_DIRECTORY options do not work in VS 6. +if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6") + return() +endif() +# PDB output not fully implemented for Intel +if("${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$") + return() +endif() + +set(pdbs "") +foreach(t ${my_targets}) + get_property(pdb_name TARGET ${t} PROPERTY PDB_NAME) + get_property(pdb_dir TARGET ${t} PROPERTY PDB_OUTPUT_DIRECTORY) + if(NOT pdb_dir) + set(pdb_dir ${CMAKE_CURRENT_BINARY_DIR}) + endif() + list(APPEND pdbs ${pdb_dir}/${CMAKE_CFG_INTDIR}/${pdb_name}.pdb) +endforeach() +add_custom_target(check_pdbs ALL VERBATIM + COMMAND ${CMAKE_COMMAND} -Dconfig=$<CONFIGURATION> "-Dpdbs=${pdbs}" + -P ${CMAKE_CURRENT_SOURCE_DIR}/check_pdbs.cmake + ) +add_dependencies(check_pdbs ${my_targets}) diff --git a/Tests/PDBDirectoryAndName/check_pdbs.cmake b/Tests/PDBDirectoryAndName/check_pdbs.cmake new file mode 100644 index 0000000..89cdb3c --- /dev/null +++ b/Tests/PDBDirectoryAndName/check_pdbs.cmake @@ -0,0 +1,10 @@ +if(NOT "${config}" MATCHES "[Dd][Ee][Bb]") + return() +endif() +foreach(pdb ${pdbs}) + if(EXISTS "${pdb}") + message(STATUS "PDB Exists: ${pdb}") + else() + message(SEND_ERROR "PDB MISSING: ${pdb}") + endif() +endforeach() diff --git a/Tests/PDBDirectoryAndName/myexe.c b/Tests/PDBDirectoryAndName/myexe.c new file mode 100644 index 0000000..c6d9065 --- /dev/null +++ b/Tests/PDBDirectoryAndName/myexe.c @@ -0,0 +1,5 @@ +extern int mylibA(); +extern int mylibB(); +extern int mylibC(); +extern int mylibD(); +int main() { return mylibA() + mylibB() + mylibC() + mylibD(); } diff --git a/Tests/PDBDirectoryAndName/myexe2.c b/Tests/PDBDirectoryAndName/myexe2.c new file mode 100644 index 0000000..75b39cd --- /dev/null +++ b/Tests/PDBDirectoryAndName/myexe2.c @@ -0,0 +1,3 @@ +extern int mylibA(); +extern int mylibD(); +int main() { return mylibA() + mylibD(); } diff --git a/Tests/PDBDirectoryAndName/mylibA.c b/Tests/PDBDirectoryAndName/mylibA.c new file mode 100644 index 0000000..f4c553f --- /dev/null +++ b/Tests/PDBDirectoryAndName/mylibA.c @@ -0,0 +1 @@ +__declspec(dllexport) int mylibA() { return 1; } diff --git a/Tests/PDBDirectoryAndName/mylibB.c b/Tests/PDBDirectoryAndName/mylibB.c new file mode 100644 index 0000000..2040c67 --- /dev/null +++ b/Tests/PDBDirectoryAndName/mylibB.c @@ -0,0 +1 @@ +int mylibB() { return -1; } diff --git a/Tests/PDBDirectoryAndName/mylibC.c b/Tests/PDBDirectoryAndName/mylibC.c new file mode 100644 index 0000000..adf7c70 --- /dev/null +++ b/Tests/PDBDirectoryAndName/mylibC.c @@ -0,0 +1 @@ +__declspec(dllexport) int mylibC() { return 1; } diff --git a/Tests/PDBDirectoryAndName/mylibD.c b/Tests/PDBDirectoryAndName/mylibD.c new file mode 100644 index 0000000..efa8a82 --- /dev/null +++ b/Tests/PDBDirectoryAndName/mylibD.c @@ -0,0 +1 @@ +int mylibD() { return -1; } diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index a484983..360ad78 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -46,12 +46,14 @@ macro(add_RunCMake_test test) endmacro() add_RunCMake_test(GeneratorExpression) +add_RunCMake_test(TargetPropertyGeneratorExpressions) add_RunCMake_test(Languages) add_RunCMake_test(ObjectLibrary) add_RunCMake_test(build_command) add_RunCMake_test(find_package) add_RunCMake_test(include) +add_RunCMake_test(include_directories) add_RunCMake_test(list) add_RunCMake_test(load_command) diff --git a/Tests/RunCMake/GeneratorExpression/BadAND-stderr.txt b/Tests/RunCMake/GeneratorExpression/BadAND-stderr.txt index ced21d8..0e48ba4 100644 --- a/Tests/RunCMake/GeneratorExpression/BadAND-stderr.txt +++ b/Tests/RunCMake/GeneratorExpression/BadAND-stderr.txt @@ -1,9 +1,18 @@ CMake Error at BadAND.cmake:1 \(add_custom_target\): Error evaluating generator expression: + \$<AND> + + \$<AND> expression requires at least one parameter. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at BadAND.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + \$<AND:> - AND requires one or more comma-separated '0' or '1' values. + Parameters to \$<AND> must resolve to either '0' or '1'. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) + @@ -12,6 +21,33 @@ CMake Error at BadAND.cmake:1 \(add_custom_target\): \$<AND:,> - AND requires one or more comma-separated '0' or '1' values. + Parameters to \$<AND> must resolve to either '0' or '1'. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at BadAND.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<AND:01> + + Parameters to \$<AND> must resolve to either '0' or '1'. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at BadAND.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<AND:nothing> + + Parameters to \$<AND> must resolve to either '0' or '1'. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at BadAND.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<AND:1,nothing> + + Parameters to \$<AND> must resolve to either '0' or '1'. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/GeneratorExpression/BadAND.cmake b/Tests/RunCMake/GeneratorExpression/BadAND.cmake index 7926540..8a7993f 100644 --- a/Tests/RunCMake/GeneratorExpression/BadAND.cmake +++ b/Tests/RunCMake/GeneratorExpression/BadAND.cmake @@ -1,4 +1,8 @@ add_custom_target(check ALL COMMAND check + $<AND> $<AND:> $<AND:,> + $<AND:01> + $<AND:nothing> + $<AND:1,nothing> VERBATIM) diff --git a/Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt b/Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt index 7c86b25..1cfbf40 100644 --- a/Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt +++ b/Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt @@ -1,8 +1,44 @@ CMake Error at BadCONFIG.cmake:1 \(add_custom_target\): Error evaluating generator expression: + \$<CONFIG> + + \$<CONFIG> expression requires exactly one parameter. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at BadCONFIG.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + \$<CONFIG:.> Expression syntax not recognized. Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at BadCONFIG.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<CONFIG:Foo,Bar> + + \$<CONFIG> expression requires exactly one parameter. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at BadCONFIG.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<CONFIG:Foo-Bar> + + Expression syntax not recognized. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at BadCONFIG.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<CONFIG:Foo-Nested> + + Expression syntax not recognized. +Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/GeneratorExpression/BadCONFIG.cmake b/Tests/RunCMake/GeneratorExpression/BadCONFIG.cmake index 0c13f89..c27ea5f 100644 --- a/Tests/RunCMake/GeneratorExpression/BadCONFIG.cmake +++ b/Tests/RunCMake/GeneratorExpression/BadCONFIG.cmake @@ -1,3 +1,7 @@ add_custom_target(check ALL COMMAND check + $<CONFIG> $<CONFIG:.> + $<CONFIG:Foo,Bar> + $<CONFIG:Foo-Bar> + $<$<CONFIG:Foo-Nested>:foo> VERBATIM) diff --git a/Tests/RunCMake/GeneratorExpression/BadNOT-stderr.txt b/Tests/RunCMake/GeneratorExpression/BadNOT-stderr.txt index 5721f5f..e5e628c 100644 --- a/Tests/RunCMake/GeneratorExpression/BadNOT-stderr.txt +++ b/Tests/RunCMake/GeneratorExpression/BadNOT-stderr.txt @@ -1,9 +1,17 @@ CMake Error at BadNOT.cmake:1 \(add_custom_target\): Error evaluating generator expression: + \$<NOT> + + \$<NOT> expression requires exactly one parameter. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++CMake Error at BadNOT.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + \$<NOT:> - NOT requires exactly one '0' or '1' value. + \$<NOT> parameter must resolve to exactly one '0' or '1' value. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) + @@ -12,7 +20,7 @@ CMake Error at BadNOT.cmake:1 \(add_custom_target\): \$<NOT:,> - NOT requires exactly one '0' or '1' value. + \$<NOT> expression requires exactly one parameter. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) + @@ -21,6 +29,24 @@ CMake Error at BadNOT.cmake:1 \(add_custom_target\): \$<NOT:0,1> - NOT requires exactly one '0' or '1' value. + \$<NOT> expression requires exactly one parameter. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at BadNOT.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<NOT:01> + + \$<NOT> parameter must resolve to exactly one '0' or '1' value. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at BadNOT.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<NOT:nothing> + + \$<NOT> parameter must resolve to exactly one '0' or '1' value. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/GeneratorExpression/BadNOT.cmake b/Tests/RunCMake/GeneratorExpression/BadNOT.cmake index 452293b..c2dada3 100644 --- a/Tests/RunCMake/GeneratorExpression/BadNOT.cmake +++ b/Tests/RunCMake/GeneratorExpression/BadNOT.cmake @@ -1,5 +1,8 @@ add_custom_target(check ALL COMMAND check + $<NOT> $<NOT:> $<NOT:,> $<NOT:0,1> + $<NOT:01> + $<NOT:nothing> VERBATIM) diff --git a/Tests/RunCMake/GeneratorExpression/BadOR-stderr.txt b/Tests/RunCMake/GeneratorExpression/BadOR-stderr.txt index 72ef2dd..eb26328 100644 --- a/Tests/RunCMake/GeneratorExpression/BadOR-stderr.txt +++ b/Tests/RunCMake/GeneratorExpression/BadOR-stderr.txt @@ -1,9 +1,18 @@ CMake Error at BadOR.cmake:1 \(add_custom_target\): Error evaluating generator expression: + \$<OR> + + \$<OR> expression requires at least one parameter. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at BadOR.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + \$<OR:> - OR requires one or more comma-separated '0' or '1' values. + Parameters to \$<OR> must resolve to either '0' or '1'. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) + @@ -12,6 +21,33 @@ CMake Error at BadOR.cmake:1 \(add_custom_target\): \$<OR:,> - OR requires one or more comma-separated '0' or '1' values. + Parameters to \$<OR> must resolve to either '0' or '1'. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at BadOR.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<OR:01> + + Parameters to \$<OR> must resolve to either '0' or '1'. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at BadOR.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<OR:nothing> + + Parameters to \$<OR> must resolve to either '0' or '1'. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at BadOR.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<OR:0,nothing> + + Parameters to \$<OR> must resolve to either '0' or '1'. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/GeneratorExpression/BadOR.cmake b/Tests/RunCMake/GeneratorExpression/BadOR.cmake index f16f56a..c0309da 100644 --- a/Tests/RunCMake/GeneratorExpression/BadOR.cmake +++ b/Tests/RunCMake/GeneratorExpression/BadOR.cmake @@ -1,4 +1,8 @@ add_custom_target(check ALL COMMAND check + $<OR> $<OR:> $<OR:,> + $<OR:01> + $<OR:nothing> + $<OR:0,nothing> VERBATIM) diff --git a/Tests/RunCMake/GeneratorExpression/BadStrEqual-result.txt b/Tests/RunCMake/GeneratorExpression/BadStrEqual-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/BadStrEqual-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorExpression/BadStrEqual-stderr.txt b/Tests/RunCMake/GeneratorExpression/BadStrEqual-stderr.txt new file mode 100644 index 0000000..dd0d931 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/BadStrEqual-stderr.txt @@ -0,0 +1,38 @@ +CMake Error at BadStrEqual.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<STREQUAL> + + \$<STREQUAL> expression requires 2 comma separated parameters, but got 0 + instead. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++CMake Error at BadStrEqual.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<STREQUAL:> + + \$<STREQUAL> expression requires 2 comma separated parameters, but got 1 + instead. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at BadStrEqual.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<STREQUAL:,,> + + \$<STREQUAL> expression requires 2 comma separated parameters, but got 3 + instead. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at BadStrEqual.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<STREQUAL:something,,> + + \$<STREQUAL> expression requires 2 comma separated parameters, but got 3 + instead. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/GeneratorExpression/BadStrEqual.cmake b/Tests/RunCMake/GeneratorExpression/BadStrEqual.cmake new file mode 100644 index 0000000..56eb458 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/BadStrEqual.cmake @@ -0,0 +1,6 @@ +add_custom_target(check ALL COMMAND check + $<STREQUAL> + $<STREQUAL:> + $<STREQUAL:,,> + $<STREQUAL:something,,> + VERBATIM) diff --git a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake index ed18f25..18a47ae 100644 --- a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake +++ b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake @@ -4,3 +4,4 @@ run_cmake(BadCONFIG) run_cmake(BadOR) run_cmake(BadAND) run_cmake(BadNOT) +run_cmake(BadStrEqual) diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName1-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName1-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName1-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName1-stderr.txt new file mode 100644 index 0000000..3287d19 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName1-stderr.txt @@ -0,0 +1,6 @@ +CMake Error: + Error evaluating generator expression: + + \$<TARGET_PROPERTY:Invali/dTarget,INCLUDE_DIRECTORIES> + + Target name not supported. diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName1.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName1.cmake new file mode 100644 index 0000000..d5f661d --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName1.cmake @@ -0,0 +1,7 @@ + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" + "int main(int, char **) { return 0; }\n") + +add_executable(TargetPropertyGeneratorExpressions + "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") +include_directories("$<TARGET_PROPERTY:Invali/dTarget,INCLUDE_DIRECTORIES>") diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName2-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName2-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName2-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName2-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName2-stderr.txt new file mode 100644 index 0000000..e527e22 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName2-stderr.txt @@ -0,0 +1,6 @@ +CMake Error: + Error evaluating generator expression: + + \$<TARGET_PROPERTY:Invali/dTarget,Invali/dProperty> + + Target name and property name not supported.$ diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName2.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName2.cmake new file mode 100644 index 0000000..6e4c1d0 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName2.cmake @@ -0,0 +1,7 @@ + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" + "int main(int, char **) { return 0; }\n") + +add_executable(TargetPropertyGeneratorExpressions + "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") +include_directories("$<TARGET_PROPERTY:Invali/dTarget,Invali/dProperty>") diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName3-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName3-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName3-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName3-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName3-stderr.txt new file mode 100644 index 0000000..517debb --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName3-stderr.txt @@ -0,0 +1,6 @@ +CMake Error: + Error evaluating generator expression: + + \$<TARGET_PROPERTY:Invali/dProperty> + + Property name not supported.$ diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName3.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName3.cmake new file mode 100644 index 0000000..3f75aa3 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName3.cmake @@ -0,0 +1,7 @@ + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" + "int main(int, char **) { return 0; }\n") + +add_executable(TargetPropertyGeneratorExpressions + "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") +include_directories("$<TARGET_PROPERTY:Invali/dProperty>") diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName4-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName4-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName4-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName4-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName4-stderr.txt new file mode 100644 index 0000000..eab6fb6 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName4-stderr.txt @@ -0,0 +1,6 @@ +CMake Error: + Error evaluating generator expression: + + \$<TARGET_PROPERTY:foo,Invali/dProperty> + + Property name not supported.$ diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName4.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName4.cmake new file mode 100644 index 0000000..b616c31 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName4.cmake @@ -0,0 +1,9 @@ + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" + "int main(int, char **) { return 0; }\n") + +add_executable(foo "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") + +add_executable(TargetPropertyGeneratorExpressions + "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") +include_directories("$<TARGET_PROPERTY:foo,Invali/dProperty>") diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName5-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName5-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName5-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName5-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName5-stderr.txt new file mode 100644 index 0000000..e2b4fc6 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName5-stderr.txt @@ -0,0 +1,7 @@ +CMake Error: + Error evaluating generator expression: + + \$<TARGET_PROPERTY:,> + + \$<TARGET_PROPERTY:tgt,prop> expression requires a non-empty target name and + property name. diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName5.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName5.cmake new file mode 100644 index 0000000..11cb6fa --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName5.cmake @@ -0,0 +1,7 @@ + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" + "int main(int, char **) { return 0; }\n") + +add_executable(TargetPropertyGeneratorExpressions + "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") +include_directories("$<TARGET_PROPERTY:,>") diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName6-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName6-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName6-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName6-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName6-stderr.txt new file mode 100644 index 0000000..e94f52f --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName6-stderr.txt @@ -0,0 +1,6 @@ +CMake Error: + Error evaluating generator expression: + + \$<TARGET_PROPERTY:,ValidProperty> + + \$<TARGET_PROPERTY:tgt,prop> expression requires a non-empty target name. diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName6.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName6.cmake new file mode 100644 index 0000000..bf868a5 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName6.cmake @@ -0,0 +1,7 @@ + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" + "int main(int, char **) { return 0; }\n") + +add_executable(TargetPropertyGeneratorExpressions + "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") +include_directories("$<TARGET_PROPERTY:,ValidProperty>") diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName7-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName7-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName7-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName7-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName7-stderr.txt new file mode 100644 index 0000000..2548215 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName7-stderr.txt @@ -0,0 +1,6 @@ +CMake Error: + Error evaluating generator expression: + + \$<TARGET_PROPERTY:foo,> + + \$<TARGET_PROPERTY:...> expression requires a non-empty property name. diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName7.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName7.cmake new file mode 100644 index 0000000..36d1a79 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName7.cmake @@ -0,0 +1,9 @@ + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" + "int main(int, char **) { return 0; }\n") + +add_executable(foo "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") + +add_executable(TargetPropertyGeneratorExpressions + "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") +include_directories("$<TARGET_PROPERTY:foo,>") diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName8-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName8-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName8-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName8-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName8-stderr.txt new file mode 100644 index 0000000..2a98f6f --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName8-stderr.txt @@ -0,0 +1,6 @@ +CMake Error: + Error evaluating generator expression: + + \$<TARGET_PROPERTY:> + + \$<TARGET_PROPERTY:...> expression requires a non-empty property name. diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName8.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName8.cmake new file mode 100644 index 0000000..f059288 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName8.cmake @@ -0,0 +1,7 @@ + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" + "int main(int, char **) { return 0; }\n") + +add_executable(TargetPropertyGeneratorExpressions + "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") +include_directories("$<TARGET_PROPERTY:>") diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget-stderr.txt new file mode 100644 index 0000000..d2ac7a9 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget-stderr.txt @@ -0,0 +1,6 @@ +CMake Error: + Error evaluating generator expression: + + \$<TARGET_PROPERTY:NonExistant,INCLUDE_DIRECTORIES> + + Target "NonExistant" not found.$ diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget.cmake new file mode 100644 index 0000000..b020c08 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget.cmake @@ -0,0 +1,7 @@ + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" + "int main(int, char **) { return 0; }\n") + +add_executable(TargetPropertyGeneratorExpressions + "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") +include_directories("$<TARGET_PROPERTY:NonExistant,INCLUDE_DIRECTORIES>") diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1-stderr.txt new file mode 100644 index 0000000..791c4a9 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1-stderr.txt @@ -0,0 +1,6 @@ +CMake Error: + Error evaluating generator expression: + + \$<TARGET_PROPERTY:INCLUDE_DIRECTORIES> + + Self reference on target "TargetPropertyGeneratorExpressions".$ diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1.cmake new file mode 100644 index 0000000..a85731e --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1.cmake @@ -0,0 +1,7 @@ + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" + "int main(int, char **) { return 0; }\n") + +add_executable(TargetPropertyGeneratorExpressions + "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") +include_directories("$<TARGET_PROPERTY:INCLUDE_DIRECTORIES>") diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2-stderr.txt new file mode 100644 index 0000000..791c4a9 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2-stderr.txt @@ -0,0 +1,6 @@ +CMake Error: + Error evaluating generator expression: + + \$<TARGET_PROPERTY:INCLUDE_DIRECTORIES> + + Self reference on target "TargetPropertyGeneratorExpressions".$ diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2.cmake new file mode 100644 index 0000000..f1459b8 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2.cmake @@ -0,0 +1,9 @@ + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" + "int main(int, char **) { return 0; }\n") + +add_executable(TargetPropertyGeneratorExpressions + "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") +set_property(TARGET TargetPropertyGeneratorExpressions PROPERTY + INCLUDE_DIRECTORIES "$<TARGET_PROPERTY:INCLUDE_DIRECTORIES>" +) diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3-stderr.txt new file mode 100644 index 0000000..f60d726 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3-stderr.txt @@ -0,0 +1,6 @@ +CMake Error: + Error evaluating generator expression: + + \$<TARGET_PROPERTY:TargetPropertyGeneratorExpressions,INCLUDE_DIRECTORIES> + + Self reference on target "TargetPropertyGeneratorExpressions".$ diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3.cmake new file mode 100644 index 0000000..433b730 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3.cmake @@ -0,0 +1,8 @@ + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" + "int main(int, char **) { return 0; }\n") + +add_executable(TargetPropertyGeneratorExpressions + "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") +include_directories( + "$<TARGET_PROPERTY:TargetPropertyGeneratorExpressions,INCLUDE_DIRECTORIES>") diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4-stderr.txt new file mode 100644 index 0000000..f60d726 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4-stderr.txt @@ -0,0 +1,6 @@ +CMake Error: + Error evaluating generator expression: + + \$<TARGET_PROPERTY:TargetPropertyGeneratorExpressions,INCLUDE_DIRECTORIES> + + Self reference on target "TargetPropertyGeneratorExpressions".$ diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4.cmake new file mode 100644 index 0000000..4b64459 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4.cmake @@ -0,0 +1,10 @@ + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" + "int main(int, char **) { return 0; }\n") + +add_executable(TargetPropertyGeneratorExpressions + "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") +set_property(TARGET TargetPropertyGeneratorExpressions PROPERTY +INCLUDE_DIRECTORIES + "$<TARGET_PROPERTY:TargetPropertyGeneratorExpressions,INCLUDE_DIRECTORIES>" +) diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5-stderr.txt new file mode 100644 index 0000000..2b22d0f --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5-stderr.txt @@ -0,0 +1,6 @@ +CMake Error: + Error evaluating generator expression: + + \$<TARGET_PROPERTY:COMPILE_DEFINITIONS> + + Self reference on target "TargetPropertyGeneratorExpressions".$ diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5.cmake new file mode 100644 index 0000000..74fff67 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5.cmake @@ -0,0 +1,10 @@ + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" + "int main(int, char **) { return 0; }\n") + +add_executable(TargetPropertyGeneratorExpressions + "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") +set_property(TARGET TargetPropertyGeneratorExpressions +PROPERTY + COMPILE_DEFINITIONS "$<TARGET_PROPERTY:COMPILE_DEFINITIONS>" +) diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6-stderr.txt new file mode 100644 index 0000000..fe7caa3 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6-stderr.txt @@ -0,0 +1,6 @@ +CMake Error: + Error evaluating generator expression: + + \$<TARGET_PROPERTY:TargetPropertyGeneratorExpressions,COMPILE_DEFINITIONS> + + Self reference on target "TargetPropertyGeneratorExpressions".$ diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6.cmake new file mode 100644 index 0000000..d6650d3 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6.cmake @@ -0,0 +1,10 @@ + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" + "int main(int, char **) { return 0; }\n") + +add_executable(TargetPropertyGeneratorExpressions + "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") +set_property(TARGET TargetPropertyGeneratorExpressions PROPERTY +COMPILE_DEFINITIONS + "$<TARGET_PROPERTY:TargetPropertyGeneratorExpressions,COMPILE_DEFINITIONS>" +) diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/CMakeLists.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/CMakeLists.txt new file mode 100644 index 0000000..22577da --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/CMakeLists.txt @@ -0,0 +1,8 @@ + +cmake_minimum_required(VERSION 2.8) +project(${RunCMake_TEST} CXX) + +# MSVC creates extra targets which pollute the stderr unless we set this. +set(CMAKE_SUPPRESS_REGENERATION TRUE) + +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/RunCMakeTest.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/RunCMakeTest.cmake new file mode 100644 index 0000000..0ee3238 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/RunCMakeTest.cmake @@ -0,0 +1,17 @@ +include(RunCMake) + +run_cmake(BadSelfReference1) +run_cmake(BadSelfReference2) +run_cmake(BadSelfReference3) +run_cmake(BadSelfReference4) +run_cmake(BadSelfReference5) +run_cmake(BadSelfReference6) +run_cmake(BadNonTarget) +run_cmake(BadInvalidName1) +run_cmake(BadInvalidName2) +run_cmake(BadInvalidName3) +run_cmake(BadInvalidName4) +run_cmake(BadInvalidName5) +run_cmake(BadInvalidName6) +run_cmake(BadInvalidName7) +run_cmake(BadInvalidName8) diff --git a/Tests/RunCMake/include_directories/CMakeLists.txt b/Tests/RunCMake/include_directories/CMakeLists.txt new file mode 100644 index 0000000..e8db6b0 --- /dev/null +++ b/Tests/RunCMake/include_directories/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/include_directories/NotFoundContent-result.txt b/Tests/RunCMake/include_directories/NotFoundContent-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/include_directories/NotFoundContent-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/include_directories/NotFoundContent-stderr.txt b/Tests/RunCMake/include_directories/NotFoundContent-stderr.txt new file mode 100644 index 0000000..f608d63 --- /dev/null +++ b/Tests/RunCMake/include_directories/NotFoundContent-stderr.txt @@ -0,0 +1,6 @@ +CMake Error: The following variables are used in this project, but they are set to NOTFOUND. +Please set them or make sure they are set and tested correctly in the CMake files: +NotThere1 + used as include directory in directory .* +NotThere2 + used as include directory in directory .* diff --git a/Tests/RunCMake/include_directories/NotFoundContent.cmake b/Tests/RunCMake/include_directories/NotFoundContent.cmake new file mode 100644 index 0000000..9677e0c --- /dev/null +++ b/Tests/RunCMake/include_directories/NotFoundContent.cmake @@ -0,0 +1,9 @@ + +include_directories(NotThere1-NOTFOUND) + +include_directories($<1:There1-NOTFOUND>) + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp" "int main(int,char**) { return 0; }\n") +add_executable(dummy "${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp") +set_property(TARGET dummy APPEND PROPERTY INCLUDE_DIRECTORIES "NotThere2-NOTFOUND") +set_property(TARGET dummy APPEND PROPERTY INCLUDE_DIRECTORIES "$<1:There2-NOTFOUND>") diff --git a/Tests/RunCMake/include_directories/RunCMakeTest.cmake b/Tests/RunCMake/include_directories/RunCMakeTest.cmake new file mode 100644 index 0000000..aee3f79 --- /dev/null +++ b/Tests/RunCMake/include_directories/RunCMakeTest.cmake @@ -0,0 +1,3 @@ +include(RunCMake) + +run_cmake(NotFoundContent) |