|
|
@ -700,7 +700,7 @@ endif() |
|
|
|
|
|
|
|
|
|
|
|
option(WITH_TESTS "build with tests" ON) |
|
|
|
option(WITH_TESTS "build with tests" ON) |
|
|
|
if(WITH_TESTS) |
|
|
|
if(WITH_TESTS) |
|
|
|
set(TESTS |
|
|
|
set(TESTS |
|
|
|
cache/cache_test.cc |
|
|
|
cache/cache_test.cc |
|
|
|
cache/lru_cache_test.cc |
|
|
|
cache/lru_cache_test.cc |
|
|
|
db/column_family_test.cc |
|
|
|
db/column_family_test.cc |
|
|
@ -832,53 +832,53 @@ set(TESTS |
|
|
|
utilities/transactions/transaction_test.cc |
|
|
|
utilities/transactions/transaction_test.cc |
|
|
|
utilities/ttl/ttl_test.cc |
|
|
|
utilities/ttl/ttl_test.cc |
|
|
|
utilities/write_batch_with_index/write_batch_with_index_test.cc |
|
|
|
utilities/write_batch_with_index/write_batch_with_index_test.cc |
|
|
|
) |
|
|
|
) |
|
|
|
if(WITH_LIBRADOS) |
|
|
|
if(WITH_LIBRADOS) |
|
|
|
list(APPEND TESTS utilities/env_librados_test.cc) |
|
|
|
list(APPEND TESTS utilities/env_librados_test.cc) |
|
|
|
endif() |
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
|
|
set(BENCHMARKS |
|
|
|
set(BENCHMARKS |
|
|
|
cache/cache_bench.cc |
|
|
|
cache/cache_bench.cc |
|
|
|
memtable/memtablerep_bench.cc |
|
|
|
memtable/memtablerep_bench.cc |
|
|
|
tools/db_bench.cc |
|
|
|
tools/db_bench.cc |
|
|
|
table/table_reader_bench.cc |
|
|
|
table/table_reader_bench.cc |
|
|
|
utilities/column_aware_encoding_exp.cc |
|
|
|
utilities/column_aware_encoding_exp.cc |
|
|
|
utilities/persistent_cache/hash_table_bench.cc) |
|
|
|
utilities/persistent_cache/hash_table_bench.cc) |
|
|
|
add_library(testharness OBJECT util/testharness.cc) |
|
|
|
add_library(testharness OBJECT util/testharness.cc) |
|
|
|
foreach(sourcefile ${BENCHMARKS}) |
|
|
|
foreach(sourcefile ${BENCHMARKS}) |
|
|
|
get_filename_component(exename ${sourcefile} NAME_WE) |
|
|
|
get_filename_component(exename ${sourcefile} NAME_WE) |
|
|
|
add_executable(${exename}${ARTIFACT_SUFFIX} ${sourcefile} |
|
|
|
add_executable(${exename}${ARTIFACT_SUFFIX} ${sourcefile} |
|
|
|
$<TARGET_OBJECTS:testharness>) |
|
|
|
$<TARGET_OBJECTS:testharness>) |
|
|
|
target_link_libraries(${exename}${ARTIFACT_SUFFIX} gtest ${LIBS}) |
|
|
|
target_link_libraries(${exename}${ARTIFACT_SUFFIX} gtest ${LIBS}) |
|
|
|
endforeach(sourcefile ${BENCHMARKS}) |
|
|
|
endforeach(sourcefile ${BENCHMARKS}) |
|
|
|
|
|
|
|
|
|
|
|
# For test util library that is build only in DEBUG mode |
|
|
|
# For test util library that is build only in DEBUG mode |
|
|
|
# and linked to tests. Add test only code that is not #ifdefed for Release here. |
|
|
|
# and linked to tests. Add test only code that is not #ifdefed for Release here. |
|
|
|
set(TESTUTIL_SOURCE |
|
|
|
set(TESTUTIL_SOURCE |
|
|
|
db/db_test_util.cc |
|
|
|
db/db_test_util.cc |
|
|
|
monitoring/thread_status_updater_debug.cc |
|
|
|
monitoring/thread_status_updater_debug.cc |
|
|
|
table/mock_table.cc |
|
|
|
table/mock_table.cc |
|
|
|
util/fault_injection_test_env.cc |
|
|
|
util/fault_injection_test_env.cc |
|
|
|
utilities/cassandra/test_utils.cc |
|
|
|
utilities/cassandra/test_utils.cc |
|
|
|
) |
|
|
|
) |
|
|
|
# test utilities are only build in debug |
|
|
|
# test utilities are only build in debug |
|
|
|
enable_testing() |
|
|
|
enable_testing() |
|
|
|
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND}) |
|
|
|
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND}) |
|
|
|
set(TESTUTILLIB testutillib${ARTIFACT_SUFFIX}) |
|
|
|
set(TESTUTILLIB testutillib${ARTIFACT_SUFFIX}) |
|
|
|
add_library(${TESTUTILLIB} STATIC ${TESTUTIL_SOURCE}) |
|
|
|
add_library(${TESTUTILLIB} STATIC ${TESTUTIL_SOURCE}) |
|
|
|
if(MSVC) |
|
|
|
if(MSVC) |
|
|
|
set_target_properties(${TESTUTILLIB} PROPERTIES COMPILE_FLAGS "/Fd${CMAKE_CFG_INTDIR}/testutillib${ARTIFACT_SUFFIX}.pdb") |
|
|
|
set_target_properties(${TESTUTILLIB} PROPERTIES COMPILE_FLAGS "/Fd${CMAKE_CFG_INTDIR}/testutillib${ARTIFACT_SUFFIX}.pdb") |
|
|
|
endif() |
|
|
|
endif() |
|
|
|
set_target_properties(${TESTUTILLIB} |
|
|
|
set_target_properties(${TESTUTILLIB} |
|
|
|
PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD_RELEASE 1 |
|
|
|
PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD_RELEASE 1 |
|
|
|
EXCLUDE_FROM_DEFAULT_BUILD_MINRELEASE 1 |
|
|
|
EXCLUDE_FROM_DEFAULT_BUILD_MINRELEASE 1 |
|
|
|
EXCLUDE_FROM_DEFAULT_BUILD_RELWITHDEBINFO 1 |
|
|
|
EXCLUDE_FROM_DEFAULT_BUILD_RELWITHDEBINFO 1 |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
# Tests are excluded from Release builds |
|
|
|
# Tests are excluded from Release builds |
|
|
|
set(TEST_EXES ${TESTS}) |
|
|
|
set(TEST_EXES ${TESTS}) |
|
|
|
|
|
|
|
|
|
|
|
foreach(sourcefile ${TEST_EXES}) |
|
|
|
foreach(sourcefile ${TEST_EXES}) |
|
|
|
get_filename_component(exename ${sourcefile} NAME_WE) |
|
|
|
get_filename_component(exename ${sourcefile} NAME_WE) |
|
|
|
add_executable(${exename}${ARTIFACT_SUFFIX} ${sourcefile} |
|
|
|
add_executable(${exename}${ARTIFACT_SUFFIX} ${sourcefile} |
|
|
|
$<TARGET_OBJECTS:testharness>) |
|
|
|
$<TARGET_OBJECTS:testharness>) |
|
|
@ -892,13 +892,13 @@ foreach(sourcefile ${TEST_EXES}) |
|
|
|
add_test(NAME ${exename} COMMAND ${exename}${ARTIFACT_SUFFIX}) |
|
|
|
add_test(NAME ${exename} COMMAND ${exename}${ARTIFACT_SUFFIX}) |
|
|
|
add_dependencies(check ${exename}${ARTIFACT_SUFFIX}) |
|
|
|
add_dependencies(check ${exename}${ARTIFACT_SUFFIX}) |
|
|
|
endif() |
|
|
|
endif() |
|
|
|
endforeach(sourcefile ${TEST_EXES}) |
|
|
|
endforeach(sourcefile ${TEST_EXES}) |
|
|
|
|
|
|
|
|
|
|
|
# C executables must link to a shared object |
|
|
|
# C executables must link to a shared object |
|
|
|
set(C_TESTS db/c_test.c) |
|
|
|
set(C_TESTS db/c_test.c) |
|
|
|
set(C_TEST_EXES ${C_TESTS}) |
|
|
|
set(C_TEST_EXES ${C_TESTS}) |
|
|
|
|
|
|
|
|
|
|
|
foreach(sourcefile ${C_TEST_EXES}) |
|
|
|
foreach(sourcefile ${C_TEST_EXES}) |
|
|
|
string(REPLACE ".c" "" exename ${sourcefile}) |
|
|
|
string(REPLACE ".c" "" exename ${sourcefile}) |
|
|
|
string(REGEX REPLACE "^((.+)/)+" "" exename ${exename}) |
|
|
|
string(REGEX REPLACE "^((.+)/)+" "" exename ${exename}) |
|
|
|
add_executable(${exename}${ARTIFACT_SUFFIX} ${sourcefile}) |
|
|
|
add_executable(${exename}${ARTIFACT_SUFFIX} ${sourcefile}) |
|
|
@ -910,7 +910,7 @@ foreach(sourcefile ${C_TEST_EXES}) |
|
|
|
target_link_libraries(${exename}${ARTIFACT_SUFFIX} ${ROCKSDB_IMPORT_LIB} testutillib${ARTIFACT_SUFFIX}) |
|
|
|
target_link_libraries(${exename}${ARTIFACT_SUFFIX} ${ROCKSDB_IMPORT_LIB} testutillib${ARTIFACT_SUFFIX}) |
|
|
|
add_test(NAME ${exename} COMMAND ${exename}${ARTIFACT_SUFFIX}) |
|
|
|
add_test(NAME ${exename} COMMAND ${exename}${ARTIFACT_SUFFIX}) |
|
|
|
add_dependencies(check ${exename}${ARTIFACT_SUFFIX}) |
|
|
|
add_dependencies(check ${exename}${ARTIFACT_SUFFIX}) |
|
|
|
endforeach(sourcefile ${C_TEST_EXES}) |
|
|
|
endforeach(sourcefile ${C_TEST_EXES}) |
|
|
|
endif() |
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
|
|
option(WITH_TOOLS "build with tools" ON) |
|
|
|
option(WITH_TOOLS "build with tools" ON) |
|
|
|