mirror of
https://github.com/cpm-cmake/CPM.cmake.git
synced 2025-11-18 07:07:47 -05:00
* Use shallow clone for git repositories by default (#129) * use shallow clone for git repositories by default * remove trailing spaces * Enable shallow clone for actual tags * Support short commit hash * Enable shallow only when downloading dependencies into cache * Always honor user specified GIT_SHALLOW opiton
This commit is contained in:
22
test/unit/is_git_tag_commit_hash.cmake
Normal file
22
test/unit/is_git_tag_commit_hash.cmake
Normal file
@@ -0,0 +1,22 @@
|
||||
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
|
||||
|
||||
include(${CPM_PATH}/CPM.cmake)
|
||||
include(${CPM_PATH}/testing.cmake)
|
||||
|
||||
CPM_IS_GIT_TAG_COMMIT_HASH("v1.2.3" RESULT)
|
||||
ASSERT_EQUAL("0" ${RESULT})
|
||||
|
||||
CPM_IS_GIT_TAG_COMMIT_HASH("asio-1-12-1" RESULT)
|
||||
ASSERT_EQUAL("0" ${RESULT})
|
||||
|
||||
CPM_IS_GIT_TAG_COMMIT_HASH("513039e3cba83284cec71287fd829865b9f423bc" RESULT)
|
||||
ASSERT_EQUAL("1" ${RESULT})
|
||||
|
||||
CPM_IS_GIT_TAG_COMMIT_HASH("513039E3CBA83284CEC71287FD829865B9F423BC" RESULT)
|
||||
ASSERT_EQUAL("1" ${RESULT})
|
||||
|
||||
CPM_IS_GIT_TAG_COMMIT_HASH("513039E" RESULT)
|
||||
ASSERT_EQUAL("1" ${RESULT})
|
||||
|
||||
CPM_IS_GIT_TAG_COMMIT_HASH("513039E3CBA8" RESULT)
|
||||
ASSERT_EQUAL("1" ${RESULT})
|
||||
Reference in New Issue
Block a user