summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/GenEx-PATH/IS_ABSOLUTE.cmake.in
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/GenEx-PATH/IS_ABSOLUTE.cmake.in')
-rw-r--r--Tests/RunCMake/GenEx-PATH/IS_ABSOLUTE.cmake.in44
1 files changed, 44 insertions, 0 deletions
diff --git a/Tests/RunCMake/GenEx-PATH/IS_ABSOLUTE.cmake.in b/Tests/RunCMake/GenEx-PATH/IS_ABSOLUTE.cmake.in
new file mode 100644
index 0000000000..872dae484a
--- /dev/null
+++ b/Tests/RunCMake/GenEx-PATH/IS_ABSOLUTE.cmake.in
@@ -0,0 +1,44 @@
+
+include ("${RunCMake_SOURCE_DIR}/check_errors.cmake")
+unset (errors)
+
+if (WIN32)
+ set(path "c:/a")
+ set(output "$<PATH:IS_ABSOLUTE,c:/a>")
+else()
+ set(path "/a")
+ set(output "$<PATH:IS_ABSOLUTE,/a>")
+endif()
+if (NOT output)
+ list (APPEND errors "'${path}' is not absolute")
+endif()
+
+set(output "$<PATH:IS_ABSOLUTE,a/b>")
+if (output)
+ list (APPEND errors "'a/b' is absolute")
+endif()
+
+if (WIN32)
+ set(output "$<PATH:IS_ABSOLUTE,c:/a/b>")
+ if (NOT output)
+ list (APPEND errors "'c:/a/b' is not absolute")
+ endif()
+
+ set(output "$<PATH:IS_ABSOLUTE,//host/b>")
+ if (NOT output)
+ list (APPEND errors "'//host/b' is not absolute")
+ endif()
+
+ set(output "$<PATH:IS_ABSOLUTE,/a>")
+ if (output)
+ list (APPEND errors "'/a' is absolute")
+ endif()
+
+ set(output "$<PATH:IS_ABSOLUTE,c:a>")
+ if (output)
+ list (APPEND errors "'c:a' is absolute")
+ endif()
+endif()
+
+
+check_errors("PATH:IS_ABSOLUTE" ${errors})