summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/CommandLine
diff options
context:
space:
mode:
authorRobert Maynard <rmaynard@nvidia.com>2023-02-08 16:38:21 -0500
committerBrad King <brad.king@kitware.com>2023-02-08 17:21:10 -0500
commitf9e8a067c254c711d8628356c23c402882557058 (patch)
tree418f430ba416a9390401e66f48d63e6d8b125713 /Tests/RunCMake/CommandLine
parent2a0c105cf08190284b288057c693eeddef5066fc (diff)
downloadcmake-f9e8a067c254c711d8628356c23c402882557058.tar.gz
cmake: Stop parsing after `--` when detecting script mode
The fix in commit 08aa516880 (cmake: Stop parsing after `--` when detecting script mode, 2022-12-06, v3.26.0-rc1~216^2) only corrected the case where `-P -- -P <arg>` occurred and not `-P -- -P -<other>`. Fixes: #24220
Diffstat (limited to 'Tests/RunCMake/CommandLine')
-rw-r--r--Tests/RunCMake/CommandLine/P_P_in_arbitrary_args_2-stdout.txt10
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake1
2 files changed, 11 insertions, 0 deletions
diff --git a/Tests/RunCMake/CommandLine/P_P_in_arbitrary_args_2-stdout.txt b/Tests/RunCMake/CommandLine/P_P_in_arbitrary_args_2-stdout.txt
new file mode 100644
index 0000000000..ad386bd98d
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/P_P_in_arbitrary_args_2-stdout.txt
@@ -0,0 +1,10 @@
+^-- CMAKE_ARGC='6'
+-- CMAKE_ARGV1='-P'
+-- CMAKE_ARGV2='[^']*/Tests/RunCMake/CommandLine/P_arbitrary_args.cmake'
+-- CMAKE_ARGV3='--'
+-- CMAKE_ARGV4='-P'
+-- CMAKE_ARGV5='-o'
+-- CMAKE_ARGV6=''
+-- CMAKE_ARGV7=''
+-- CMAKE_ARGV8=''
+-- CMAKE_ARGV9=''$
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index f48e8453b8..943be248ce 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -56,6 +56,7 @@ run_cmake_command(P_no-file ${CMAKE_COMMAND} -P nosuchscriptfile.cmake)
run_cmake_command(P_args ${CMAKE_COMMAND} -P "${RunCMake_SOURCE_DIR}/P_args.cmake" relative/path "${RunCMake_SOURCE_DIR}")
run_cmake_command(P_arbitrary_args ${CMAKE_COMMAND} -P "${RunCMake_SOURCE_DIR}/P_arbitrary_args.cmake" -- -DFOO -S -B --fresh --version)
run_cmake_command(P_P_in_arbitrary_args ${CMAKE_COMMAND} -P "${RunCMake_SOURCE_DIR}/P_arbitrary_args.cmake" -- -P "${RunCMake_SOURCE_DIR}/non_existing.cmake")
+run_cmake_command(P_P_in_arbitrary_args_2 ${CMAKE_COMMAND} -P "${RunCMake_SOURCE_DIR}/P_arbitrary_args.cmake" -- -P -o)
run_cmake_command(P_fresh ${CMAKE_COMMAND} -P "${RunCMake_SOURCE_DIR}/P_fresh.cmake" --fresh)
run_cmake_command(build-no-dir