summaryrefslogtreecommitdiff
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-06-09 16:19:07 -0400
committerBrad King <brad.king@kitware.com>2014-06-09 16:21:11 -0400
commitb1c113d9a79c8ed78bffa63645a146593d19dadc (patch)
tree3eff31b885fd4b10adfa2667c89999bd522d6ffe /Tests
parent9e8fa1043ce9bfcffdcfa395f618dd7958ef4251 (diff)
downloadcmake-b1c113d9a79c8ed78bffa63645a146593d19dadc.tar.gz
cmake: Do not open directories as scripts (#14966)
Check if a file path is a directory before opening it. Extend the RunCMake.CommandLine test with a case running "cmake -P" on a directory.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/CommandLine/P_directory-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/P_directory-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake2
3 files changed, 4 insertions, 0 deletions
diff --git a/Tests/RunCMake/CommandLine/P_directory-result.txt b/Tests/RunCMake/CommandLine/P_directory-result.txt
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/P_directory-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/P_directory-stderr.txt b/Tests/RunCMake/CommandLine/P_directory-stderr.txt
new file mode 100644
index 0000000000..b8319a1fe7
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/P_directory-stderr.txt
@@ -0,0 +1 @@
+^CMake Error: Error processing file: .*/Tests/RunCMake/CommandLine$
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index 3aaeac047c..f3d9637690 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -35,3 +35,5 @@ run_cmake_command(E_sleep-no-args ${CMAKE_COMMAND} -E sleep)
run_cmake_command(E_sleep-bad-arg1 ${CMAKE_COMMAND} -E sleep x)
run_cmake_command(E_sleep-bad-arg2 ${CMAKE_COMMAND} -E sleep 1 -1)
run_cmake_command(E_sleep-one-tenth ${CMAKE_COMMAND} -E sleep 0.1)
+
+run_cmake_command(P_directory ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR})