summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-08-01 18:59:50 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-08-01 18:59:50 (GMT)
commit88e1c54a7cd3213d87143558a8fddf39e7fdccc0 (patch)
tree3bb05b4e935ab00aa445129a073a6ff9321467af /Tests/RunCMake
parentbfac78d07479eb652405ee51548c4011766666ce (diff)
parent7a649111cdea2b10f2ec57084416be619867fbfb (diff)
downloadCMake-88e1c54a7cd3213d87143558a8fddf39e7fdccc0.zip
CMake-88e1c54a7cd3213d87143558a8fddf39e7fdccc0.tar.gz
CMake-88e1c54a7cd3213d87143558a8fddf39e7fdccc0.tar.bz2
Merge topic 'use-string-append'
7a649111 Use string(APPEND) in Tests 5d0d980d Use string(APPEND) in Modules
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/BuildDepends/check.cmake8
-rw-r--r--Tests/RunCMake/CMP0054/CMP0054-policy-while-scope.cmake4
-rw-r--r--Tests/RunCMake/CPack/DEB/Helpers.cmake10
-rw-r--r--Tests/RunCMake/CPack/VerifyResult.cmake4
-rw-r--r--Tests/RunCMake/RunCMake.cmake6
-rw-r--r--Tests/RunCMake/continue/ContinueWhile.cmake2
-rw-r--r--Tests/RunCMake/if/IsDirectoryLong.cmake2
-rw-r--r--Tests/RunCMake/include_external_msproject/check_utils.cmake6
-rw-r--r--Tests/RunCMake/install/DIRECTORY-MESSAGE_NEVER-check.cmake8
-rw-r--r--Tests/RunCMake/install/DIRECTORY-message-check.cmake12
-rw-r--r--Tests/RunCMake/install/DIRECTORY-message-lazy-check.cmake12
11 files changed, 37 insertions, 37 deletions
diff --git a/Tests/RunCMake/BuildDepends/check.cmake b/Tests/RunCMake/BuildDepends/check.cmake
index 26a9eb6..c7b5c3d 100644
--- a/Tests/RunCMake/BuildDepends/check.cmake
+++ b/Tests/RunCMake/BuildDepends/check.cmake
@@ -6,7 +6,7 @@ if(EXISTS ${RunCMake_TEST_BINARY_DIR}/check-debug.cmake)
foreach(exe IN LISTS check_exes)
execute_process(COMMAND ${exe} RESULT_VARIABLE res)
if(NOT res EQUAL ${check_step})
- set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}
+ string(APPEND RunCMake_TEST_FAILED "
'${exe}' returned '${res}' but expected '${check_step}'
")
endif()
@@ -16,15 +16,15 @@ if(EXISTS ${RunCMake_TEST_BINARY_DIR}/check-debug.cmake)
set(lhs "${CMAKE_MATCH_1}")
set(rhs "${CMAKE_MATCH_2}")
if(NOT EXISTS "${lhs}")
- set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}
+ string(APPEND RunCMake_TEST_FAILED "
'${lhs}' missing
")
elseif(NOT EXISTS "${rhs}")
- set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}
+ string(APPEND RunCMake_TEST_FAILED "
'${rhs}' missing
")
elseif(NOT "${lhs}" IS_NEWER_THAN "${rhs}")
- set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}
+ string(APPEND RunCMake_TEST_FAILED "
'${lhs}' is not newer than '${rhs}'
")
endif()
diff --git a/Tests/RunCMake/CMP0054/CMP0054-policy-while-scope.cmake b/Tests/RunCMake/CMP0054/CMP0054-policy-while-scope.cmake
index 2b22778..7fb836e 100644
--- a/Tests/RunCMake/CMP0054/CMP0054-policy-while-scope.cmake
+++ b/Tests/RunCMake/CMP0054/CMP0054-policy-while-scope.cmake
@@ -25,7 +25,7 @@ while(NOT LOOP_VAR STREQUAL "xx")
cmake_policy(SET CMP0054 NEW)
- set(LOOP_VAR "${LOOP_VAR}x")
+ string(APPEND LOOP_VAR "x")
endwhile()
while("FOO" STREQUAL BAR)
@@ -57,7 +57,7 @@ while(NOT LOOP_VAR STREQUAL "xx")
cmake_policy(SET CMP0054 OLD)
- set(LOOP_VAR "${LOOP_VAR}x")
+ string(APPEND LOOP_VAR "x")
endwhile()
if(NOT "FOO" STREQUAL BAR)
diff --git a/Tests/RunCMake/CPack/DEB/Helpers.cmake b/Tests/RunCMake/CPack/DEB/Helpers.cmake
index d05f115..9b1be22 100644
--- a/Tests/RunCMake/CPack/DEB/Helpers.cmake
+++ b/Tests/RunCMake/CPack/DEB/Helpers.cmake
@@ -40,13 +40,13 @@ function(getMissingShlibsErrorExtra FILE RESULT_VAR)
set(error_extra " Extra: install files '${deb_install_files}'")
if(deb_install_files_errors)
- set(error_extra "${error_extra}; errors \"${deb_install_files_errors}\"")
+ string(APPEND error_extra "; errors \"${deb_install_files_errors}\"")
endif()
find_program(READELF_EXECUTABLE NAMES readelf)
if(READELF_EXECUTABLE)
- set(error_extra "${error_extra}; readelf \"\n")
+ string(APPEND error_extra "; readelf \"\n")
# Only dynamically linked ELF files are included
# Extract only file name infront of ":"
@@ -61,13 +61,13 @@ function(getMissingShlibsErrorExtra FILE RESULT_VAR)
ERROR_VARIABLE err_
OUTPUT_STRIP_TRAILING_WHITESPACE)
- set(error_extra "${error_extra} name '${CMAKE_MATCH_1}'\n result '${result}'\n output '${output}'\n error '${err_}'\n")
+ string(APPEND error_extra " name '${CMAKE_MATCH_1}'\n result '${result}'\n output '${output}'\n error '${err_}'\n")
endif()
endforeach()
- set(error_extra "${error_extra}\"")
+ string(APPEND error_extra "\"")
else()
- set(error_extra "${error_extra}; error readelf missing")
+ string(APPEND error_extra "; error readelf missing")
endif()
endif()
diff --git a/Tests/RunCMake/CPack/VerifyResult.cmake b/Tests/RunCMake/CPack/VerifyResult.cmake
index 6eab531..8047668 100644
--- a/Tests/RunCMake/CPack/VerifyResult.cmake
+++ b/Tests/RunCMake/CPack/VerifyResult.cmake
@@ -16,7 +16,7 @@ include("${src_dir}/${GENERATOR_TYPE}/${RunCMake_TEST}-ExpectedFiles.cmake")
if(NOT EXPECTED_FILES_COUNT EQUAL 0)
foreach(file_no_ RANGE 1 ${EXPECTED_FILES_COUNT})
file(GLOB FOUND_FILE_${file_no_} RELATIVE "${bin_dir}" "${EXPECTED_FILE_${file_no_}}")
- set(foundFiles_ "${foundFiles_};${FOUND_FILE_${file_no_}}")
+ string(APPEND foundFiles_ ";${FOUND_FILE_${file_no_}}")
list(LENGTH FOUND_FILE_${file_no_} foundFilesCount_)
if(foundFilesCount_ EQUAL 1)
@@ -45,7 +45,7 @@ if(NOT EXPECTED_FILES_COUNT EQUAL 0)
# check that there were no extra files generated
foreach(all_files_glob_ IN LISTS ALL_FILES_GLOB)
file(GLOB foundAll_ RELATIVE "${bin_dir}" "${all_files_glob_}")
- set(allFoundFiles_ "${allFoundFiles_};${foundAll_}")
+ string(APPEND allFoundFiles_ ";${foundAll_}")
endforeach()
list(LENGTH foundFiles_ foundFilesCount_)
diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake
index fa0c980..247855a 100644
--- a/Tests/RunCMake/RunCMake.cmake
+++ b/Tests/RunCMake/RunCMake.cmake
@@ -95,7 +95,7 @@ function(run_cmake test)
endif()
set(msg "")
if(NOT "${actual_result}" MATCHES "${expect_result}")
- set(msg "${msg}Result is [${actual_result}], not [${expect_result}].\n")
+ string(APPEND msg "Result is [${actual_result}], not [${expect_result}].\n")
endif()
foreach(o out err)
string(REGEX REPLACE "\r\n" "\n" actual_std${o} "${actual_std${o}}")
@@ -107,7 +107,7 @@ function(run_cmake test)
string(REGEX REPLACE "\n" "\n expect-${o}> " expect_${o}
" expect-${o}> ${expect_std${o}}")
set(expect_${o} "Expected std${o} to match:\n${expect_${o}}\n")
- set(msg "${msg}std${o} does not match that expected.\n")
+ string(APPEND msg "std${o} does not match that expected.\n")
endif()
endif()
endforeach()
@@ -122,7 +122,7 @@ function(run_cmake test)
endif()
if(msg AND RunCMake_TEST_COMMAND)
string(REPLACE ";" "\" \"" command "\"${RunCMake_TEST_COMMAND}\"")
- set(msg "${msg}Command was:\n command> ${command}\n")
+ string(APPEND msg "Command was:\n command> ${command}\n")
endif()
if(msg)
string(REGEX REPLACE "\n" "\n actual-out> " actual_out " actual-out> ${actual_stdout}")
diff --git a/Tests/RunCMake/continue/ContinueWhile.cmake b/Tests/RunCMake/continue/ContinueWhile.cmake
index c1fa87a..f69993c 100644
--- a/Tests/RunCMake/continue/ContinueWhile.cmake
+++ b/Tests/RunCMake/continue/ContinueWhile.cmake
@@ -1,7 +1,7 @@
message(STATUS "start")
unset(iter)
while(NOT "${iter}" STREQUAL "aaaaa")
- set(iter "${iter}a")
+ string(APPEND iter "a")
if("${iter}" STREQUAL "aaa")
continue()
endif()
diff --git a/Tests/RunCMake/if/IsDirectoryLong.cmake b/Tests/RunCMake/if/IsDirectoryLong.cmake
index 0e93be7..e6939ac 100644
--- a/Tests/RunCMake/if/IsDirectoryLong.cmake
+++ b/Tests/RunCMake/if/IsDirectoryLong.cmake
@@ -1,6 +1,6 @@
set(d "/long/path/to/directory")
foreach(i RANGE 11)
- set(d "${d}${d}")
+ string(APPEND d "${d}")
endforeach()
string(LENGTH "${d}" dl)
if(IS_DIRECTORY "${d}/")
diff --git a/Tests/RunCMake/include_external_msproject/check_utils.cmake b/Tests/RunCMake/include_external_msproject/check_utils.cmake
index 408cadb..5dd92f9 100644
--- a/Tests/RunCMake/include_external_msproject/check_utils.cmake
+++ b/Tests/RunCMake/include_external_msproject/check_utils.cmake
@@ -91,7 +91,7 @@ function(check_project test name guid type platform)
if(guid)
check_project_guid("${sln}" "${name}" "${guid}" passed_guid)
if(NOT passed_guid)
- set(failed "${failed}${sep}${name} solution has no project with expected GUID=${guid}")
+ string(APPEND failed "${sep}${name} solution has no project with expected GUID=${guid}")
set(sep "\n")
endif()
else()
@@ -99,12 +99,12 @@ function(check_project test name guid type platform)
endif()
check_project_type("${sln}" "${name}" "${type}" passed_type)
if(NOT passed_type)
- set(failed "${failed}${sep}${name} solution has no project with expected TYPE=${type}")
+ string(APPEND failed "${sep}${name} solution has no project with expected TYPE=${type}")
set(sep "\n")
endif()
check_custom_platform("${sln}" "${name}" "${platform}" passed_platform)
if(NOT passed_platform)
- set(failed "${failed}${sep}${name} solution has no project with expected PLATFORM=${platform}")
+ string(APPEND failed "${sep}${name} solution has no project with expected PLATFORM=${platform}")
set(sep "\n")
endif()
set(RunCMake_TEST_FAILED "${failed}" PARENT_SCOPE)
diff --git a/Tests/RunCMake/install/DIRECTORY-MESSAGE_NEVER-check.cmake b/Tests/RunCMake/install/DIRECTORY-MESSAGE_NEVER-check.cmake
index 2c716e1..3605163 100644
--- a/Tests/RunCMake/install/DIRECTORY-MESSAGE_NEVER-check.cmake
+++ b/Tests/RunCMake/install/DIRECTORY-MESSAGE_NEVER-check.cmake
@@ -3,11 +3,11 @@ execute_process(COMMAND ${CMAKE_COMMAND} -P ${RunCMake_TEST_BINARY_DIR}/cmake_in
OUTPUT_VARIABLE out ERROR_VARIABLE err)
if(out MATCHES "-- Installing: [^\n]*prefix/dir")
string(REGEX REPLACE "\n" "\n " out " ${out}")
- set(RunCMake_TEST_FAILED
- "${RunCMake_TEST_FAILED}Installation output was not quiet:\n${out}")
+ string(APPEND RunCMake_TEST_FAILED
+ "Installation output was not quiet:\n${out}")
endif()
set(f ${RunCMake_TEST_BINARY_DIR}/prefix/dir/empty.txt)
if(NOT EXISTS "${f}")
- set(RunCMake_TEST_FAILED
- "${RunCMake_TEST_FAILED}File was not installed:\n ${f}\n")
+ string(APPEND RunCMake_TEST_FAILED
+ "File was not installed:\n ${f}\n")
endif()
diff --git a/Tests/RunCMake/install/DIRECTORY-message-check.cmake b/Tests/RunCMake/install/DIRECTORY-message-check.cmake
index 857681f..c9de3ea 100644
--- a/Tests/RunCMake/install/DIRECTORY-message-check.cmake
+++ b/Tests/RunCMake/install/DIRECTORY-message-check.cmake
@@ -7,13 +7,13 @@ set(expect "
")
if(NOT out MATCHES "${expect}")
string(REGEX REPLACE "\n" "\n " out " ${out}")
- set(RunCMake_TEST_FAILED
- "${RunCMake_TEST_FAILED}First install did not say 'Installing' as expected:\n${out}")
+ string(APPEND RunCMake_TEST_FAILED
+ "First install did not say 'Installing' as expected:\n${out}")
endif()
set(f ${RunCMake_TEST_BINARY_DIR}/prefix/dir/empty.txt)
if(NOT EXISTS "${f}")
- set(RunCMake_TEST_FAILED
- "${RunCMake_TEST_FAILED}File was not installed:\n ${f}\n")
+ string(APPEND RunCMake_TEST_FAILED
+ "File was not installed:\n ${f}\n")
endif()
execute_process(COMMAND ${CMAKE_COMMAND} -P ${RunCMake_TEST_BINARY_DIR}/cmake_install.cmake
OUTPUT_VARIABLE out ERROR_VARIABLE err)
@@ -23,6 +23,6 @@ set(expect "
")
if(NOT out MATCHES "${expect}")
string(REGEX REPLACE "\n" "\n " out " ${out}")
- set(RunCMake_TEST_FAILED
- "${RunCMake_TEST_FAILED}Second install did not say 'Up-to-date' as expected:\n${out}")
+ string(APPEND RunCMake_TEST_FAILED
+ "Second install did not say 'Up-to-date' as expected:\n${out}")
endif()
diff --git a/Tests/RunCMake/install/DIRECTORY-message-lazy-check.cmake b/Tests/RunCMake/install/DIRECTORY-message-lazy-check.cmake
index c7e6018..4339012 100644
--- a/Tests/RunCMake/install/DIRECTORY-message-lazy-check.cmake
+++ b/Tests/RunCMake/install/DIRECTORY-message-lazy-check.cmake
@@ -7,18 +7,18 @@ set(expect "
")
if(NOT out MATCHES "${expect}")
string(REGEX REPLACE "\n" "\n " out " ${out}")
- set(RunCMake_TEST_FAILED
- "${RunCMake_TEST_FAILED}First install did not say 'Installing' as expected:\n${out}")
+ string(APPEND RunCMake_TEST_FAILED
+ "First install did not say 'Installing' as expected:\n${out}")
endif()
set(f ${RunCMake_TEST_BINARY_DIR}/prefix/dir/empty.txt)
if(NOT EXISTS "${f}")
- set(RunCMake_TEST_FAILED
- "${RunCMake_TEST_FAILED}File was not installed:\n ${f}\n")
+ string(APPEND RunCMake_TEST_FAILED
+ "File was not installed:\n ${f}\n")
endif()
execute_process(COMMAND ${CMAKE_COMMAND} -P ${RunCMake_TEST_BINARY_DIR}/cmake_install.cmake
OUTPUT_VARIABLE out ERROR_VARIABLE err)
if(out MATCHES "(Installing|Up-to-date)")
string(REGEX REPLACE "\n" "\n " out " ${out}")
- set(RunCMake_TEST_FAILED
- "${RunCMake_TEST_FAILED}Second install was not silent as expected:\n${out}")
+ string(APPEND RunCMake_TEST_FAILED
+ "Second install was not silent as expected:\n${out}")
endif()