summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/cmake_path/COMPARE.cmake
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2020-07-23 14:54:12 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2020-09-06 08:52:25 (GMT)
commiteb583b0a660ba68e8e3b5f820301fde333619283 (patch)
treed88a52fdc1af9843ee4adceb1a37c66148d48c2e /Tests/RunCMake/cmake_path/COMPARE.cmake
parent212e953d352c2ca20cf6280492633d21fbacdbc9 (diff)
downloadCMake-eb583b0a660ba68e8e3b5f820301fde333619283.zip
CMake-eb583b0a660ba68e8e3b5f820301fde333619283.tar.gz
CMake-eb583b0a660ba68e8e3b5f820301fde333619283.tar.bz2
cmake_path command: path management
Fixes: #19568, #20922
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})