Commit 7a649111 authored by Daniel Pfeifer's avatar Daniel Pfeifer
Browse files

Use string(APPEND) in Tests

Automate with:

find Tests -type f -print0 | xargs -0 perl -i -0pe \
's/set\(([a-zA-Z0-9_]+)(\s+)"\$\{\1\}([^"])/string(APPEND \1\2"\3/g'
parent 5d0d980d
......@@ -8,7 +8,7 @@ set(CMAKE_CXX_STANDARD 98)
# template support also need a flag to use the newer C++ library.
if (CMAKE_CXX_COMPILER_ID STREQUAL HP AND
CMAKE_CXX98_STANDARD_COMPILE_OPTION STREQUAL "+hpxstd98")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -AA")
string(APPEND CMAKE_CXX_FLAGS " -AA")
endif ()
# Clang/C2 in C++98 mode cannot properly handle some of MSVC headers
......
......@@ -50,7 +50,7 @@ else ()
endif ()
if (CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
string(APPEND CMAKE_CXX_FLAGS " -O3")
unset(CSE_RESULT_O3 CACHE)
message(STATUS "Testing with optimization -O3")
......
......@@ -77,7 +77,7 @@ endforeach()
set(CMAKE_TRY_COMPILE_CONFIGURATION ${CMAKE_BUILD_TYPE})
if (CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3")
string(APPEND CMAKE_C_FLAGS " -O3")
unset(CSHM_RESULT_O3 CACHE)
unset(CSHM_RESULT_O3_C CACHE)
unset(CSHM_RESULT_O3_CXX CACHE)
......
......@@ -39,7 +39,7 @@ else ()
endif ()
if (CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3")
string(APPEND CMAKE_C_FLAGS " -O3")
unset(CSE_RESULT_O3 CACHE)
message(STATUS "Testing with optimization -O3")
......
......@@ -35,7 +35,7 @@ foreach(module ${all_modules})
message(STATUS "module: ${module}")
file(READ "${dir}/${module}" module_content)
if(NOT "${module_content}" MATCHES "${notice_regex}")
set(notice_missing "${notice_missing} ${module}\n")
string(APPEND notice_missing " ${module}\n")
endif()
endforeach()
......
......@@ -2,13 +2,13 @@ set(NUMBERS "")
set(COUNT 0)
while(COUNT LESS 200)
set(NUMBERS "${NUMBERS} ${COUNT}")
string(APPEND NUMBERS " ${COUNT}")
set(COUNT "2${COUNT}")
set(NCOUNT 3)
while(NCOUNT LESS 31)
set(NUMBERS "${NUMBERS} ${NCOUNT}")
set(NCOUNT "${NCOUNT}0")
string(APPEND NUMBERS " ${NCOUNT}")
string(APPEND NCOUNT "0")
endwhile()
endwhile()
......
......@@ -41,7 +41,7 @@ if(LINTIAN_EXECUTABLE)
FILENAME "${_f}"
ERROR_REGEX_STRINGS "${STRINGS_TO_AVOID}")
set(lintian_output_errors_all "${lintian_output_errors_all}${lintian_output_errors}")
string(APPEND lintian_output_errors_all "${lintian_output_errors}")
endforeach()
if(NOT "${lintian_output_errors_all}" STREQUAL "")
......
......@@ -126,7 +126,7 @@ function(lintian_check_specific_errors output_errors)
string(REGEX MATCHALL "${_s}" "_TMP_CHECK_ERROR" "${lintian_output}")
if(NOT "${_TMP_CHECK_ERROR}" STREQUAL "")
set(ERROR_ACC "${ERROR_ACC}\nlintian: ${_f}: output contains an undesirable regex:\n\t${_TMP_CHECK_ERROR}")
string(APPEND ERROR_ACC "\nlintian: ${_f}: output contains an undesirable regex:\n\t${_TMP_CHECK_ERROR}")
endif()
endforeach()
......
......@@ -4,7 +4,7 @@
#-----------------------------------------------------------------------------
# Test in a directory next to this script.
get_filename_component(TOP "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(TOP "${TOP}/@CTestUpdateBZR_DIR@")
string(APPEND TOP "/@CTestUpdateBZR_DIR@")
# Include code common to all update tests.
include("@CMAKE_CURRENT_SOURCE_DIR@/CTestUpdateCommon.cmake")
......
......@@ -4,7 +4,7 @@
#-----------------------------------------------------------------------------
# Test in a directory next to this script.
get_filename_component(TOP "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(TOP "${TOP}/@CTestUpdateCVS_DIR@")
string(APPEND TOP "/@CTestUpdateCVS_DIR@")
set(UPDATE_NOT_GLOBAL 1)
set(UPDATE_MAYBE Updated{CTestConfig.cmake})
......
......@@ -84,9 +84,9 @@ function(check_updates build)
set(MSG "")
if(MISSING)
# List the missing entries
set(MSG "${MSG}Update.xml is missing expected entries:\n")
string(APPEND MSG "Update.xml is missing expected entries:\n")
foreach(f ${MISSING})
set(MSG "${MSG} ${f}\n")
string(APPEND MSG " ${f}\n")
endforeach()
else()
# Success
......@@ -96,9 +96,9 @@ function(check_updates build)
# Report the result
if(EXTRA)
# List the extra entries
set(MSG "${MSG}Update.xml has extra unexpected entries:\n")
string(APPEND MSG "Update.xml has extra unexpected entries:\n")
foreach(f ${EXTRA})
set(MSG "${MSG} ${f}\n")
string(APPEND MSG " ${f}\n")
endforeach()
else()
# Success
......@@ -112,9 +112,9 @@ function(check_updates build)
if(UPDATE_LOG_FILE)
file(READ ${UPDATE_LOG_FILE} UPDATE_LOG LIMIT ${max_update_xml_size})
string(REPLACE "\n" "\n " UPDATE_LOG "${UPDATE_LOG}")
set(MSG "${MSG}Update log:\n ${UPDATE_LOG}")
string(APPEND MSG "Update log:\n ${UPDATE_LOG}")
else()
set(MSG "${MSG}No update log found!")
string(APPEND MSG "No update log found!")
endif()
# Display the error message
......
......@@ -4,7 +4,7 @@
#-----------------------------------------------------------------------------
# Test in a directory next to this script.
get_filename_component(TOP "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(TOP "${TOP}/@CTestUpdateGIT_DIR@")
string(APPEND TOP "/@CTestUpdateGIT_DIR@")
set(UPDATE_EXTRA Updated{module})
# Include code common to all update tests.
......
......@@ -4,7 +4,7 @@
#-----------------------------------------------------------------------------
# Test in a directory next to this script.
get_filename_component(TOP "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(TOP "${TOP}/@CTestUpdateHG_DIR@")
string(APPEND TOP "/@CTestUpdateHG_DIR@")
# Include code common to all update tests.
include("@CMAKE_CURRENT_SOURCE_DIR@/CTestUpdateCommon.cmake")
......
......@@ -5,7 +5,7 @@
# Test in a directory next to this script.
get_filename_component(TOP "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(P4_TOP "${TOP}")
set(TOP "${TOP}/@CTestUpdateP4_DIR@")
string(APPEND TOP "/@CTestUpdateP4_DIR@")
# Include code common to all update tests.
set(REPOSITORY_FILE_PREFIX "//ctest/")
......@@ -48,9 +48,9 @@ if(UNIX)
file(MAKE_DIRECTORY ${P4_ROOT})
set(P4_SERVER "nohup '${P4D}' -d -r '${P4_ROOT}'")
set(P4_SERVER "${P4_SERVER} -L '${P4_ROOT}/p4.log'")
set(P4_SERVER "${P4_SERVER} -J '${P4_ROOT}/journal'")
set(P4_SERVER "${P4_SERVER} -p ${P4_PORT} >/dev/null 2>&1 &")
string(APPEND P4_SERVER " -L '${P4_ROOT}/p4.log'")
string(APPEND P4_SERVER " -J '${P4_ROOT}/journal'")
string(APPEND P4_SERVER " -p ${P4_PORT} >/dev/null 2>&1 &")
message("Server command line: ${P4_SERVER}")
......
......@@ -4,7 +4,7 @@
#-----------------------------------------------------------------------------
# Test in a directory next to this script.
get_filename_component(TOP "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(TOP "${TOP}/@CTestUpdateSVN_DIR@")
string(APPEND TOP "/@CTestUpdateSVN_DIR@")
set(UPDATE_GLOBAL_ELEMENTS SVNPath)
# Include code common to all update tests.
......
......@@ -95,7 +95,7 @@ endif()
if(CMAKE_SYSTEM MATCHES "OSF1-V")
if(NOT CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ")
string(APPEND CMAKE_CXX_FLAGS " -timplicit_local -no_implicit_include ")
endif()
endif()
......@@ -436,7 +436,7 @@ set(CMAKE_CXX_EXTENSIONS TRUE)
# template support also need a flag to use the newer C++ library.
if (CMAKE_CXX_COMPILER_ID STREQUAL HP AND
CMAKE_CXX98_STANDARD_COMPILE_OPTION STREQUAL "+hpxstd98")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -AA")
string(APPEND CMAKE_CXX_FLAGS " -AA")
endif ()
# Clang/C2 in C++98 mode cannot properly handle some of MSVC headers
......
#
# Create exe.
#
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTEST_CXX_FLAGS")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS")
string(APPEND CMAKE_CXX_FLAGS " -DTEST_CXX_FLAGS")
string(APPEND CMAKE_C_FLAGS " -DTEST_C_FLAGS")
# Create an imported target for if(TARGET) test below.
add_library(ExeImportedTarget UNKNOWN IMPORTED)
......
......@@ -43,7 +43,7 @@ endif()
#
set(SharedLibrarySources sharedFile)
add_library(CMakeTestLibraryShared SHARED ${SharedLibrarySources})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS")
string(APPEND CMAKE_C_FLAGS " -DTEST_C_FLAGS")
add_library(CMakeTestCLibraryShared SHARED testConly.c)
define_property(
TARGET PROPERTY FOO
......
......@@ -180,5 +180,5 @@ endforeach()
set(FOREACH_CONCAT "")
foreach (INDEX a;b;c;d;e;f;g)
set(FOREACH_CONCAT "${FOREACH_CONCAT}${INDEX}")
string(APPEND FOREACH_CONCAT "${INDEX}")
endforeach()
......@@ -88,7 +88,7 @@ endif()
if(CMAKE_SYSTEM MATCHES "OSF1-V")
if(NOT CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ")
string(APPEND CMAKE_CXX_FLAGS " -timplicit_local -no_implicit_include ")
endif()
endif()
......@@ -399,7 +399,7 @@ set(CMAKE_CXX_EXTENSIONS TRUE)
# template support also need a flag to use the newer C++ library.
if (CMAKE_CXX_COMPILER_ID STREQUAL HP AND
CMAKE_CXX98_STANDARD_COMPILE_OPTION STREQUAL "+hpxstd98")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -AA")
string(APPEND CMAKE_CXX_FLAGS " -AA")
endif ()
# Clang/C2 in C++98 mode cannot properly handle some of MSVC headers
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment