mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-28 00:08:22 +08:00
mdbx-cmake: переформатирование cmake-скриптов.
This commit is contained in:
parent
5862a4b542
commit
a2984c604d
890
CMakeLists.txt
890
CMakeLists.txt
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
## Copyright (c) 2012-2024 Леонид Юрьев aka Leonid Yuriev <leo@yuriev.ru>
|
||||
## SPDX-License-Identifier: Apache-2.0
|
||||
# Copyright (c) 2012-2024 Леонид Юрьев aka Leonid Yuriev <leo@yuriev.ru>
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
if(CMAKE_VERSION VERSION_LESS 3.8.2)
|
||||
cmake_minimum_required(VERSION 3.0.2)
|
||||
@ -14,7 +14,7 @@ cmake_policy(VERSION ${CMAKE_MINIMUM_REQUIRED_VERSION})
|
||||
|
||||
unset(MEMCHECK_OPTION_NAME)
|
||||
if(NOT DEFINED ENABLE_MEMCHECK)
|
||||
if (DEFINED MDBX_USE_VALGRIND)
|
||||
if(DEFINED MDBX_USE_VALGRIND)
|
||||
set(MEMCHECK_OPTION_NAME "MDBX_USE_VALGRIND")
|
||||
elseif(DEFINED ENABLE_VALGRIND)
|
||||
set(MEMCHECK_OPTION_NAME "ENABLE_VALGRIND")
|
||||
@ -23,7 +23,7 @@ if(NOT DEFINED ENABLE_MEMCHECK)
|
||||
endif()
|
||||
if(MEMCHECK_OPTION_NAME STREQUAL "ENABLE_MEMCHECK")
|
||||
option(ENABLE_MEMCHECK
|
||||
"Enable integration with valgrind, a memory analyzing tool" OFF)
|
||||
"Enable integration with valgrind, a memory analyzing tool" OFF)
|
||||
elseif(${MEMCHECK_OPTION_NAME})
|
||||
set(ENABLE_MEMCHECK ON)
|
||||
else()
|
||||
@ -34,17 +34,20 @@ endif()
|
||||
include(CheckLibraryExists)
|
||||
check_library_exists(gcov __gcov_flush "" HAVE_GCOV)
|
||||
|
||||
option(ENABLE_GCOV
|
||||
"Enable integration with gcov, a code coverage program" OFF)
|
||||
option(ENABLE_GCOV "Enable integration with gcov, a code coverage program" OFF)
|
||||
|
||||
option(ENABLE_GPROF
|
||||
"Enable integration with gprof, a performance analyzing tool" OFF)
|
||||
"Enable integration with gprof, a performance analyzing tool" OFF)
|
||||
|
||||
option(ENABLE_ASAN
|
||||
"Enable AddressSanitizer, a fast memory error detector based on compiler instrumentation" OFF)
|
||||
option(
|
||||
ENABLE_ASAN
|
||||
"Enable AddressSanitizer, a fast memory error detector based on compiler instrumentation"
|
||||
OFF)
|
||||
|
||||
option(ENABLE_UBSAN
|
||||
"Enable UndefinedBehaviorSanitizer, a fast undefined behavior detector based on compiler instrumentation" OFF)
|
||||
option(
|
||||
ENABLE_UBSAN
|
||||
"Enable UndefinedBehaviorSanitizer, a fast undefined behavior detector based on compiler instrumentation"
|
||||
OFF)
|
||||
|
||||
if(ENABLE_MEMCHECK)
|
||||
if(CMAKE_CXX_COMPILER_LOADED)
|
||||
@ -55,7 +58,10 @@ if(ENABLE_MEMCHECK)
|
||||
check_include_file(valgrind/memcheck.h HAVE_VALGRIND_MEMCHECK_H)
|
||||
endif()
|
||||
if(NOT HAVE_VALGRIND_MEMCHECK_H)
|
||||
message(FATAL_ERROR "${MEMCHECK_OPTION_NAME} option is set but valgrind/memcheck.h is not found")
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"${MEMCHECK_OPTION_NAME} option is set but valgrind/memcheck.h is not found"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
## Copyright (c) 2012-2024 Леонид Юрьев aka Leonid Yuriev <leo@yuriev.ru>
|
||||
## SPDX-License-Identifier: Apache-2.0
|
||||
# Copyright (c) 2012-2024 Леонид Юрьев aka Leonid Yuriev <leo@yuriev.ru>
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
if(CMAKE_VERSION VERSION_LESS 3.8.2)
|
||||
cmake_minimum_required(VERSION 3.0.2)
|
||||
@ -27,8 +27,10 @@ macro(add_compile_flags languages)
|
||||
endmacro(add_compile_flags)
|
||||
|
||||
macro(remove_flag varname flag)
|
||||
string(REGEX REPLACE "^(.*)( ${flag} )(.*)$" "\\1 \\3" ${varname} ${${varname}})
|
||||
string(REGEX REPLACE "^((.+ )*)(${flag})(( .+)*)$" "\\1\\4" ${varname} ${${varname}})
|
||||
string(REGEX REPLACE "^(.*)( ${flag} )(.*)$" "\\1 \\3" ${varname}
|
||||
${${varname}})
|
||||
string(REGEX REPLACE "^((.+ )*)(${flag})(( .+)*)$" "\\1\\4" ${varname}
|
||||
${${varname}})
|
||||
endmacro(remove_flag)
|
||||
|
||||
macro(remove_compile_flag languages flag)
|
||||
@ -49,9 +51,9 @@ macro(set_source_files_compile_flags)
|
||||
set(_lang "")
|
||||
if("${_file_ext}" STREQUAL ".m")
|
||||
set(_lang OBJC)
|
||||
# CMake believes that Objective C is a flavor of C++, not C,
|
||||
# and uses g++ compiler for .m files.
|
||||
# LANGUAGE property forces CMake to use CC for ${file}
|
||||
# CMake believes that Objective C is a flavor of C++, not C, and uses g++
|
||||
# compiler for .m files. LANGUAGE property forces CMake to use CC for
|
||||
# ${file}
|
||||
set_source_files_properties(${file} PROPERTIES LANGUAGE C)
|
||||
elseif("${_file_ext}" STREQUAL ".mm")
|
||||
set(_lang OBJCXX)
|
||||
@ -65,15 +67,15 @@ macro(set_source_files_compile_flags)
|
||||
set(_flags "${_flags} ${CMAKE_${_lang}_FLAGS}")
|
||||
endif()
|
||||
# message(STATUS "Set (${file} ${_flags}")
|
||||
set_source_files_properties(${file} PROPERTIES COMPILE_FLAGS
|
||||
"${_flags}")
|
||||
set_source_files_properties(${file} PROPERTIES COMPILE_FLAGS "${_flags}")
|
||||
endif()
|
||||
endforeach()
|
||||
unset(_file_ext)
|
||||
unset(_lang)
|
||||
endmacro(set_source_files_compile_flags)
|
||||
|
||||
macro(fetch_version name source_root_directory parent_scope build_directory_for_json_output)
|
||||
macro(fetch_version name source_root_directory parent_scope
|
||||
build_directory_for_json_output)
|
||||
set(_version_4dot "")
|
||||
set(_git_describe "")
|
||||
set(_git_timestamp "")
|
||||
@ -86,7 +88,8 @@ macro(fetch_version name source_root_directory parent_scope build_directory_for_
|
||||
|
||||
find_program(GIT git)
|
||||
if(GIT)
|
||||
execute_process(COMMAND ${GIT} rev-parse --show-toplevel
|
||||
execute_process(
|
||||
COMMAND ${GIT} rev-parse --show-toplevel
|
||||
OUTPUT_VARIABLE _git_root
|
||||
ERROR_VARIABLE _git_root_error
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
@ -94,9 +97,11 @@ macro(fetch_version name source_root_directory parent_scope build_directory_for_
|
||||
RESULT_VARIABLE _rc)
|
||||
if(_rc OR _git_root STREQUAL "")
|
||||
if(EXISTS "${source_root_directory}/.git")
|
||||
message(ERROR "`git rev-parse --show-toplevel` failed '${_git_root_error}'")
|
||||
message(ERROR
|
||||
"`git rev-parse --show-toplevel` failed '${_git_root_error}'")
|
||||
else()
|
||||
message(VERBOSE "`git rev-parse --show-toplevel` failed '${_git_root_error}'")
|
||||
message(VERBOSE
|
||||
"`git rev-parse --show-toplevel` failed '${_git_root_error}'")
|
||||
endif()
|
||||
else()
|
||||
set(_source_root "${source_root_directory}")
|
||||
@ -105,7 +110,10 @@ macro(fetch_version name source_root_directory parent_scope build_directory_for_
|
||||
cmake_path(NORMAL_PATH _source_root)
|
||||
endif()
|
||||
if(_source_root STREQUAL _git_root AND EXISTS "${_git_root}/VERSION.json")
|
||||
message(FATAL_ERROR "Несколько источников информации о версии, допустим только один из: репозиторий git, либо файл VERSION.json")
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"Несколько источников информации о версии, допустим только один из: репозиторий git, либо файл VERSION.json"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
@ -114,9 +122,14 @@ macro(fetch_version name source_root_directory parent_scope build_directory_for_
|
||||
set(_version_from "${source_root_directory}/VERSION.json")
|
||||
|
||||
if(CMAKE_VERSION VERSION_LESS 3.19)
|
||||
message(FATAL_ERROR "Требуется CMake версии >= 3.19 для чтения VERSION.json")
|
||||
message(
|
||||
FATAL_ERROR "Требуется CMake версии >= 3.19 для чтения VERSION.json")
|
||||
endif()
|
||||
file(STRINGS "${_version_from}" _versioninfo_json NEWLINE_CONSUME LIMIT_COUNT 9 LIMIT_INPUT 999 ENCODING UTF-8)
|
||||
file(
|
||||
STRINGS "${_version_from}" _versioninfo_json NEWLINE_CONSUME
|
||||
LIMIT_COUNT 9
|
||||
LIMIT_INPUT 999
|
||||
ENCODING UTF-8)
|
||||
string(JSON _git_describe GET ${_versioninfo_json} git_describe)
|
||||
string(JSON _git_timestamp GET "${_versioninfo_json}" "git_timestamp")
|
||||
string(JSON _git_tree GET "${_versioninfo_json}" "git_tree")
|
||||
@ -126,7 +139,9 @@ macro(fetch_version name source_root_directory parent_scope build_directory_for_
|
||||
string(REPLACE "." ";" _version_list "${_version_4dot}")
|
||||
|
||||
if(NOT _version_4dot)
|
||||
message(ERROR "Unable to retrieve ${name} version from \"${_version_from}\" file.")
|
||||
message(
|
||||
ERROR
|
||||
"Unable to retrieve ${name} version from \"${_version_from}\" file.")
|
||||
set(_version_list ${_git_version})
|
||||
string(REPLACE ";" "." _version_4dot "${_git_version}")
|
||||
else()
|
||||
@ -136,158 +151,221 @@ macro(fetch_version name source_root_directory parent_scope build_directory_for_
|
||||
elseif(_git_root AND _source_root STREQUAL _git_root)
|
||||
set(_version_from git)
|
||||
|
||||
execute_process(COMMAND ${GIT} show --no-patch --format=%cI HEAD
|
||||
execute_process(
|
||||
COMMAND ${GIT} show --no-patch --format=%cI HEAD
|
||||
OUTPUT_VARIABLE _git_timestamp
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
WORKING_DIRECTORY ${source_root_directory}
|
||||
RESULT_VARIABLE _rc)
|
||||
if(_rc OR _git_timestamp STREQUAL "%cI")
|
||||
execute_process(COMMAND ${GIT} show --no-patch --format=%ci HEAD
|
||||
execute_process(
|
||||
COMMAND ${GIT} show --no-patch --format=%ci HEAD
|
||||
OUTPUT_VARIABLE _git_timestamp
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
WORKING_DIRECTORY ${source_root_directory}
|
||||
RESULT_VARIABLE _rc)
|
||||
if(_rc OR _git_timestamp STREQUAL "%ci")
|
||||
message(FATAL_ERROR "Please install latest version of git (`show --no-patch --format=%cI HEAD` failed)")
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"Please install latest version of git (`show --no-patch --format=%cI HEAD` failed)"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
execute_process(COMMAND ${GIT} show --no-patch --format=%T HEAD
|
||||
execute_process(
|
||||
COMMAND ${GIT} show --no-patch --format=%T HEAD
|
||||
OUTPUT_VARIABLE _git_tree
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
WORKING_DIRECTORY ${source_root_directory}
|
||||
RESULT_VARIABLE _rc)
|
||||
if(_rc OR _git_tree STREQUAL "")
|
||||
message(FATAL_ERROR "Please install latest version of git (`show --no-patch --format=%T HEAD` failed)")
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"Please install latest version of git (`show --no-patch --format=%T HEAD` failed)"
|
||||
)
|
||||
endif()
|
||||
|
||||
execute_process(COMMAND ${GIT} show --no-patch --format=%H HEAD
|
||||
execute_process(
|
||||
COMMAND ${GIT} show --no-patch --format=%H HEAD
|
||||
OUTPUT_VARIABLE _git_commit
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
WORKING_DIRECTORY ${source_root_directory}
|
||||
RESULT_VARIABLE _rc)
|
||||
if(_rc OR _git_commit STREQUAL "")
|
||||
message(FATAL_ERROR "Please install latest version of git (`show --no-patch --format=%H HEAD` failed)")
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"Please install latest version of git (`show --no-patch --format=%H HEAD` failed)"
|
||||
)
|
||||
endif()
|
||||
|
||||
execute_process(COMMAND ${GIT} status --untracked-files=no --porcelain
|
||||
execute_process(
|
||||
COMMAND ${GIT} status --untracked-files=no --porcelain
|
||||
OUTPUT_VARIABLE _git_status
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
WORKING_DIRECTORY ${source_root_directory}
|
||||
RESULT_VARIABLE _rc)
|
||||
if(_rc)
|
||||
message(FATAL_ERROR "Please install latest version of git (`status --untracked-files=no --porcelain` failed)")
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"Please install latest version of git (`status --untracked-files=no --porcelain` failed)"
|
||||
)
|
||||
endif()
|
||||
if(NOT _git_status STREQUAL "")
|
||||
set(_git_commit "${_git_commit}-dirty")
|
||||
endif()
|
||||
unset(_git_status)
|
||||
|
||||
execute_process(COMMAND ${GIT} rev-list --tags --count
|
||||
execute_process(
|
||||
COMMAND ${GIT} rev-list --tags --count
|
||||
OUTPUT_VARIABLE _tag_count
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
WORKING_DIRECTORY ${source_root_directory}
|
||||
RESULT_VARIABLE _rc)
|
||||
if(_rc)
|
||||
message(FATAL_ERROR "Please install latest version of git (`git rev-list --tags --count` failed)")
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"Please install latest version of git (`git rev-list --tags --count` failed)"
|
||||
)
|
||||
endif()
|
||||
|
||||
if(_tag_count EQUAL 0)
|
||||
execute_process(COMMAND ${GIT} rev-list --all --count
|
||||
execute_process(
|
||||
COMMAND ${GIT} rev-list --all --count
|
||||
OUTPUT_VARIABLE _whole_count
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
WORKING_DIRECTORY ${source_root_directory}
|
||||
RESULT_VARIABLE _rc)
|
||||
if(_rc)
|
||||
message(FATAL_ERROR "Please install latest version of git (`git rev-list --all --count` failed)")
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"Please install latest version of git (`git rev-list --all --count` failed)"
|
||||
)
|
||||
endif()
|
||||
if(_whole_count GREATER 42)
|
||||
message(FATAL_ERROR "Please fetch tags (no any tags for ${_whole_count} commits)")
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"Please fetch tags (no any tags for ${_whole_count} commits)")
|
||||
endif()
|
||||
set(_git_version "0;0;0")
|
||||
execute_process(COMMAND ${GIT} rev-list --count --all --no-merges
|
||||
execute_process(
|
||||
COMMAND ${GIT} rev-list --count --all --no-merges
|
||||
OUTPUT_VARIABLE _git_revision
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
WORKING_DIRECTORY ${source_root_directory}
|
||||
RESULT_VARIABLE _rc)
|
||||
if(_rc OR _git_revision STREQUAL "")
|
||||
message(FATAL_ERROR "Please install latest version of git (`rev-list --count --all --no-merges` failed)")
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"Please install latest version of git (`rev-list --count --all --no-merges` failed)"
|
||||
)
|
||||
endif()
|
||||
else(_tag_count EQUAL 0)
|
||||
execute_process(COMMAND ${GIT} describe --tags --long --dirty=-dirty "--match=v[0-9]*"
|
||||
execute_process(
|
||||
COMMAND ${GIT} describe --tags --long --dirty=-dirty "--match=v[0-9]*"
|
||||
OUTPUT_VARIABLE _git_describe
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
WORKING_DIRECTORY ${source_root_directory}
|
||||
RESULT_VARIABLE _rc)
|
||||
if(_rc OR _git_describe STREQUAL "")
|
||||
execute_process(COMMAND ${GIT} rev-list --all --count
|
||||
execute_process(
|
||||
COMMAND ${GIT} rev-list --all --count
|
||||
OUTPUT_VARIABLE _whole_count
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
WORKING_DIRECTORY ${source_root_directory}
|
||||
RESULT_VARIABLE _rc)
|
||||
if(_rc)
|
||||
message(FATAL_ERROR "Please install latest version of git (`git rev-list --all --count` failed)")
|
||||
RESULT_VARIABLE _rc)
|
||||
if(_rc)
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"Please install latest version of git (`git rev-list --all --count` failed)"
|
||||
)
|
||||
endif()
|
||||
if(_whole_count GREATER 42)
|
||||
message(FATAL_ERROR "Please fetch tags (`describe --tags --long --dirty --match=v[0-9]*` failed)")
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"Please fetch tags (`describe --tags --long --dirty --match=v[0-9]*` failed)"
|
||||
)
|
||||
else()
|
||||
execute_process(COMMAND ${GIT} describe --all --long --dirty=-dirty
|
||||
execute_process(
|
||||
COMMAND ${GIT} describe --all --long --dirty=-dirty
|
||||
OUTPUT_VARIABLE _git_describe
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
WORKING_DIRECTORY ${source_root_directory}
|
||||
RESULT_VARIABLE _rc)
|
||||
if(_rc OR _git_describe STREQUAL "")
|
||||
message(FATAL_ERROR "Please install latest version of git (`git rev-list --tags --count` and/or `git rev-list --all --count` failed)")
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"Please install latest version of git (`git rev-list --tags --count` and/or `git rev-list --all --count` failed)"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
execute_process(COMMAND ${GIT} describe --tags --abbrev=0 "--match=v[0-9]*"
|
||||
execute_process(
|
||||
COMMAND ${GIT} describe --tags --abbrev=0 "--match=v[0-9]*"
|
||||
OUTPUT_VARIABLE _last_release_tag
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
WORKING_DIRECTORY ${source_root_directory}
|
||||
RESULT_VARIABLE _rc)
|
||||
if(_rc)
|
||||
message(FATAL_ERROR "Please install latest version of git (`describe --tags --abbrev=0 --match=v[0-9]*` failed)")
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"Please install latest version of git (`describe --tags --abbrev=0 --match=v[0-9]*` failed)"
|
||||
)
|
||||
endif()
|
||||
if (_last_release_tag)
|
||||
if(_last_release_tag)
|
||||
set(_git_revlist_arg "${_last_release_tag}..HEAD")
|
||||
else()
|
||||
execute_process(COMMAND ${GIT} tag --sort=-version:refname
|
||||
execute_process(
|
||||
COMMAND ${GIT} tag --sort=-version:refname
|
||||
OUTPUT_VARIABLE _tag_list
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
WORKING_DIRECTORY ${source_root_directory}
|
||||
RESULT_VARIABLE _rc)
|
||||
if(_rc)
|
||||
message(FATAL_ERROR "Please install latest version of git (`tag --sort=-version:refname` failed)")
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"Please install latest version of git (`tag --sort=-version:refname` failed)"
|
||||
)
|
||||
endif()
|
||||
string(REGEX REPLACE "\n" ";" _tag_list "${_tag_list}")
|
||||
set(_git_revlist_arg "HEAD")
|
||||
foreach(_tag IN LISTS _tag_list)
|
||||
if(NOT _last_release_tag)
|
||||
string(REGEX MATCH "^v[0-9]+(\.[0-9]+)+" _last_release_tag "${_tag}")
|
||||
string(REGEX MATCH "^v[0-9]+(\.[0-9]+)+" _last_release_tag
|
||||
"${_tag}")
|
||||
set(_git_revlist_arg "${_tag}..HEAD")
|
||||
endif()
|
||||
endforeach(_tag)
|
||||
endif()
|
||||
execute_process(COMMAND ${GIT} rev-list --count "${_git_revlist_arg}"
|
||||
execute_process(
|
||||
COMMAND ${GIT} rev-list --count "${_git_revlist_arg}"
|
||||
OUTPUT_VARIABLE _git_revision
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
WORKING_DIRECTORY ${source_root_directory}
|
||||
RESULT_VARIABLE _rc)
|
||||
if(_rc OR _git_revision STREQUAL "")
|
||||
message(FATAL_ERROR "Please install latest version of git (`rev-list --count ${_git_revlist_arg}` failed)")
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"Please install latest version of git (`rev-list --count ${_git_revlist_arg}` failed)"
|
||||
)
|
||||
endif()
|
||||
|
||||
string(REGEX MATCH "^(v)?([0-9]+)\\.([0-9]+)\\.([0-9]+)(.*)?" _git_version_valid "${_git_describe}")
|
||||
string(REGEX MATCH "^(v)?([0-9]+)\\.([0-9]+)\\.([0-9]+)(.*)?"
|
||||
_git_version_valid "${_git_describe}")
|
||||
if(_git_version_valid)
|
||||
string(REGEX REPLACE "^(v)?([0-9]+)\\.([0-9]+)\\.([0-9]+)(.*)?" "\\2;\\3;\\4" _git_version ${_git_describe})
|
||||
string(REGEX REPLACE "^(v)?([0-9]+)\\.([0-9]+)\\.([0-9]+)(.*)?"
|
||||
"\\2;\\3;\\4" _git_version ${_git_describe})
|
||||
else()
|
||||
string(REGEX MATCH "^(v)?([0-9]+)\\.([0-9]+)(.*)?" _git_version_valid "${_git_describe}")
|
||||
string(REGEX MATCH "^(v)?([0-9]+)\\.([0-9]+)(.*)?" _git_version_valid
|
||||
"${_git_describe}")
|
||||
if(_git_version_valid)
|
||||
string(REGEX REPLACE "^(v)?([0-9]+)\\.([0-9]+)(.*)?" "\\2;\\3;0" _git_version ${_git_describe})
|
||||
string(REGEX REPLACE "^(v)?([0-9]+)\\.([0-9]+)(.*)?" "\\2;\\3;0"
|
||||
_git_version ${_git_describe})
|
||||
else()
|
||||
message(AUTHOR_WARNING "Bad ${name} version \"${_git_describe}\"; falling back to 0.0.0 (have you made an initial release?)")
|
||||
message(
|
||||
AUTHOR_WARNING
|
||||
"Bad ${name} version \"${_git_describe}\"; falling back to 0.0.0 (have you made an initial release?)"
|
||||
)
|
||||
set(_git_version "0;0;0")
|
||||
endif()
|
||||
endif()
|
||||
@ -298,7 +376,10 @@ macro(fetch_version name source_root_directory parent_scope build_directory_for_
|
||||
string(REPLACE ";" "." _version_4dot "${_version_list}")
|
||||
|
||||
elseif(GIT)
|
||||
message(FATAL_ERROR "Нет источника информации о версии (${source_root_directory}), требуется один из: репозиторий git, либо VERSION.json")
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"Нет источника информации о версии (${source_root_directory}), требуется один из: репозиторий git, либо VERSION.json"
|
||||
)
|
||||
else()
|
||||
message(FATAL_ERROR "Требуется git для получения информации о версии")
|
||||
endif()
|
||||
@ -309,24 +390,53 @@ macro(fetch_version name source_root_directory parent_scope build_directory_for_
|
||||
list(GET _version_list 2 _version_release)
|
||||
list(GET _version_list 3 _version_revision)
|
||||
|
||||
if(NOT _git_describe OR NOT _git_timestamp OR NOT _git_tree OR NOT _git_commit OR _git_revision STREQUAL "" OR NOT _version_list_length EQUAL 4 OR _version_major STREQUAL "" OR _version_minor STREQUAL "" OR _version_release STREQUAL "" OR _version_revision STREQUAL "")
|
||||
if(NOT _git_describe
|
||||
OR NOT _git_timestamp
|
||||
OR NOT _git_tree
|
||||
OR NOT _git_commit
|
||||
OR _git_revision STREQUAL ""
|
||||
OR NOT _version_list_length EQUAL 4
|
||||
OR _version_major STREQUAL ""
|
||||
OR _version_minor STREQUAL ""
|
||||
OR _version_release STREQUAL ""
|
||||
OR _version_revision STREQUAL "")
|
||||
message(ERROR "Unable to retrieve ${name} version from ${_version_from}.")
|
||||
else()
|
||||
list(APPEND _git_version "${_git_revision}")
|
||||
endif()
|
||||
|
||||
if(${parent_scope})
|
||||
set(${name}_VERSION_MAJOR "${_version_major}" PARENT_SCOPE)
|
||||
set(${name}_VERSION_MINOR "${_version_minor}" PARENT_SCOPE)
|
||||
set(${name}_VERSION_RELEASE "${_version_release}" PARENT_SCOPE)
|
||||
set(${name}_VERSION_REVISION "${_version_revision}" PARENT_SCOPE)
|
||||
set(${name}_VERSION "${_version_4dot}" PARENT_SCOPE)
|
||||
set(${name}_VERSION_MAJOR
|
||||
"${_version_major}"
|
||||
PARENT_SCOPE)
|
||||
set(${name}_VERSION_MINOR
|
||||
"${_version_minor}"
|
||||
PARENT_SCOPE)
|
||||
set(${name}_VERSION_RELEASE
|
||||
"${_version_release}"
|
||||
PARENT_SCOPE)
|
||||
set(${name}_VERSION_REVISION
|
||||
"${_version_revision}"
|
||||
PARENT_SCOPE)
|
||||
set(${name}_VERSION
|
||||
"${_version_4dot}"
|
||||
PARENT_SCOPE)
|
||||
|
||||
set(${name}_GIT_DESCRIBE "${_git_describe}" PARENT_SCOPE)
|
||||
set(${name}_GIT_TIMESTAMP "${_git_timestamp}" PARENT_SCOPE)
|
||||
set(${name}_GIT_TREE "${_git_tree}" PARENT_SCOPE)
|
||||
set(${name}_GIT_COMMIT "${_git_commit}" PARENT_SCOPE)
|
||||
set(${name}_GIT_REVISION "${_git_revision}" PARENT_SCOPE)
|
||||
set(${name}_GIT_DESCRIBE
|
||||
"${_git_describe}"
|
||||
PARENT_SCOPE)
|
||||
set(${name}_GIT_TIMESTAMP
|
||||
"${_git_timestamp}"
|
||||
PARENT_SCOPE)
|
||||
set(${name}_GIT_TREE
|
||||
"${_git_tree}"
|
||||
PARENT_SCOPE)
|
||||
set(${name}_GIT_COMMIT
|
||||
"${_git_commit}"
|
||||
PARENT_SCOPE)
|
||||
set(${name}_GIT_REVISION
|
||||
"${_git_revision}"
|
||||
PARENT_SCOPE)
|
||||
else()
|
||||
set(${name}_VERSION_MAJOR "${_version_major}")
|
||||
set(${name}_VERSION_MINOR "${_version_minor}")
|
||||
@ -342,13 +452,18 @@ macro(fetch_version name source_root_directory parent_scope build_directory_for_
|
||||
endif()
|
||||
|
||||
if(_version_from STREQUAL "git")
|
||||
string(CONFIGURE "{
|
||||
string(
|
||||
CONFIGURE
|
||||
"{
|
||||
\"git_describe\" : \"@_git_describe@\",
|
||||
\"git_timestamp\" : \"@_git_timestamp@\",
|
||||
\"git_tree\" : \"@_git_tree@\",
|
||||
\"git_commit\" : \"@_git_commit@\",
|
||||
\"version_4dot\" : \"@_version_4dot@\"\n}" _versioninfo_json @ONLY ESCAPE_QUOTES)
|
||||
file(WRITE "${build_directory_for_json_output}/VERSION.json" "${_versioninfo_json}")
|
||||
\"version_4dot\" : \"@_version_4dot@\"\n}"
|
||||
_versioninfo_json
|
||||
@ONLY ESCAPE_QUOTES)
|
||||
file(WRITE "${build_directory_for_json_output}/VERSION.json"
|
||||
"${_versioninfo_json}")
|
||||
endif()
|
||||
endmacro(fetch_version)
|
||||
|
||||
|
@ -1,38 +1,37 @@
|
||||
## Copyright (c) 2020-2024 Леонид Юрьев aka Leonid Yuriev <leo@yuriev.ru>
|
||||
## SPDX-License-Identifier: Apache-2.0
|
||||
# Copyright (c) 2020-2024 Леонид Юрьев aka Leonid Yuriev <leo@yuriev.ru>
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
enable_language(CXX)
|
||||
include(../cmake/compiler.cmake)
|
||||
|
||||
set(LIBMDBX_TEST_SOURCES
|
||||
base.h++
|
||||
cases.c++
|
||||
chrono.c++
|
||||
chrono.h++
|
||||
config.c++
|
||||
config.h++
|
||||
copy.c++
|
||||
dead.c++
|
||||
hill.c++
|
||||
jitter.c++
|
||||
keygen.c++
|
||||
keygen.h++
|
||||
log.c++
|
||||
log.h++
|
||||
main.c++
|
||||
osal.h++
|
||||
osal-unix.c++
|
||||
osal-windows.c++
|
||||
test.c++
|
||||
test.h++
|
||||
try.c++
|
||||
utils.c++
|
||||
utils.h++
|
||||
append.c++
|
||||
ttl.c++
|
||||
nested.c++
|
||||
fork.c++
|
||||
)
|
||||
base.h++
|
||||
cases.c++
|
||||
chrono.c++
|
||||
chrono.h++
|
||||
config.c++
|
||||
config.h++
|
||||
copy.c++
|
||||
dead.c++
|
||||
hill.c++
|
||||
jitter.c++
|
||||
keygen.c++
|
||||
keygen.h++
|
||||
log.c++
|
||||
log.h++
|
||||
main.c++
|
||||
osal.h++
|
||||
osal-unix.c++
|
||||
osal-windows.c++
|
||||
test.c++
|
||||
test.h++
|
||||
try.c++
|
||||
utils.c++
|
||||
utils.h++
|
||||
append.c++
|
||||
ttl.c++
|
||||
nested.c++
|
||||
fork.c++)
|
||||
|
||||
if(NOT MDBX_BUILD_CXX)
|
||||
probe_libcxx_filesystem()
|
||||
@ -43,12 +42,13 @@ add_executable(mdbx_test ${LIBMDBX_TEST_SOURCES})
|
||||
target_compile_definitions(mdbx_test PRIVATE MDBX_BUILD_TEST=1 MDBX_BUILD_CXX=1)
|
||||
|
||||
if(MDBX_CXX_STANDARD)
|
||||
set_target_properties(mdbx_test PROPERTIES
|
||||
CXX_STANDARD ${MDBX_CXX_STANDARD} CXX_STANDARD_REQUIRED ON)
|
||||
set_target_properties(mdbx_test PROPERTIES CXX_STANDARD ${MDBX_CXX_STANDARD}
|
||||
CXX_STANDARD_REQUIRED ON)
|
||||
endif()
|
||||
|
||||
set_target_properties(mdbx_test PROPERTIES
|
||||
INTERPROCEDURAL_OPTIMIZATION $<BOOL:${INTERPROCEDURAL_OPTIMIZATION}>)
|
||||
set_target_properties(
|
||||
mdbx_test PROPERTIES INTERPROCEDURAL_OPTIMIZATION
|
||||
$<BOOL:${INTERPROCEDURAL_OPTIMIZATION}>)
|
||||
target_setup_options(mdbx_test)
|
||||
|
||||
if(NOT MDBX_BUILD_CXX)
|
||||
@ -59,15 +59,17 @@ if(NOT MDBX_BUILD_CXX)
|
||||
endif()
|
||||
|
||||
if(NOT MDBX_BUILD_CXX AND LIBCXX_FILESYSTEM)
|
||||
if(CMAKE_COMPILER_IS_ELBRUSCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 1.25.23
|
||||
AND NOT CMAKE_VERSION VERSION_LESS 3.13)
|
||||
if(CMAKE_COMPILER_IS_ELBRUSCXX
|
||||
AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 1.25.23
|
||||
AND NOT CMAKE_VERSION VERSION_LESS 3.13)
|
||||
target_link_options(mdbx_test PRIVATE "-Wl,--allow-multiple-definition")
|
||||
endif()
|
||||
target_link_libraries(mdbx_test ${LIBCXX_FILESYSTEM})
|
||||
endif()
|
||||
|
||||
if(CMAKE_VERSION VERSION_LESS 3.1)
|
||||
target_link_libraries(mdbx_test ${TOOL_MDBX_LIB} ${LIB_MATH} ${CMAKE_THREAD_LIBS_INIT})
|
||||
target_link_libraries(mdbx_test ${TOOL_MDBX_LIB} ${LIB_MATH}
|
||||
${CMAKE_THREAD_LIBS_INIT})
|
||||
else()
|
||||
target_link_libraries(mdbx_test ${TOOL_MDBX_LIB} ${LIB_MATH} Threads::Threads)
|
||||
endif()
|
||||
@ -79,10 +81,14 @@ function(add_extra_test name)
|
||||
set(options DISABLED)
|
||||
set(oneValueArgs TIMEOUT)
|
||||
set(multiValueArgs SOURCE LIBRARY DEPEND DLLPATH)
|
||||
cmake_parse_arguments(params "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
cmake_parse_arguments(params "${options}" "${oneValueArgs}"
|
||||
"${multiValueArgs}" ${ARGN})
|
||||
|
||||
if(params_UNPARSED_ARGUMENTS)
|
||||
message(FATAL_ERROR "Unknown keywords given to add_extra_test(): \"${params_UNPARSED_ARGUMENTS}\".")
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"Unknown keywords given to add_extra_test(): \"${params_UNPARSED_ARGUMENTS}\"."
|
||||
)
|
||||
endif()
|
||||
|
||||
macro(oops)
|
||||
@ -97,13 +103,12 @@ function(add_extra_test name)
|
||||
add_executable(${target} ${params_SOURCE})
|
||||
target_include_directories(${target} PRIVATE "${PROJECT_SOURCE_DIR}")
|
||||
target_link_libraries(${target} ${TOOL_MDBX_LIB})
|
||||
set_target_properties(${target} PROPERTIES
|
||||
SKIP_BUILD_RPATH FALSE
|
||||
BUILD_WITH_INSTALL_RPATH FALSE)
|
||||
set_target_properties(${target} PROPERTIES SKIP_BUILD_RPATH FALSE
|
||||
BUILD_WITH_INSTALL_RPATH FALSE)
|
||||
|
||||
if(MDBX_BUILD_CXX AND MDBX_CXX_STANDARD)
|
||||
set_target_properties(${target} PROPERTIES
|
||||
CXX_STANDARD ${MDBX_CXX_STANDARD} CXX_STANDARD_REQUIRED ON)
|
||||
set_target_properties(${target} PROPERTIES CXX_STANDARD ${MDBX_CXX_STANDARD}
|
||||
CXX_STANDARD_REQUIRED ON)
|
||||
endif()
|
||||
|
||||
if(params_DEPEND)
|
||||
@ -115,26 +120,32 @@ function(add_extra_test name)
|
||||
foreach(dep IN LISTS params_LIBRARY)
|
||||
get_target_property(type ${dep} TYPE)
|
||||
if(type STREQUAL SHARED_LIBRARY)
|
||||
# Windows don't have RPATH feature,
|
||||
# therefore we should prepare PATH or copy DLL(s)...
|
||||
# Windows don't have RPATH feature, therefore we should prepare PATH or
|
||||
# copy DLL(s)...
|
||||
if(CMAKE_CONFIGURATION_TYPES)
|
||||
# Could not provide static ENVIRONMENT property with configuration-depended path
|
||||
# Could not provide static ENVIRONMENT property with
|
||||
# configuration-depended path
|
||||
set(dir FALSE)
|
||||
else(CMAKE_CONFIGURATION_TYPES)
|
||||
get_target_property(filename ${dep} IMPORTED_LOCATION_${CMAKE_BUILD_TYPE_UPPERCASE})
|
||||
get_target_property(filename ${dep}
|
||||
IMPORTED_LOCATION_${CMAKE_BUILD_TYPE_UPPERCASE})
|
||||
if(NOT filename)
|
||||
get_target_property(filename ${dep} IMPORTED_LOCATION)
|
||||
endif()
|
||||
get_target_property(filename ${dep} LOCATION_${CMAKE_BUILD_TYPE_UPPERCASE})
|
||||
get_target_property(filename ${dep}
|
||||
LOCATION_${CMAKE_BUILD_TYPE_UPPERCASE})
|
||||
if(NOT filename)
|
||||
get_target_property(filename ${dep} LOCATION)
|
||||
endif()
|
||||
if(filename)
|
||||
get_filename_component(dir ${filename} DIRECTORY)
|
||||
else(filename)
|
||||
get_target_property(dir ${dep} LIBRARY_OUTPUT_DIRECTORY_${CMAKE_BUILD_TYPE_UPPERCASE})
|
||||
get_target_property(
|
||||
dir ${dep} LIBRARY_OUTPUT_DIRECTORY_${CMAKE_BUILD_TYPE_UPPERCASE})
|
||||
if(NOT dir)
|
||||
get_target_property(dir ${dep} RUNTIME_OUTPUT_DIRECTORY_${CMAKE_BUILD_TYPE_UPPERCASE})
|
||||
get_target_property(
|
||||
dir ${dep}
|
||||
RUNTIME_OUTPUT_DIRECTORY_${CMAKE_BUILD_TYPE_UPPERCASE})
|
||||
endif()
|
||||
if(NOT dir)
|
||||
get_target_property(dir ${dep} LIBRARY_OUTPUT_DIRECTORY)
|
||||
@ -148,23 +159,35 @@ function(add_extra_test name)
|
||||
list(APPEND params_DLLPATH ${dir})
|
||||
else(dir)
|
||||
# Path is configuration-depended or not available, should copy dll
|
||||
add_custom_command(TARGET ${target} POST_BUILD
|
||||
COMMAND if exist "$<TARGET_PDB_FILE:${dep}>"
|
||||
${CMAKE_COMMAND} -E copy_if_different "$<TARGET_PDB_FILE:${dep}>" "$<TARGET_FILE_DIR:${target}>")
|
||||
add_custom_command(TARGET ${target} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_FILE:${dep}>" "$<TARGET_FILE_DIR:${target}>"
|
||||
COMMENT "${TOOL_MDBX_DLLCRUTCH}: Copy shared library ${dep} for test ${target}")
|
||||
add_custom_command(
|
||||
TARGET ${target}
|
||||
POST_BUILD
|
||||
COMMAND
|
||||
if exist "$<TARGET_PDB_FILE:${dep}>" ${CMAKE_COMMAND} -E
|
||||
copy_if_different "$<TARGET_PDB_FILE:${dep}>"
|
||||
"$<TARGET_FILE_DIR:${target}>")
|
||||
add_custom_command(
|
||||
TARGET ${target}
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
"$<TARGET_FILE:${dep}>" "$<TARGET_FILE_DIR:${target}>"
|
||||
COMMENT
|
||||
"${TOOL_MDBX_DLLCRUTCH}: Copy shared library ${dep} for test ${target}"
|
||||
)
|
||||
endif(dir)
|
||||
endif()
|
||||
endforeach(dep)
|
||||
endif(TOOL_MDBX_DLLCRUTCH)
|
||||
|
||||
if(NOT params_DISABLED AND NOT (CMAKE_CROSSCOMPILING AND NOT CMAKE_CROSSCOMPILING_EMULATOR))
|
||||
if(NOT params_DISABLED AND NOT (CMAKE_CROSSCOMPILING
|
||||
AND NOT CMAKE_CROSSCOMPILING_EMULATOR))
|
||||
add_test(extra_${name} ${MDBX_OUTPUT_DIR}/${target})
|
||||
if(params_TIMEOUT)
|
||||
if(MEMORYCHECK_COMMAND OR CMAKE_MEMORYCHECK_COMMAND OR ENABLE_MEMCHECK)
|
||||
# FIXME: unless there are any other ideas how to fix the
|
||||
# timeouts problem when testing under Valgrind.
|
||||
if(MEMORYCHECK_COMMAND
|
||||
OR CMAKE_MEMORYCHECK_COMMAND
|
||||
OR ENABLE_MEMCHECK)
|
||||
# FIXME: unless there are any other ideas how to fix the timeouts
|
||||
# problem when testing under Valgrind.
|
||||
math(EXPR params_TIMEOUT "${params_TIMEOUT} * 42")
|
||||
endif()
|
||||
set_tests_properties(extra_${name} PROPERTIES TIMEOUT ${params_TIMEOUT})
|
||||
@ -183,7 +206,8 @@ function(add_extra_test name)
|
||||
else()
|
||||
string(REPLACE ";" ":" params_DLLPATH_ENV "${params_DLLPATH_ENV}")
|
||||
endif()
|
||||
set_tests_properties(extra_${name} PROPERTIES ENVIRONMENT "PATH=${params_DLLPATH_ENV}")
|
||||
set_tests_properties(extra_${name}
|
||||
PROPERTIES ENVIRONMENT "PATH=${params_DLLPATH_ENV}")
|
||||
endif()
|
||||
endif()
|
||||
endfunction(add_extra_test)
|
||||
@ -196,80 +220,116 @@ if(NOT SUBPROJECT)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
# ##############################################################################
|
||||
|
||||
if (CMAKE_CROSSCOMPILING AND NOT CMAKE_CROSSCOMPILING_EMULATOR)
|
||||
if(CMAKE_CROSSCOMPILING AND NOT CMAKE_CROSSCOMPILING_EMULATOR)
|
||||
message(WARNING "No emulator to run cross-compiled tests")
|
||||
add_test(NAME fake_since_no_crosscompiling_emulator COMMAND ${CMAKE_COMMAND} -E
|
||||
echo "No emulator to run cross-compiled tests")
|
||||
add_test(NAME fake_since_no_crosscompiling_emulator
|
||||
COMMAND ${CMAKE_COMMAND} -E echo
|
||||
"No emulator to run cross-compiled tests")
|
||||
else()
|
||||
|
||||
string(RANDOM LENGTH 9 ALPHABET "1234567890" test_seed)
|
||||
message(STATUS "The ${test_seed} will be used for seeding tests. Re-run cmake to re-seed it.")
|
||||
string(
|
||||
RANDOM
|
||||
LENGTH 9
|
||||
ALPHABET "1234567890" test_seed)
|
||||
message(
|
||||
STATUS
|
||||
"The ${test_seed} will be used for seeding tests. Re-run cmake to re-seed it."
|
||||
)
|
||||
|
||||
add_test(NAME smoke COMMAND ${MDBX_OUTPUT_DIR}/mdbx_test
|
||||
--loglevel=verbose
|
||||
--prng-seed=${test_seed}
|
||||
--progress --console=no --pathname=smoke.db --dont-cleanup-after basic)
|
||||
set_tests_properties(smoke PROPERTIES
|
||||
TIMEOUT 600
|
||||
RUN_SERIAL OFF)
|
||||
add_test(
|
||||
NAME smoke
|
||||
COMMAND
|
||||
${MDBX_OUTPUT_DIR}/mdbx_test --loglevel=verbose --prng-seed=${test_seed}
|
||||
--progress --console=no --pathname=smoke.db --dont-cleanup-after basic)
|
||||
set_tests_properties(smoke PROPERTIES TIMEOUT 600 RUN_SERIAL OFF)
|
||||
if(MDBX_BUILD_TOOLS)
|
||||
add_test(NAME smoke_chk COMMAND ${MDBX_OUTPUT_DIR}/mdbx_chk -nvv smoke.db)
|
||||
set_tests_properties(smoke_chk PROPERTIES
|
||||
DEPENDS smoke
|
||||
TIMEOUT 60
|
||||
FAIL_REGULAR_EXPRESSION "cooperative mode"
|
||||
REQUIRED_FILES smoke.db)
|
||||
add_test(NAME smoke_chk_copy COMMAND ${MDBX_OUTPUT_DIR}/mdbx_chk -nvv smoke.db-copy)
|
||||
set_tests_properties(smoke_chk_copy PROPERTIES
|
||||
DEPENDS smoke
|
||||
TIMEOUT 60
|
||||
FAIL_REGULAR_EXPRESSION "cooperative mode"
|
||||
REQUIRED_FILES smoke.db-copy)
|
||||
set_tests_properties(
|
||||
smoke_chk
|
||||
PROPERTIES DEPENDS
|
||||
smoke
|
||||
TIMEOUT
|
||||
60
|
||||
FAIL_REGULAR_EXPRESSION
|
||||
"cooperative mode"
|
||||
REQUIRED_FILES
|
||||
smoke.db)
|
||||
add_test(NAME smoke_chk_copy COMMAND ${MDBX_OUTPUT_DIR}/mdbx_chk -nvv
|
||||
smoke.db-copy)
|
||||
set_tests_properties(
|
||||
smoke_chk_copy
|
||||
PROPERTIES DEPENDS
|
||||
smoke
|
||||
TIMEOUT
|
||||
60
|
||||
FAIL_REGULAR_EXPRESSION
|
||||
"cooperative mode"
|
||||
REQUIRED_FILES
|
||||
smoke.db-copy)
|
||||
endif()
|
||||
|
||||
add_test(NAME dupsort_writemap COMMAND ${MDBX_OUTPUT_DIR}/mdbx_test
|
||||
--loglevel=notice
|
||||
--prng-seed=${test_seed}
|
||||
--table=+data.fixed --keygen.split=29 --datalen=rnd --progress --console=no
|
||||
--repeat=2 --pathname=dupsort_writemap.db --dont-cleanup-after basic)
|
||||
set_tests_properties(dupsort_writemap PROPERTIES
|
||||
TIMEOUT 3600
|
||||
RUN_SERIAL OFF)
|
||||
add_test(
|
||||
NAME dupsort_writemap
|
||||
COMMAND
|
||||
${MDBX_OUTPUT_DIR}/mdbx_test --loglevel=notice --prng-seed=${test_seed}
|
||||
--table=+data.fixed --keygen.split=29 --datalen=rnd --progress
|
||||
--console=no --repeat=2 --pathname=dupsort_writemap.db
|
||||
--dont-cleanup-after basic)
|
||||
set_tests_properties(dupsort_writemap PROPERTIES TIMEOUT 3600 RUN_SERIAL OFF)
|
||||
if(MDBX_BUILD_TOOLS)
|
||||
add_test(NAME dupsort_writemap_chk COMMAND ${MDBX_OUTPUT_DIR}/mdbx_chk -nvvwc dupsort_writemap.db)
|
||||
set_tests_properties(dupsort_writemap_chk PROPERTIES
|
||||
DEPENDS dupsort_writemap
|
||||
TIMEOUT 60
|
||||
REQUIRED_FILES dupsort_writemap.db)
|
||||
add_test(NAME dupsort_writemap_chk_copy COMMAND ${MDBX_OUTPUT_DIR}/mdbx_chk -nvvc dupsort_writemap.db-copy)
|
||||
set_tests_properties(dupsort_writemap_chk_copy PROPERTIES
|
||||
DEPENDS dupsort_writemap
|
||||
TIMEOUT 60
|
||||
FAIL_REGULAR_EXPRESSION "monopolistic mode"
|
||||
REQUIRED_FILES dupsort_writemap.db-copy)
|
||||
add_test(NAME dupsort_writemap_chk COMMAND ${MDBX_OUTPUT_DIR}/mdbx_chk
|
||||
-nvvwc dupsort_writemap.db)
|
||||
set_tests_properties(
|
||||
dupsort_writemap_chk PROPERTIES DEPENDS dupsort_writemap TIMEOUT 60
|
||||
REQUIRED_FILES dupsort_writemap.db)
|
||||
add_test(NAME dupsort_writemap_chk_copy
|
||||
COMMAND ${MDBX_OUTPUT_DIR}/mdbx_chk -nvvc dupsort_writemap.db-copy)
|
||||
set_tests_properties(
|
||||
dupsort_writemap_chk_copy
|
||||
PROPERTIES DEPENDS
|
||||
dupsort_writemap
|
||||
TIMEOUT
|
||||
60
|
||||
FAIL_REGULAR_EXPRESSION
|
||||
"monopolistic mode"
|
||||
REQUIRED_FILES
|
||||
dupsort_writemap.db-copy)
|
||||
endif()
|
||||
|
||||
add_test(NAME uniq_nested COMMAND ${MDBX_OUTPUT_DIR}/mdbx_test
|
||||
--loglevel=notice
|
||||
--mode=-writemap,-nosync-safe,-lifo --progress --console=no --repeat=2 --pathname=uniq_nested.db --dont-cleanup-after basic)
|
||||
set_tests_properties(uniq_nested PROPERTIES
|
||||
TIMEOUT 1800
|
||||
RUN_SERIAL OFF)
|
||||
add_test(
|
||||
NAME uniq_nested
|
||||
COMMAND
|
||||
${MDBX_OUTPUT_DIR}/mdbx_test --loglevel=notice
|
||||
--mode=-writemap,-nosync-safe,-lifo --progress --console=no --repeat=2
|
||||
--pathname=uniq_nested.db --dont-cleanup-after basic)
|
||||
set_tests_properties(uniq_nested PROPERTIES TIMEOUT 1800 RUN_SERIAL OFF)
|
||||
if(MDBX_BUILD_TOOLS)
|
||||
add_test(NAME uniq_nested_chk COMMAND ${MDBX_OUTPUT_DIR}/mdbx_chk -nvvw uniq_nested.db)
|
||||
set_tests_properties(uniq_nested_chk PROPERTIES
|
||||
DEPENDS uniq_nested
|
||||
TIMEOUT 60
|
||||
FAIL_REGULAR_EXPRESSION "cooperative mode"
|
||||
REQUIRED_FILES uniq_nested.db)
|
||||
add_test(NAME uniq_nested_chk_copy COMMAND ${MDBX_OUTPUT_DIR}/mdbx_chk -nvv uniq_nested.db-copy)
|
||||
set_tests_properties(uniq_nested_chk_copy PROPERTIES
|
||||
DEPENDS uniq_nested
|
||||
TIMEOUT 60
|
||||
FAIL_REGULAR_EXPRESSION "cooperative mode"
|
||||
REQUIRED_FILES uniq_nested.db-copy)
|
||||
add_test(NAME uniq_nested_chk COMMAND ${MDBX_OUTPUT_DIR}/mdbx_chk -nvvw
|
||||
uniq_nested.db)
|
||||
set_tests_properties(
|
||||
uniq_nested_chk
|
||||
PROPERTIES DEPENDS
|
||||
uniq_nested
|
||||
TIMEOUT
|
||||
60
|
||||
FAIL_REGULAR_EXPRESSION
|
||||
"cooperative mode"
|
||||
REQUIRED_FILES
|
||||
uniq_nested.db)
|
||||
add_test(NAME uniq_nested_chk_copy COMMAND ${MDBX_OUTPUT_DIR}/mdbx_chk -nvv
|
||||
uniq_nested.db-copy)
|
||||
set_tests_properties(
|
||||
uniq_nested_chk_copy
|
||||
PROPERTIES DEPENDS
|
||||
uniq_nested
|
||||
TIMEOUT
|
||||
60
|
||||
FAIL_REGULAR_EXPRESSION
|
||||
"cooperative mode"
|
||||
REQUIRED_FILES
|
||||
uniq_nested.db-copy)
|
||||
endif()
|
||||
|
||||
if(NOT SUBPROJECT)
|
||||
|
Loading…
x
Reference in New Issue
Block a user