summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-01-25 16:15:37 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-01-25 16:15:46 (GMT)
commit1d6d10cbf6642ef0c4c7cb16929e2bf63f435868 (patch)
tree29ab11752b681bb7f0f32f9a9c6345e52c48bf63 /Tests
parent058f7189e19896c7ca28dfa93ff2f9dd49d1d743 (diff)
parenta1dc38a5670939a8ce8dfd99282f86d47412a98a (diff)
downloadCMake-1d6d10cbf6642ef0c4c7cb16929e2bf63f435868.zip
CMake-1d6d10cbf6642ef0c4c7cb16929e2bf63f435868.tar.gz
CMake-1d6d10cbf6642ef0c4c7cb16929e2bf63f435868.tar.bz2
Merge topic 'isdir_empty'
a1dc38a567 Help: Document behavior of if(EXISTS,IS_DIRECTORY) for empty paths Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8109
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/if/IsDirectoryLong.cmake3
-rw-r--r--Tests/RunCMake/if/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/if/exists.cmake3
3 files changed, 7 insertions, 0 deletions
diff --git a/Tests/RunCMake/if/IsDirectoryLong.cmake b/Tests/RunCMake/if/IsDirectoryLong.cmake
index e6939ac..41f1818 100644
--- a/Tests/RunCMake/if/IsDirectoryLong.cmake
+++ b/Tests/RunCMake/if/IsDirectoryLong.cmake
@@ -8,3 +8,6 @@ if(IS_DIRECTORY "${d}/")
else()
message(STATUS "Directory path with length ${dl} correctly does not exist.")
endif()
+if(IS_DIRECTORY "")
+ message(FATAL_ERROR "IS_DIRECTORY \"\" should not exist")
+endif()
diff --git a/Tests/RunCMake/if/RunCMakeTest.cmake b/Tests/RunCMake/if/RunCMakeTest.cmake
index de9cb57..efee116 100644
--- a/Tests/RunCMake/if/RunCMakeTest.cmake
+++ b/Tests/RunCMake/if/RunCMakeTest.cmake
@@ -1,6 +1,7 @@
include(RunCMake)
run_cmake(InvalidArgument1)
+run_cmake(exists)
run_cmake(IsDirectory)
run_cmake(IsDirectoryLong)
run_cmake(duplicate-deep-else)
diff --git a/Tests/RunCMake/if/exists.cmake b/Tests/RunCMake/if/exists.cmake
new file mode 100644
index 0000000..2e5c0ee
--- /dev/null
+++ b/Tests/RunCMake/if/exists.cmake
@@ -0,0 +1,3 @@
+if(EXISTS "")
+ message(FATAL_ERROR "EXISTS \"\" should not exist")
+endif()