summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/cmake_path/COMPARE.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/cmake_path/COMPARE.cmake')
-rw-r--r--Tests/RunCMake/cmake_path/COMPARE.cmake22
1 files changed, 22 insertions, 0 deletions
diff --git a/Tests/RunCMake/cmake_path/COMPARE.cmake b/Tests/RunCMake/cmake_path/COMPARE.cmake
new file mode 100644
index 0000000..bc6b9b4
--- /dev/null
+++ b/Tests/RunCMake/cmake_path/COMPARE.cmake
@@ -0,0 +1,22 @@
+
+include ("${RunCMake_SOURCE_DIR}/check_errors.cmake")
+unset (errors)
+
+set (path "a///b/c")
+cmake_path(COMPARE path EQUAL "a/b/c" output)
+if (NOT output)
+ list (APPEND errors "'${path}' not equal to 'a/b/c'")
+endif()
+
+set (path "a/b/d/../c")
+cmake_path(COMPARE path NOT_EQUAL "a/b/c" output)
+if (NOT output)
+ list (APPEND errors "'${path}' equal to 'a/b/c'")
+endif()
+cmake_path(NORMAL_PATH path)
+cmake_path(COMPARE path EQUAL "a/b/c" output)
+if (NOT output)
+ list (APPEND errors "'${path}' not equal to 'a/b/c'")
+endif()
+
+check_errors (COMPARE ${errors})