This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake".
The branch, next has been updated via 27981b714bd667de0060a6c85e40077b123edace (commit) via 3e0fcd673fc05e7f35b22d91c83f0a5e5e14f5c5 (commit) via c037805953e61e29f96376c20506f78171b3920d (commit) from 8e912f37741273008442ee36d94610be01119762 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=27981b714bd667de0060a6c85e40077b123edace commit 27981b714bd667de0060a6c85e40077b123edace Merge: 8e912f3 3e0fcd6 Author: Rolf Eike Beer <e...@sf-mail.de> AuthorDate: Thu Nov 1 09:18:26 2012 -0400 Commit: CMake Topic Stage <kwro...@kitware.com> CommitDate: Thu Nov 1 09:18:26 2012 -0400 Merge topic 'start-contributing-irc-session' into next 3e0fcd6 List tests: refactor No-Arguments tests c037805 CMakeTests: allow to call the check_cmake_test macro with a given file http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3e0fcd673fc05e7f35b22d91c83f0a5e5e14f5c5 commit 3e0fcd673fc05e7f35b22d91c83f0a5e5e14f5c5 Author: Rolf Eike Beer <e...@sf-mail.de> AuthorDate: Thu Nov 1 14:11:42 2012 +0100 Commit: Rolf Eike Beer <e...@sf-mail.de> CommitDate: Thu Nov 1 14:14:10 2012 +0100 List tests: refactor No-Arguments tests We now have a list(X) test for every list subcommand as well as tests for list(X Y) for everything that needs more arguments than a list name. diff --git a/Tests/CMakeTests/List-Append-No-Arguments.cmake b/Tests/CMakeTests/List-Append-No-Arguments.cmake deleted file mode 100644 index dff6b09..0000000 --- a/Tests/CMakeTests/List-Append-No-Arguments.cmake +++ /dev/null @@ -1 +0,0 @@ -list(APPEND) diff --git a/Tests/CMakeTests/List-Find-No-Arguments.cmake b/Tests/CMakeTests/List-Find-No-Arguments.cmake deleted file mode 100644 index 7f99e94..0000000 --- a/Tests/CMakeTests/List-Find-No-Arguments.cmake +++ /dev/null @@ -1 +0,0 @@ -list(FIND mylist) diff --git a/Tests/CMakeTests/List-Get-No-Arguments.cmake b/Tests/CMakeTests/List-Get-No-Arguments.cmake deleted file mode 100644 index 8bb14d7..0000000 --- a/Tests/CMakeTests/List-Get-No-Arguments.cmake +++ /dev/null @@ -1 +0,0 @@ -list(GET mylist) diff --git a/Tests/CMakeTests/List-Insert-No-Arguments.cmake b/Tests/CMakeTests/List-Insert-No-Arguments.cmake deleted file mode 100644 index 6fa7ed6..0000000 --- a/Tests/CMakeTests/List-Insert-No-Arguments.cmake +++ /dev/null @@ -1 +0,0 @@ -list(INSERT mylist) diff --git a/Tests/CMakeTests/List-Remove_At-No-Arguments.cmake b/Tests/CMakeTests/List-Remove_At-No-Arguments.cmake deleted file mode 100644 index f9e763c..0000000 --- a/Tests/CMakeTests/List-Remove_At-No-Arguments.cmake +++ /dev/null @@ -1 +0,0 @@ -list(REMOVE_AT mylist) diff --git a/Tests/CMakeTests/List-Remove_Duplicates-No-Arguments.cmake b/Tests/CMakeTests/List-Remove_Duplicates-No-Arguments.cmake deleted file mode 100644 index 317d0c6..0000000 --- a/Tests/CMakeTests/List-Remove_Duplicates-No-Arguments.cmake +++ /dev/null @@ -1 +0,0 @@ -list(REMOVE_DUPLICATES) diff --git a/Tests/CMakeTests/List-Remove_Item-No-Arguments.cmake b/Tests/CMakeTests/List-Remove_Item-No-Arguments.cmake deleted file mode 100644 index 31a4aaa..0000000 --- a/Tests/CMakeTests/List-Remove_Item-No-Arguments.cmake +++ /dev/null @@ -1 +0,0 @@ -list(REMOVE_ITEM mylist) diff --git a/Tests/CMakeTests/List-Reverse-No-Arguments.cmake b/Tests/CMakeTests/List-Reverse-No-Arguments.cmake deleted file mode 100644 index 3940f6b..0000000 --- a/Tests/CMakeTests/List-Reverse-No-Arguments.cmake +++ /dev/null @@ -1 +0,0 @@ -list(REVERSE) diff --git a/Tests/CMakeTests/List-Sort-No-Arguments.cmake b/Tests/CMakeTests/List-Sort-No-Arguments.cmake deleted file mode 100644 index 627cc49..0000000 --- a/Tests/CMakeTests/List-Sort-No-Arguments.cmake +++ /dev/null @@ -1 +0,0 @@ -list(SORT) diff --git a/Tests/CMakeTests/ListTest.cmake.in b/Tests/CMakeTests/ListTest.cmake.in index 364ddaa..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}\"") @@ -101,26 +103,35 @@ 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.*") -foreach(cmd Append Reverse Remove_Duplicates Sort) # these currently trigger top-level condition +# 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 (@CMAKE_CURRENT_SOURCE_DIR@/)?List-${cmd}-No-Arguments.cmake:1 \\(list\\):.*list must be called with at least two arguments.*") + 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(Get-No-Arguments-RESULT 1) -set(Get-No-Arguments-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?List-Get-No-Arguments.cmake:1 \\(list\\):.*list sub-command GET requires at least three arguments.*") - -set(Find-No-Arguments-RESULT 1) -set(Find-No-Arguments-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?List-Find-No-Arguments.cmake:1 \\(list\\):.*list sub-command FIND requires three arguments.*") - -set(Insert-No-Arguments-RESULT 1) -set(Insert-No-Arguments-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?List-Insert-No-Arguments.cmake:1 \\(list\\):.*list sub-command INSERT requires at least three arguments.*") - -set(Remove_Item-No-Arguments-RESULT 1) -set(Remove_Item-No-Arguments-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?List-Remove_Item-No-Arguments.cmake:1 \\(list\\):.*list sub-command REMOVE_ITEM requires two or more 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.*") @@ -130,9 +141,6 @@ set(Remove_Duplicates-Too-Many-Arguments-STDERR ".*CMake Error at (@CMAKE_CURREN 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(Remove_At-No-Arguments-RESULT 1) -set(Remove_At-No-Arguments-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?List-Remove_At-No-Arguments.cmake:1 \\(list\\):.*list sub-command REMOVE_AT requires at least two arguments.*") - 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.*") @@ -150,22 +158,12 @@ 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:.*") -include("@CMAKE_CURRENT_SOURCE_DIR@/CheckCMakeTest.cmake") check_cmake_test(List No-Arguments Length-Too-Many-Arguments - Get-No-Arguments - Append-No-Arguments - Find-No-Arguments - Insert-No-Arguments - Remove_Item-No-Arguments - Reverse-No-Arguments Reverse-Too-Many-Arguments - Remove_Duplicates-No-Arguments Remove_Duplicates-Too-Many-Arguments - Sort-No-Arguments Sort-Too-Many-Arguments - Remove_At-No-Arguments Invalid-Subcommand Get-Invalid-Index Insert-Invalid-Index http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c037805953e61e29f96376c20506f78171b3920d commit c037805953e61e29f96376c20506f78171b3920d Author: Rolf Eike Beer <e...@sf-mail.de> AuthorDate: Thu Nov 1 13:26:23 2012 +0100 Commit: Rolf Eike Beer <e...@sf-mail.de> CommitDate: Thu Nov 1 13:26:23 2012 +0100 CMakeTests: allow to call the check_cmake_test macro with a given file This allows to generate a lot of simple files directly in the test tree instead of having them all checked in. 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() ----------------------------------------------------------------------- Summary of changes: Tests/CMakeTests/CheckCMakeTest.cmake | 53 +++++++++++--------- Tests/CMakeTests/List-Append-No-Arguments.cmake | 1 - Tests/CMakeTests/List-Find-No-Arguments.cmake | 1 - Tests/CMakeTests/List-Get-No-Arguments.cmake | 1 - Tests/CMakeTests/List-Insert-No-Arguments.cmake | 1 - Tests/CMakeTests/List-Remove_At-No-Arguments.cmake | 1 - .../List-Remove_Duplicates-No-Arguments.cmake | 1 - .../CMakeTests/List-Remove_Item-No-Arguments.cmake | 1 - Tests/CMakeTests/List-Reverse-No-Arguments.cmake | 1 - Tests/CMakeTests/List-Sort-No-Arguments.cmake | 1 - Tests/CMakeTests/ListTest.cmake.in | 52 +++++++++---------- 11 files changed, 54 insertions(+), 60 deletions(-) delete mode 100644 Tests/CMakeTests/List-Append-No-Arguments.cmake delete mode 100644 Tests/CMakeTests/List-Find-No-Arguments.cmake delete mode 100644 Tests/CMakeTests/List-Get-No-Arguments.cmake delete mode 100644 Tests/CMakeTests/List-Insert-No-Arguments.cmake delete mode 100644 Tests/CMakeTests/List-Remove_At-No-Arguments.cmake delete mode 100644 Tests/CMakeTests/List-Remove_Duplicates-No-Arguments.cmake delete mode 100644 Tests/CMakeTests/List-Remove_Item-No-Arguments.cmake delete mode 100644 Tests/CMakeTests/List-Reverse-No-Arguments.cmake delete mode 100644 Tests/CMakeTests/List-Sort-No-Arguments.cmake hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits