diff options
author | Brad King <brad.king@kitware.com> | 2020-02-27 15:21:09 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-02-27 15:21:21 (GMT) |
commit | c58b9c5ab94d674c76a17e6154f05e0e8c5c37d1 (patch) | |
tree | 0f7c58ab4cb216c9e29308aeab4cb5251e397e2c /Tests | |
parent | d6fa2311275ce3c6f0e42989e523158952fc1449 (diff) | |
parent | 54e4f2ad455817bed165fa1cb3682acbd93a8a1a (diff) | |
download | CMake-c58b9c5ab94d674c76a17e6154f05e0e8c5c37d1.zip CMake-c58b9c5ab94d674c76a17e6154f05e0e8c5c37d1.tar.gz CMake-c58b9c5ab94d674c76a17e6154f05e0e8c5c37d1.tar.bz2 |
Merge topic 'cmake_command-command'
54e4f2ad45 cmake_command: Add command to INVOKE other commands by name
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kyle Edwards <kyle.edwards@kitware.com>
Merge-request: !4286
Diffstat (limited to 'Tests')
20 files changed, 38 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index d751d24..40b5cfa 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -652,3 +652,5 @@ add_RunCMake_test("CTestCommandExpandLists") add_RunCMake_test(PrecompileHeaders) add_RunCMake_test("UnityBuild") + +add_RunCMake_test(cmake_command) diff --git a/Tests/RunCMake/cmake_command/CMakeLists.txt b/Tests/RunCMake/cmake_command/CMakeLists.txt new file mode 100644 index 0000000..2632ffa --- /dev/null +++ b/Tests/RunCMake/cmake_command/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.16) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/cmake_command/RunCMakeTest.cmake b/Tests/RunCMake/cmake_command/RunCMakeTest.cmake new file mode 100644 index 0000000..d338cd8 --- /dev/null +++ b/Tests/RunCMake/cmake_command/RunCMakeTest.cmake @@ -0,0 +1,8 @@ +include(RunCMake) + +run_cmake(cmake_command_no_parameters) +run_cmake(cmake_command_unknown_meta_operation) +run_cmake(cmake_command_invoke_message) +run_cmake(cmake_command_invoke_message_fatal_error) +run_cmake(cmake_command_invoke_no_parameters) +run_cmake(cmake_command_invoke_unknown_function) diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_message-stderr.txt b/Tests/RunCMake/cmake_command/cmake_command_invoke_message-stderr.txt new file mode 100644 index 0000000..cfc8694 --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_invoke_message-stderr.txt @@ -0,0 +1 @@ +WORKS! diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_message.cmake b/Tests/RunCMake/cmake_command/cmake_command_invoke_message.cmake new file mode 100644 index 0000000..336d78a --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_invoke_message.cmake @@ -0,0 +1 @@ +cmake_command(INVOKE message WORKS!) diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_message_fatal_error-result.txt b/Tests/RunCMake/cmake_command/cmake_command_invoke_message_fatal_error-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_invoke_message_fatal_error-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_message_fatal_error-stderr.txt b/Tests/RunCMake/cmake_command/cmake_command_invoke_message_fatal_error-stderr.txt new file mode 100644 index 0000000..2c9dab5 --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_invoke_message_fatal_error-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at cmake_command_invoke_message_fatal_error.cmake:1 \(message\): + error! +Call Stack \(most recent call first\): + cmake_command_invoke_message_fatal_error.cmake:1 \(cmake_command\) + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_message_fatal_error.cmake b/Tests/RunCMake/cmake_command/cmake_command_invoke_message_fatal_error.cmake new file mode 100644 index 0000000..6b42764 --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_invoke_message_fatal_error.cmake @@ -0,0 +1 @@ +cmake_command(INVOKE message FATAL_ERROR error!) diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_no_parameters-result.txt b/Tests/RunCMake/cmake_command/cmake_command_invoke_no_parameters-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_invoke_no_parameters-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_no_parameters-stderr.txt b/Tests/RunCMake/cmake_command/cmake_command_invoke_no_parameters-stderr.txt new file mode 100644 index 0000000..7741b41 --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_invoke_no_parameters-stderr.txt @@ -0,0 +1,2 @@ +CMake Error at cmake_command_invoke_no_parameters.cmake:1 \(cmake_command\): + cmake_command called with incorrect number of arguments diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_no_parameters.cmake b/Tests/RunCMake/cmake_command/cmake_command_invoke_no_parameters.cmake new file mode 100644 index 0000000..b9c5e14 --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_invoke_no_parameters.cmake @@ -0,0 +1 @@ +cmake_command(INVOKE) diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_unknown_function-result.txt b/Tests/RunCMake/cmake_command/cmake_command_invoke_unknown_function-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_invoke_unknown_function-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_unknown_function-stderr.txt b/Tests/RunCMake/cmake_command/cmake_command_invoke_unknown_function-stderr.txt new file mode 100644 index 0000000..50a81a3 --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_invoke_unknown_function-stderr.txt @@ -0,0 +1,2 @@ +CMake Error at cmake_command_invoke_unknown_function.cmake:1 \(unknown\): + Unknown CMake command "unknown". diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_unknown_function.cmake b/Tests/RunCMake/cmake_command/cmake_command_invoke_unknown_function.cmake new file mode 100644 index 0000000..f19a04b --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_invoke_unknown_function.cmake @@ -0,0 +1 @@ +cmake_command(INVOKE unknown) diff --git a/Tests/RunCMake/cmake_command/cmake_command_no_parameters-result.txt b/Tests/RunCMake/cmake_command/cmake_command_no_parameters-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_no_parameters-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/cmake_command/cmake_command_no_parameters-stderr.txt b/Tests/RunCMake/cmake_command/cmake_command_no_parameters-stderr.txt new file mode 100644 index 0000000..772b604 --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_no_parameters-stderr.txt @@ -0,0 +1,2 @@ +CMake Error at cmake_command_no_parameters.cmake:1 \(cmake_command\): + cmake_command called with incorrect number of arguments diff --git a/Tests/RunCMake/cmake_command/cmake_command_no_parameters.cmake b/Tests/RunCMake/cmake_command/cmake_command_no_parameters.cmake new file mode 100644 index 0000000..b9c5e14 --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_no_parameters.cmake @@ -0,0 +1 @@ +cmake_command(INVOKE) diff --git a/Tests/RunCMake/cmake_command/cmake_command_unknown_meta_operation-result.txt b/Tests/RunCMake/cmake_command/cmake_command_unknown_meta_operation-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_unknown_meta_operation-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/cmake_command/cmake_command_unknown_meta_operation-stderr.txt b/Tests/RunCMake/cmake_command/cmake_command_unknown_meta_operation-stderr.txt new file mode 100644 index 0000000..7b9b915 --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_unknown_meta_operation-stderr.txt @@ -0,0 +1,2 @@ +CMake Error at cmake_command_unknown_meta_operation.cmake:1 \(cmake_command\): + cmake_command called with unknown meta-operation diff --git a/Tests/RunCMake/cmake_command/cmake_command_unknown_meta_operation.cmake b/Tests/RunCMake/cmake_command/cmake_command_unknown_meta_operation.cmake new file mode 100644 index 0000000..f7c77e5 --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_unknown_meta_operation.cmake @@ -0,0 +1 @@ +cmake_command(UNKNOWN) |