summaryrefslogtreecommitdiffstats
path: root/Tests/CMakeTests
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/CMakeTests')
-rw-r--r--Tests/CMakeTests/CMakeLists.txt2
-rw-r--r--Tests/CMakeTests/FindBaseTest.cmake.in16
-rw-r--r--Tests/CMakeTests/GetFilenameComponentRealpathTest.cmake.in2
-rw-r--r--Tests/CMakeTests/GetPrerequisitesTest.cmake.in10
-rw-r--r--Tests/CMakeTests/IncludeTest.cmake.in10
-rw-r--r--Tests/CMakeTests/ListTest.cmake.in6
-rw-r--r--Tests/CMakeTests/StringTestScript.cmake12
-rw-r--r--Tests/CMakeTests/ToolchainTest.cmake.in36
-rw-r--r--Tests/CMakeTests/VariableWatchTest.cmake.in2
-rw-r--r--Tests/CMakeTests/WhileTest.cmake.in2
10 files changed, 49 insertions, 49 deletions
diff --git a/Tests/CMakeTests/CMakeLists.txt b/Tests/CMakeTests/CMakeLists.txt
index fadcc1e..d34d4a6 100644
--- a/Tests/CMakeTests/CMakeLists.txt
+++ b/Tests/CMakeTests/CMakeLists.txt
@@ -6,7 +6,7 @@ macro(AddCMakeTest TestName PreArgs)
"${CMAKE_CURRENT_BINARY_DIR}/${TestName}Test.cmake" @ONLY IMMEDIATE)
add_test(CMake.${TestName} ${CMAKE_EXECUTABLE} ${PreArgs}
-P "${CMAKE_CURRENT_BINARY_DIR}/${TestName}Test.cmake" ${ARGN})
-endmacro(AddCMakeTest)
+endmacro()
AddCMakeTest(List "")
diff --git a/Tests/CMakeTests/FindBaseTest.cmake.in b/Tests/CMakeTests/FindBaseTest.cmake.in
index 47c1692..658b350 100644
--- a/Tests/CMakeTests/FindBaseTest.cmake.in
+++ b/Tests/CMakeTests/FindBaseTest.cmake.in
@@ -12,7 +12,7 @@ set(_HEADER_FULL_A "${MY_SOURCE_DIR}/A/include/${_HEADER}")
find_file(FOO_H_1 ${_HEADER})
if(FOO_H_1)
message(FATAL_ERROR "${_HEADER} found: ${FOO_H_1}, it should not exist !")
-endif(FOO_H_1)
+endif()
# The HINTS option should override the system but the PATHS option
# should not.
@@ -21,10 +21,10 @@ find_file(TEST_H_1 ${_HEADER} HINTS ${MY_SOURCE_DIR}/A/include)
find_file(TEST_H_2 ${_HEADER} PATHS ${MY_SOURCE_DIR}/A/include)
if(NOT "${TEST_H_1}" STREQUAL "${_HEADER_FULL_A}")
message(FATAL_ERROR "Did not find \"${_HEADER_FULL_A}\"\ngot \"${TEST_H_1}\" instead!")
-endif(NOT "${TEST_H_1}" STREQUAL "${_HEADER_FULL_A}")
+endif()
if(NOT "${TEST_H_2}" STREQUAL "${_HEADER_FULL}")
message(FATAL_ERROR "Did not find \"${_HEADER_FULL}\"\ngot \"${TEST_H_2}\" instead!")
-endif(NOT "${TEST_H_2}" STREQUAL "${_HEADER_FULL}")
+endif()
set(CMAKE_SYSTEM_PREFIX_PATH)
# with this it still should not be found, since the include/ subdir is still missing
@@ -32,20 +32,20 @@ set(CMAKE_INCLUDE_PATH "${MY_SOURCE_DIR}")
find_file(FOO_H_2 ${_HEADER})
if(FOO_H_2)
message(FATAL_ERROR "${_HEADER} found: ${FOO_H_2}, it should not exist !")
-endif(FOO_H_2)
+endif()
# now with the PATH_SUFFIX it should be found
find_file(FOO_H_3 NAMES ${_HEADER} PATH_SUFFIXES include )
if(NOT "${FOO_H_3}" STREQUAL "${_HEADER_FULL}")
message(FATAL_ERROR "Did not find \"${_HEADER_FULL}\"\ngot ${FOO_H_3} instead !")
-endif(NOT "${FOO_H_3}" STREQUAL "${_HEADER_FULL}")
+endif()
# without PATH_SUFFIX, but with a CMAKE_INCLUDE_PATH it should not be found
set(CMAKE_INCLUDE_PATH /include)
find_file(FOO_H_4 ${_HEADER})
if(FOO_H_4)
message(FATAL_ERROR "${_HEADER} found: ${FOO_H_4}, it should not exist !")
-endif(FOO_H_4)
+endif()
# when setting CMAKE_FIND_ROOT_PATH to the current source dir,
# together with the CMAKE_INCLUDE_PATH it should be found
@@ -53,10 +53,10 @@ set(CMAKE_FIND_ROOT_PATH blub "${MY_SOURCE_DIR}")
find_file(FOO_H_5 ${_HEADER})
if(NOT "${FOO_H_5}" STREQUAL "${_HEADER_FULL}")
message(FATAL_ERROR "Did not find \"${_HEADER_FULL}\"\ngot ${FOO_H_5} instead !")
-endif(NOT "${FOO_H_5}" STREQUAL "${_HEADER_FULL}")
+endif()
# by explicitly disabling CMAKE_FIND_ROOT_PATH again it shouldn't be found
find_file(FOO_H_6 ${_HEADER} NO_CMAKE_FIND_ROOT_PATH)
if(FOO_H_6)
message(FATAL_ERROR "${_HEADER} found: ${FOO_H_6}, it should not exist !")
-endif(FOO_H_6)
+endif()
diff --git a/Tests/CMakeTests/GetFilenameComponentRealpathTest.cmake.in b/Tests/CMakeTests/GetFilenameComponentRealpathTest.cmake.in
index 7adc240..22f6afd 100644
--- a/Tests/CMakeTests/GetFilenameComponentRealpathTest.cmake.in
+++ b/Tests/CMakeTests/GetFilenameComponentRealpathTest.cmake.in
@@ -66,7 +66,7 @@ if(UNIX)
if(EXISTS file1 OR EXISTS file2)
message(FATAL_ERROR "removal of file1 or file2 failed")
endif()
- endif(LN)
+ endif()
file(REMOVE ${bindir}/file3)
endif()
diff --git a/Tests/CMakeTests/GetPrerequisitesTest.cmake.in b/Tests/CMakeTests/GetPrerequisitesTest.cmake.in
index daf467b..89ca735 100644
--- a/Tests/CMakeTests/GetPrerequisitesTest.cmake.in
+++ b/Tests/CMakeTests/GetPrerequisitesTest.cmake.in
@@ -58,7 +58,7 @@ function(stresstest_list_prerequisites file)
message(STATUS "=============================================================================")
message(STATUS "")
-endfunction(stresstest_list_prerequisites)
+endfunction()
function(test_cmake_executables)
@@ -68,7 +68,7 @@ function(test_cmake_executables)
get_filename_component(cmake_bin_dir "${CMAKE_COMMAND}" PATH)
list_prerequisites_by_glob(GLOB "${cmake_bin_dir}/*" 0 0 1)
-endfunction(test_cmake_executables)
+endfunction()
message(STATUS "=============================================================================")
@@ -93,7 +93,7 @@ if(do_testdefaults)
message(STATUS "")
list_prerequisites("${CMAKE_COMMAND}")
message(STATUS "")
-endif(do_testdefaults)
+endif()
set(do_stresstest 0)
@@ -103,7 +103,7 @@ if(do_stresstest)
message(STATUS "")
stresstest_list_prerequisites("${CMAKE_COMMAND}")
message(STATUS "")
-endif(do_stresstest)
+endif()
test_cmake_executables()
@@ -141,7 +141,7 @@ message(STATUS "")
get_cmake_property(vs VARIABLES)
foreach(v ${vs})
message(STATUS "${v}='${${v}}'")
-endforeach(v)
+endforeach()
message(STATUS "")
message(STATUS "=============================================================================")
diff --git a/Tests/CMakeTests/IncludeTest.cmake.in b/Tests/CMakeTests/IncludeTest.cmake.in
index eca679b..985333c 100644
--- a/Tests/CMakeTests/IncludeTest.cmake.in
+++ b/Tests/CMakeTests/IncludeTest.cmake.in
@@ -9,18 +9,18 @@ set(fileTwo "${CMAKE_ROOT}/Modules/CMake.cmake")
if(WIN32)
string(TOLOWER "${fileOne}" fileOne)
string(TOLOWER "${fileTwo}" fileTwo)
-endif(WIN32)
+endif()
if(NOT "${fileOne}" STREQUAL "${fileTwo}")
message(FATAL_ERROR "Wrong CMake.cmake was included: \"${fileOne}\" expected \"${fileTwo}\"")
-endif(NOT "${fileOne}" STREQUAL "${fileTwo}")
+endif()
# this one must return NOTFOUND in _includedFile
include(I_do_not_exist OPTIONAL RESULT_VARIABLE _includedFile)
if(_includedFile)
message(FATAL_ERROR "File \"I_do_not_exist\" was included, although it shouldn't exist,\nIncluded file is \"${_includedFile}\"")
-endif(_includedFile)
+endif()
# and this one must succeed too
include(CMake OPTIONAL RESULT_VARIABLE _includedFile)
@@ -29,11 +29,11 @@ set(fileTwo "${CMAKE_ROOT}/Modules/CMake.cmake")
if(WIN32)
string(TOLOWER "${fileOne}" fileOne)
string(TOLOWER "${fileTwo}" fileTwo)
-endif(WIN32)
+endif()
if(NOT "${fileOne}" STREQUAL "${fileTwo}")
message(FATAL_ERROR "Wrong CMake.cmake was included: \"${fileOne}\" expected \"${fileTwo}\"")
-endif(NOT "${fileOne}" STREQUAL "${fileTwo}")
+endif()
# Check that CMAKE_CURRENT_LIST_DIR is working:
# Needs to be a file in the build tree, which is correct cmake script
diff --git a/Tests/CMakeTests/ListTest.cmake.in b/Tests/CMakeTests/ListTest.cmake.in
index 5db171c..07fc7c6 100644
--- a/Tests/CMakeTests/ListTest.cmake.in
+++ b/Tests/CMakeTests/ListTest.cmake.in
@@ -1,10 +1,10 @@
macro(TEST command expected)
if("x${result}" STREQUAL "x${expected}")
#message("TEST \"${command}\" success: \"${result}\" expected: \"${expected}\"")
- else("x${result}" STREQUAL "x${expected}")
+ else()
message(SEND_ERROR "${CMAKE_CURRENT_LIST_LINE}: TEST \"${command}\" failed: \"${result}\" expected: \"${expected}\"")
- endif("x${result}" STREQUAL "x${expected}")
-endmacro(TEST command expected)
+ endif()
+endmacro()
set(mylist andy bill ken brad)
diff --git a/Tests/CMakeTests/StringTestScript.cmake b/Tests/CMakeTests/StringTestScript.cmake
index 7a264a0..a562e71 100644
--- a/Tests/CMakeTests/StringTestScript.cmake
+++ b/Tests/CMakeTests/StringTestScript.cmake
@@ -236,42 +236,42 @@ elseif(testname STREQUAL string_find_with_no_possible_result) # pass
message(STATUS "v='${v}'")
if(NOT(-1 EQUAL ${v}))
message(SEND_ERROR "FIND sub-command should return -1 but returned ${v}.")
- endif(NOT(-1 EQUAL ${v}))
+ endif()
elseif(testname STREQUAL string_find_reverse_with_no_possible_result) # pass
string(FIND "CMake is a great application." "z" v REVERSE)
message(STATUS "v='${v}'")
if(NOT(-1 EQUAL ${v}))
message(SEND_ERROR "FIND REVERSE sub-command should return -1 but returned ${v}.")
- endif(NOT(-1 EQUAL ${v}))
+ endif()
elseif(testname STREQUAL string_find_with_required_result) # pass
string(FIND "CMake is a great application." "g" v)
message(STATUS "v='${v}'")
if(NOT(11 EQUAL ${v}))
message(SEND_ERROR "FIND sub-command should return 11 but returned ${v}.")
- endif(NOT(11 EQUAL ${v}))
+ endif()
elseif(testname STREQUAL string_find_reverse_with_required_result) # pass
string(FIND "CMake is a great application." "e" v REVERSE)
message(STATUS "v='${v}'")
if(NOT(13 EQUAL ${v}))
message(SEND_ERROR "FIND REVERSE sub-command should return 13 but returned ${v}.")
- endif(NOT(13 EQUAL ${v}))
+ endif()
elseif(testname STREQUAL string_find_word_reverse_with_required_result) # pass
string(FIND "The command should find REVERSE in this string. Or maybe this REVERSE?!" "REVERSE" v)
message(STATUS "v='${v}'")
if(NOT(24 EQUAL ${v}))
message(SEND_ERROR "FIND sub-command should return 24 but returned ${v}.")
- endif(NOT(24 EQUAL ${v}))
+ endif()
elseif(testname STREQUAL string_find_reverse_word_reverse_with_required_result) # pass
string(FIND "The command should find REVERSE in this string. Or maybe this REVERSE?!" "REVERSE" v REVERSE)
message(STATUS "v='${v}'")
if(NOT(62 EQUAL ${v}))
message(SEND_ERROR "FIND sub-command should return 62 but returned ${v}.")
- endif(NOT(62 EQUAL ${v}))
+ endif()
else() # fail
message(FATAL_ERROR "testname='${testname}' - error: no such test in '${CMAKE_CURRENT_LIST_FILE}'")
diff --git a/Tests/CMakeTests/ToolchainTest.cmake.in b/Tests/CMakeTests/ToolchainTest.cmake.in
index cd258db..c010fca 100644
--- a/Tests/CMakeTests/ToolchainTest.cmake.in
+++ b/Tests/CMakeTests/ToolchainTest.cmake.in
@@ -4,7 +4,7 @@
# overwrite mark_as_advanced(), since this is used in CMakeDetermineCCompiler.cmake
# which will complain that it can"t be used in script mode
macro(MARK_AS_ADVANCED)
-endmacro(MARK_AS_ADVANCED)
+endmacro()
# set this to a place where we are allowed to write
set(CMAKE_PLATFORM_ROOT_BIN "${CMAKE_CURRENT_BINARY_DIR}")
@@ -21,19 +21,19 @@ include(CMakeDetermineSystem)
# check that CMAKE_SYSTEM_XXX and CMAKE_HOST_SYSTEM_xxx are identical
if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "${CMAKE_HOST_SYSTEM_NAME}")
message(FATAL_ERROR "CMAKE_SYSTEM_NAME and CMAKE_HOST_SYSTEM_NAME not identical: \"${CMAKE_SYSTEM_NAME}\" vs. \"${CMAKE_HOST_SYSTEM_NAME}\"")
-endif(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "${CMAKE_HOST_SYSTEM_NAME}")
+endif()
if(NOT "${CMAKE_SYSTEM}" STREQUAL "${CMAKE_HOST_SYSTEM}")
message(FATAL_ERROR "CMAKE_SYSTEM and CMAKE_HOST_SYSTEM not identical: \"${CMAKE_SYSTEM}\" vs. \"${CMAKE_HOST_SYSTEM}\"")
-endif(NOT "${CMAKE_SYSTEM}" STREQUAL "${CMAKE_HOST_SYSTEM}")
+endif()
if(NOT "${CMAKE_SYSTEM_VERSION}" STREQUAL "${CMAKE_HOST_SYSTEM_VERSION}")
message(FATAL_ERROR "CMAKE_SYSTEM_VERSION and CMAKE_HOST_SYSTEM_VERSION not identical: \"${CMAKE_SYSTEM_VERSION}\" vs. \"${CMAKE_HOST_SYSTEM_VERSION}\"")
-endif(NOT "${CMAKE_SYSTEM_VERSION}" STREQUAL "${CMAKE_HOST_SYSTEM_VERSION}")
+endif()
if(NOT "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "${CMAKE_HOST_SYSTEM_PROCESSOR}")
message(FATAL_ERROR "CMAKE_SYSTEM_PROCESSOR and CMAKE_HOST_SYSTEM_PROCESSOR not identical: \"${CMAKE_SYSTEM_PROCESSOR}\" vs. \"${CMAKE_HOST_SYSTEM_PROCESSOR}\"")
-endif(NOT "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "${CMAKE_HOST_SYSTEM_PROCESSOR}")
+endif()
# save the values so we can compare them to CMAKE_HOST_SYSTEM_XXX in the toolchain case
@@ -73,35 +73,35 @@ include(CMakeDetermineCXXCompiler)
if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Dumdidum")
message(FATAL_ERROR "CMAKE_SYSTEM_NAME overwritten: \"${CMAKE_SYSTEM_NAME}\", was: \"Dumdidum\"")
-endif(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Dumdidum")
+endif()
if(NOT "${CMAKE_SYSTEM}" STREQUAL "Dumdidum-1.0")
message(FATAL_ERROR "CMAKE_SYSTEM wrong: \"${CMAKE_SYSTEM}\", expected: \"Dumdidum-1.0\"")
-endif(NOT "${CMAKE_SYSTEM}" STREQUAL "Dumdidum-1.0")
+endif()
set(fileOne "${_INCLUDED_TOOLCHAIN_FILE}")
set(fileTwo "${MY_SOURCE_DIR}/DummyToolchain.cmake")
if(WIN32)
string(TOLOWER "${fileOne}" fileOne)
string(TOLOWER "${fileTwo}" fileTwo)
-endif(WIN32)
+endif()
if(NOT "${fileOne}" STREQUAL "${fileTwo}")
message(FATAL_ERROR "Wrong toolchain was loaded: \"${fileOne}\" expected \"${fileTwo}\"")
-endif(NOT "${fileOne}" STREQUAL "${fileTwo}")
+endif()
# check that CMAKE_HOST_SYSTEM_XXX and _SYSTEM_xxx detected above are identical
if(NOT "${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "${NATIVE_SYSTEM_NAME}")
message(FATAL_ERROR "CMAKE_HOST_SYSTEM_NAME and NATIVE_SYSTEM_NAME not identical: \"${CMAKE_HOST_SYSTEM_NAME}\" vs. \"${NATIVE_SYSTEM_NAME}\"")
-endif(NOT "${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "${NATIVE_SYSTEM_NAME}")
+endif()
if(NOT "${CMAKE_HOST_SYSTEM}" STREQUAL "${NATIVE_SYSTEM}")
message(FATAL_ERROR "CMAKE_HOST_SYSTEM and NATIVE_SYSTEM not identical: \"${CMAKE_HOST_SYSTEM}\" vs. \"${NATIVE_SYSTEM}\"")
-endif(NOT "${CMAKE_HOST_SYSTEM}" STREQUAL "${NATIVE_SYSTEM}")
+endif()
if(NOT "${CMAKE_HOST_SYSTEM_VERSION}" STREQUAL "${NATIVE_SYSTEM_VERSION}")
message(FATAL_ERROR "CMAKE_HOST_SYSTEM_VERSION and NATIVE_SYSTEM_VERSION not identical: \"${CMAKE_HOST_SYSTEM_VERSION}\" vs. \"${NATIVE_SYSTEM_VERSION}\"")
-endif(NOT "${CMAKE_HOST_SYSTEM_VERSION}" STREQUAL "${NATIVE_SYSTEM_VERSION}")
+endif()
if(NOT "${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "${NATIVE_SYSTEM_PROCESSOR}")
message(FATAL_ERROR "CMAKE_HOST_SYSTEM_PROCESSOR and NATIVE_SYSTEM_PROCESSOR not identical: \"${CMAKE_HOST_SYSTEM_PROCESSOR}\" vs. \"${NATIVE_SYSTEM_PROCESSOR}\"")
-endif(NOT "${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "${NATIVE_SYSTEM_PROCESSOR}")
+endif()
#############################################################
@@ -109,15 +109,15 @@ endif(NOT "${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "${NATIVE_SYSTEM_PROCESSOR}"
if(NOT "${_CMAKE_TOOLCHAIN_PREFIX}" STREQUAL "arm-elf-")
message(FATAL_ERROR "wrong toolchain prefix detected: \"${_CMAKE_TOOLCHAIN_PREFIX}\", expected: \"arm-elf-\"")
-endif(NOT "${_CMAKE_TOOLCHAIN_PREFIX}" STREQUAL "arm-elf-")
+endif()
if(NOT "${_CMAKE_USER_C_COMPILER_PATH}" STREQUAL "/opt/foo/bin")
message(FATAL_ERROR "wrong C compiler location detected: \"${_CMAKE_USER_C_COMPILER_PATH}\", expected: \"/opt/foo/bin\"")
-endif(NOT "${_CMAKE_USER_C_COMPILER_PATH}" STREQUAL "/opt/foo/bin")
+endif()
if(NOT "${CMAKE_C_OUTPUT_EXTENSION}" STREQUAL ".foo")
message(FATAL_ERROR "C output extension overwritten: \"${CMAKE_C_OUTPUT_EXTENSION}\", was: \".foo\"")
-endif(NOT "${CMAKE_C_OUTPUT_EXTENSION}" STREQUAL ".foo")
+endif()
#############################################################
@@ -125,11 +125,11 @@ endif(NOT "${CMAKE_C_OUTPUT_EXTENSION}" STREQUAL ".foo")
if(NOT "${_CMAKE_USER_CXX_COMPILER_PATH}" STREQUAL "/opt/bar/bin")
message(FATAL_ERROR "wrong CXX compiler location detected: \"${_CMAKE_USER_CXX_COMPILER_PATH}\", expected: \"/opt/bar/bin\"")
-endif(NOT "${_CMAKE_USER_CXX_COMPILER_PATH}" STREQUAL "/opt/bar/bin")
+endif()
if(NOT "${CMAKE_CXX_OUTPUT_EXTENSION}" STREQUAL ".bar")
message(FATAL_ERROR "C output extension overwritten: \"${CMAKE_CXX_OUTPUT_EXTENSION}\", was: \".bar\"")
-endif(NOT "${CMAKE_CXX_OUTPUT_EXTENSION}" STREQUAL ".bar")
+endif()
message(STATUS "CMAKE_SYSTEM: \"${CMAKE_SYSTEM}\"")
message(STATUS "_CMAKE_TOOLCHAIN_PREFIX: \"${_CMAKE_TOOLCHAIN_PREFIX}\"")
diff --git a/Tests/CMakeTests/VariableWatchTest.cmake.in b/Tests/CMakeTests/VariableWatchTest.cmake.in
index 3d290d6..0c084fd 100644
--- a/Tests/CMakeTests/VariableWatchTest.cmake.in
+++ b/Tests/CMakeTests/VariableWatchTest.cmake.in
@@ -7,7 +7,7 @@ macro(testwatch var access file stack)
message("There was a ${access} access done on the variable: ${var} in file ${file}")
message("List file stack is: ${stack}")
set(${var}_watched 1)
-endmacro(testwatch)
+endmacro()
variable_watch(somevar testwatch)
diff --git a/Tests/CMakeTests/WhileTest.cmake.in b/Tests/CMakeTests/WhileTest.cmake.in
index 4693f2d..4cec291 100644
--- a/Tests/CMakeTests/WhileTest.cmake.in
+++ b/Tests/CMakeTests/WhileTest.cmake.in
@@ -10,7 +10,7 @@ while(COUNT LESS 200)
set(NUMBERS "${NUMBERS} ${NCOUNT}")
set(NCOUNT "${NCOUNT}0")
endwhile()
-endwhile(COUNT LESS 200)
+endwhile()
if(NOT NUMBERS STREQUAL " 0 3 30 20 3 30")
message(SEND_ERROR "while loop nesting error, result: '${NUMBERS}'")