summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/GenEx-PATH/HAS_ITEM.cmake.in
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2022-05-18 09:15:10 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2022-05-31 13:39:51 (GMT)
commitf11e66670ba9716f45cf757285a77b937dce420b (patch)
treec18b78f99b1bdcc7b36ebbab43727816a07803ed /Tests/RunCMake/GenEx-PATH/HAS_ITEM.cmake.in
parent9f4aec6d61f0c4f91cae8f35c5b514d456fba8ff (diff)
downloadCMake-f11e66670ba9716f45cf757285a77b937dce420b.zip
CMake-f11e66670ba9716f45cf757285a77b937dce420b.tar.gz
CMake-f11e66670ba9716f45cf757285a77b937dce420b.tar.bz2
Genex-PATH: path handling
Fixes: #23498
Diffstat (limited to 'Tests/RunCMake/GenEx-PATH/HAS_ITEM.cmake.in')
-rw-r--r--Tests/RunCMake/GenEx-PATH/HAS_ITEM.cmake.in199
1 files changed, 199 insertions, 0 deletions
diff --git a/Tests/RunCMake/GenEx-PATH/HAS_ITEM.cmake.in b/Tests/RunCMake/GenEx-PATH/HAS_ITEM.cmake.in
new file mode 100644
index 0000000..fab9bd6
--- /dev/null
+++ b/Tests/RunCMake/GenEx-PATH/HAS_ITEM.cmake.in
@@ -0,0 +1,199 @@
+
+include ("${RunCMake_SOURCE_DIR}/check_errors.cmake")
+unset (errors)
+
+set(output "$<PATH:HAS_ROOT_NAME,/a/b>")
+if (output)
+ list (APPEND errors "ROOT_NAME: '/a/b' has root name")
+endif()
+set(output "$<PATH:HAS_ROOT_DIRECTORY,/a/b>")
+if (NOT output)
+ list (APPEND errors "ROOT_DIRECTORY: '/a/b' does not have root directory")
+endif()
+set(output "$<PATH:HAS_ROOT_PATH,/a/b>")
+if (NOT output)
+ list (APPEND errors "ROOT_PATH: '/a/b' does not have root path")
+endif()
+
+set(output "$<PATH:HAS_ROOT_PATH,a/b>")
+if (output)
+ list (APPEND errors "ROOT_PATH: 'a/b' has root path")
+endif()
+
+set(output "$<PATH:HAS_FILENAME,/a/b>")
+if (NOT output)
+ list (APPEND errors "FILENAME: '/a/b' does not have filename")
+endif()
+set(output "$<PATH:HAS_FILENAME,a.b>")
+if (NOT output)
+ list (APPEND errors "FILENAME: 'a.b' does not have filename")
+endif()
+set(output "$<PATH:HAS_FILENAME,/a/b/>")
+if (output)
+ list (APPEND errors "FILENAME: '/a/b/' has filename")
+endif()
+set(output "$<PATH:HAS_FILENAME,/>")
+if (output)
+ list (APPEND errors "FILENAME: '/' has filename")
+endif()
+
+set(output "$<PATH:HAS_STEM,/a/b>")
+if (NOT output)
+ list (APPEND errors "STEM: '/a/b' does not have stem")
+endif()
+set(output "$<PATH:HAS_STEM,a.b>")
+if (NOT output)
+ list (APPEND errors "STEM: 'a.b' does not have stem")
+endif()
+set(output "$<PATH:HAS_STEM,.a>")
+if (NOT output)
+ list (APPEND errors "STEM: '.a'} does not have stem")
+endif()
+set(output "$<PATH:HAS_STEM,/a/>")
+if (output)
+ list (APPEND errors "STEM: '/a/' has stem")
+endif()
+set(output "$<PATH:HAS_STEM,/>")
+if (output)
+ list (APPEND errors "STEM: '/' has stem")
+endif()
+
+set(output "$<PATH:HAS_EXTENSION,/a/b.c>")
+if (NOT output)
+ list (APPEND errors "EXTENSION: '/a/b.c' does not have extension")
+endif()
+set(output "$<PATH:HAS_EXTENSION,b.c>")
+if (NOT output)
+ list (APPEND errors "EXTENSION: 'b.c' does not have extension")
+endif()
+set(output "$<PATH:HAS_EXTENSION,/.a>")
+if (output)
+ list (APPEND errors "EXTENSION: '/.a' has extension")
+endif()
+set(output "$<PATH:HAS_EXTENSION,/a/>")
+if (output)
+ list (APPEND errors "EXTENSION: '/a/' has extension")
+endif()
+set(output "$<PATH:HAS_EXTENSION,/>")
+if (output)
+ list (APPEND errors "EXTENSION: '/' has extension")
+endif()
+
+set(output "$<PATH:HAS_RELATIVE_PART,/a/b>")
+if (NOT output)
+ list (APPEND errors "RELATIVE_PART: '/a/b' does not have relative part")
+endif()
+set(output "$<PATH:HAS_RELATIVE_PART,/>")
+if (output)
+ list (APPEND errors "RELATIVE_PART: '/' has relative part")
+endif()
+
+set(output "$<PATH:HAS_PARENT_PATH,/a/b>")
+if (NOT output)
+ list (APPEND errors "PARENT_PATH: '/a/b' does not have parent path")
+endif()
+set(output "$<PATH:HAS_PARENT_PATH,/>")
+if (NOT output)
+ list (APPEND errors "PARENT_PATH: '/' does not have parent path")
+endif()
+set(output "$<PATH:HAS_PARENT_PATH,a>")
+if (output)
+ list (APPEND errors "PARENT_PATH: 'a' has parent path")
+endif()
+
+if (WIN32)
+ set(output "$<PATH:HAS_ROOT_NAME,c:/a/b>")
+ if (NOT output)
+ list (APPEND errors "ROOT_NAME: 'c:/a/b' does not have root name")
+ endif()
+ set(output "$<PATH:HAS_ROOT_DIRECTORY,c:/a/b>")
+ if (NOT output)
+ list (APPEND errors "ROOT_DIRECTORY: 'c:/a/b' does not have root directory")
+ endif()
+ set(output "$<PATH:HAS_ROOT_PATH,c:/a/b>")
+ if (NOT output)
+ list (APPEND errors "ROOT_PATH: 'c:/a/b' does not have root path")
+ endif()
+
+ set(output "$<PATH:HAS_ROOT_NAME,c:a/b>")
+ if (NOT output)
+ list (APPEND errors "ROOT_NAME: 'c:a/b' does not have root name")
+ endif()
+ set(output "$<PATH:HAS_ROOT_DIRECTORY,c:a/b>")
+ if (output)
+ list (APPEND errors "ROOT_DIRECTORY: 'c:a/b' has root directory")
+ endif()
+ set(output "$<PATH:HAS_ROOT_PATH,c:a/b>")
+ if (NOT output)
+ list (APPEND errors "ROOT_PATH: 'c:a/b' does not have root path")
+ endif()
+
+ set(output "$<PATH:HAS_ROOT_NAME,//host/b>")
+ if (NOT output)
+ list (APPEND errors "ROOT_NAME: '//host/b' does not have root name")
+ endif()
+ set(output "$<PATH:HAS_ROOT_DIRECTORY,//host/b>")
+ if (NOT output)
+ list (APPEND errors "ROOT_DIRECTORY: '//host/b' does not have root directory")
+ endif()
+ set(output "$<PATH:HAS_ROOT_PATH,//host/b>")
+ if (NOT output)
+ list (APPEND errors "ROOT_PATH: '//host/b' does not have root path")
+ endif()
+
+ set(output "$<PATH:HAS_ROOT_NAME,//host>")
+ if (NOT output)
+ list (APPEND errors "ROOT_NAME: '//host' does not have root name")
+ endif()
+ set(output "$<PATH:HAS_ROOT_DIRECTORY,//host>")
+ if (output)
+ list (APPEND errors "ROOT_DIRECTORY: '//host' has root directory")
+ endif()
+ set(output "$<PATH:HAS_ROOT_PATH,//host>")
+ if (NOT output)
+ list (APPEND errors "ROOT_PATH: '//host' does not have root path")
+ endif()
+
+ set(output "$<PATH:HAS_RELATIVE_PART,c:/a/b>")
+ if (NOT output)
+ list (APPEND errors "RELATIVE_PART: 'c:/a/b' does not have relative part")
+ endif()
+
+ set(output "$<PATH:HAS_RELATIVE_PART,c:a/b>")
+ if (NOT output)
+ list (APPEND errors "RELATIVE_PART: 'c:a/b' does not have relative part")
+ endif()
+
+ set(output "$<PATH:HAS_RELATIVE_PART,//host/b>")
+ if (NOT output)
+ list (APPEND errors "RELATIVE_PART: '//host/b' does not have relative part")
+ endif()
+
+ set(output "$<PATH:HAS_PARENT_PATH,c:/a/b>")
+ if (NOT output)
+ list (APPEND errors "PARENT_PATH: 'c:/a/b' does not have parent path")
+ endif()
+
+ set(output "$<PATH:HAS_PARENT_PATH,c:/>")
+ if (NOT output)
+ list (APPEND errors "PARENT_PATH: 'c:/' does not have parent path")
+ endif()
+
+ set(output "$<PATH:HAS_PARENT_PATH,c:>")
+ if (NOT output)
+ list (APPEND errors "PARENT_PATH: 'c:' does not have parent path")
+ endif()
+
+ set(output "$<PATH:HAS_PARENT_PATH,//host/>")
+ if (NOT output)
+ list (APPEND errors "PARENT_PATH: '//host/' does not have parent path")
+ endif()
+
+ set(output "$<PATH:HAS_PARENT_PATH,//host>")
+ if (NOT output)
+ list (APPEND errors "PARENT_PATH: '//host' does not have parent path")
+ endif()
+endif()
+
+
+check_errors ("PATH:HAS..." ${errors})