mdbx-testing: унификация extra-тестов и интеграция в ctest.
This commit is contained in:
parent
202cdbc4be
commit
b3598b3db9
|
@ -75,19 +75,20 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
|||
target_link_libraries(mdbx_test winmm.lib)
|
||||
endif()
|
||||
|
||||
if(UNIX AND NOT SUBPROJECT)
|
||||
add_executable(test_extra_pcrf extra/pcrf/pcrf_test.c)
|
||||
target_include_directories(test_extra_pcrf PRIVATE "${PROJECT_SOURCE_DIR}")
|
||||
target_link_libraries(test_extra_pcrf ${TOOL_MDBX_LIB})
|
||||
if(NOT SUBPROJECT)
|
||||
if(UNIX)
|
||||
add_executable(test_extra_pcrf extra/pcrf/pcrf_test.c)
|
||||
target_include_directories(test_extra_pcrf PRIVATE "${PROJECT_SOURCE_DIR}")
|
||||
target_link_libraries(test_extra_pcrf ${TOOL_MDBX_LIB})
|
||||
|
||||
add_executable(test_extra_upsert_alldups extra/upsert_alldups.c)
|
||||
target_include_directories(test_extra_upsert_alldups PRIVATE "${PROJECT_SOURCE_DIR}")
|
||||
target_link_libraries(test_extra_upsert_alldups ${TOOL_MDBX_LIB})
|
||||
|
||||
add_executable(test_extra_dupfix_addodd extra/dupfix_addodd.c)
|
||||
target_include_directories(test_extra_dupfix_addodd PRIVATE "${PROJECT_SOURCE_DIR}")
|
||||
target_link_libraries(test_extra_dupfix_addodd ${TOOL_MDBX_LIB})
|
||||
add_executable(test_extra_upsert_alldups extra/upsert_alldups.c)
|
||||
target_include_directories(test_extra_upsert_alldups PRIVATE "${PROJECT_SOURCE_DIR}")
|
||||
target_link_libraries(test_extra_upsert_alldups ${TOOL_MDBX_LIB})
|
||||
|
||||
add_executable(test_extra_dupfix_addodd extra/dupfix_addodd.c)
|
||||
target_include_directories(test_extra_dupfix_addodd PRIVATE "${PROJECT_SOURCE_DIR}")
|
||||
target_link_libraries(test_extra_dupfix_addodd ${TOOL_MDBX_LIB})
|
||||
endif()
|
||||
if(MDBX_BUILD_CXX)
|
||||
add_executable(test_extra_maindb_ordinal extra/maindb_ordinal.c++)
|
||||
target_include_directories(test_extra_maindb_ordinal PRIVATE "${PROJECT_SOURCE_DIR}")
|
||||
|
@ -210,9 +211,11 @@ else()
|
|||
REQUIRED_FILES uniq_nested.db-copy)
|
||||
endif()
|
||||
|
||||
if(UNIX AND NOT SUBPROJECT)
|
||||
add_test(NAME extra_upsert_alldups COMMAND test_extra_upsert_alldups)
|
||||
add_test(NAME extra_dupfix_addodd COMMAND test_extra_dupfix_addodd)
|
||||
if(NOT SUBPROJECT)
|
||||
if(UNIX)
|
||||
add_test(NAME extra_upsert_alldups COMMAND test_extra_upsert_alldups)
|
||||
add_test(NAME extra_dupfix_addodd COMMAND test_extra_dupfix_addodd)
|
||||
endif()
|
||||
if(MDBX_BUILD_CXX)
|
||||
add_test(NAME extra_maindb_ordinal COMMAND test_extra_maindb_ordinal)
|
||||
add_test(NAME extra_dupfix_multiple COMMAND test_extra_dupfix_multiple)
|
||||
|
@ -222,6 +225,7 @@ else()
|
|||
set_tests_properties(extra_doubtless_positioning PROPERTIES TIMEOUT 10800)
|
||||
endif()
|
||||
add_test(NAME extra_crunched_delete COMMAND test_extra_crunched_delete)
|
||||
add_test(NAME extra_dbi COMMAND test_extra_dbi)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
|
|
@ -377,8 +377,8 @@ int main(int argc, const char *argv[]) {
|
|||
mdbx_setup_debug_nofmt(MDBX_LOG_NOTICE, MDBX_DBG_ASSERT, logger_nofmt,
|
||||
log_buffer, sizeof(log_buffer));
|
||||
|
||||
const char *filename = "test-crunched-del";
|
||||
mdbx::env::remove(filename);
|
||||
mdbx::path db_filename = "test-crunched-del";
|
||||
mdbx::env::remove(db_filename);
|
||||
|
||||
std::vector<acase> testset;
|
||||
// Там ключи разной длины - от 1 до 64 байт.
|
||||
|
@ -394,7 +394,7 @@ int main(int argc, const char *argv[]) {
|
|||
testset.emplace_back(8, 8, 1, 5, 10);
|
||||
testset.emplace_back(8, 8, 32, 36, 9);
|
||||
|
||||
mdbx::env_managed env(filename, mdbx::env_managed::create_parameters(),
|
||||
mdbx::env_managed env(db_filename, mdbx::env_managed::create_parameters(),
|
||||
mdbx::env::operate_parameters(42));
|
||||
if (!simple(env) || !next_prev_current(env) || !outofrange_prev(env))
|
||||
return EXIT_FAILURE;
|
||||
|
|
|
@ -18,19 +18,19 @@ int main(int argc, const char *argv[]) {
|
|||
mdbx_setup_debug_nofmt(MDBX_LOG_NOTICE, MDBX_DBG_ASSERT, logger_nofmt,
|
||||
log_buffer, sizeof(log_buffer));
|
||||
|
||||
mdbx::path path = "test-dbi";
|
||||
mdbx::env::remove(path);
|
||||
mdbx::path db_filename = "test-dbi";
|
||||
mdbx::env::remove(db_filename);
|
||||
|
||||
mdbx::env::operate_parameters operateParameters(100, 10);
|
||||
mdbx::env_managed::create_parameters createParameters;
|
||||
{
|
||||
mdbx::env_managed env2(path, createParameters, operateParameters);
|
||||
mdbx::env_managed env2(db_filename, createParameters, operateParameters);
|
||||
mdbx::txn_managed txn2 = env2.start_write(false);
|
||||
/* mdbx::map_handle testHandle2 = */ txn2.create_map(
|
||||
"fap1", mdbx::key_mode::reverse, mdbx::value_mode::single);
|
||||
txn2.commit();
|
||||
}
|
||||
mdbx::env_managed env(path, createParameters, operateParameters);
|
||||
mdbx::env_managed env(db_filename, createParameters, operateParameters);
|
||||
mdbx::txn_managed txn = env.start_write(false);
|
||||
/* mdbx::map_handle testHandle = */ txn.create_map(
|
||||
"fap1", mdbx::key_mode::usual, mdbx::value_mode::single);
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
#include <functional>
|
||||
#include <iostream>
|
||||
#include <random>
|
||||
#include <unistd.h>
|
||||
|
||||
static ::std::ostream &operator<<(::std::ostream &out,
|
||||
const mdbx::cursor::move_operation op) {
|
||||
|
@ -233,9 +232,9 @@ int main(int argc, const char *argv[]) {
|
|||
(void)argc;
|
||||
(void)argv;
|
||||
|
||||
unlink("." MDBX_DATANAME);
|
||||
unlink("." MDBX_LOCKNAME);
|
||||
mdbx::env_managed env(".", mdbx::env_managed::create_parameters(),
|
||||
mdbx::path db_filename = "test-posi";
|
||||
mdbx::env_managed::remove(db_filename);
|
||||
mdbx::env_managed env(db_filename, mdbx::env_managed::create_parameters(),
|
||||
mdbx::env::operate_parameters(3));
|
||||
|
||||
auto txn = env.start_write();
|
||||
|
|
|
@ -4,16 +4,14 @@
|
|||
#include "mdbx.h++"
|
||||
#include <array>
|
||||
#include <iostream>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(int argc, const char *argv[]) {
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
|
||||
unlink("." MDBX_DATANAME);
|
||||
unlink("." MDBX_LOCKNAME);
|
||||
|
||||
mdbx::env_managed env(".", mdbx::env_managed::create_parameters(),
|
||||
mdbx::path db_filename = "test-dupfix-multiple";
|
||||
mdbx::env_managed::remove(db_filename);
|
||||
mdbx::env_managed env(db_filename, mdbx::env_managed::create_parameters(),
|
||||
mdbx::env::operate_parameters());
|
||||
|
||||
using buffer =
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#include "mdbx.h++"
|
||||
#include <array>
|
||||
#include <iostream>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <functional>
|
||||
#include <random>
|
||||
|
|
|
@ -3,16 +3,14 @@
|
|||
|
||||
#include "mdbx.h++"
|
||||
#include <iostream>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(int argc, const char *argv[]) {
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
|
||||
unlink("." MDBX_DATANAME);
|
||||
unlink("." MDBX_LOCKNAME);
|
||||
|
||||
mdbx::env_managed env(".", mdbx::env_managed::create_parameters(),
|
||||
mdbx::path db_filename = "test-dupfix-multiple";
|
||||
mdbx::env_managed::remove(db_filename);
|
||||
mdbx::env_managed env(db_filename, mdbx::env_managed::create_parameters(),
|
||||
mdbx::env::operate_parameters());
|
||||
|
||||
using buffer =
|
||||
|
@ -23,7 +21,7 @@ int main(int argc, const char *argv[]) {
|
|||
#if 0 /* workaround */
|
||||
txn.commit();
|
||||
env.close();
|
||||
env = mdbx::env_managed(".", mdbx::env_managed::create_parameters(),
|
||||
env = mdbx::env_managed(db_filename, mdbx::env_managed::create_parameters(),
|
||||
mdbx::env::operate_parameters());
|
||||
txn = env.start_write();
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue