mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 23:04:20 +01:00
7ea6dd4171
git-svn-id: file:///svn/toku/tokudb@46797 c7de825b-a66e-492c-adef-691d508d4ae1
134 lines
7.2 KiB
CMake
134 lines
7.2 KiB
CMake
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS _GNU_SOURCE DONT_DEPRECATE_ERRNO)
|
|
|
|
if(BUILD_TESTING OR BUILD_FT_TESTS)
|
|
## get a list of the sources in this directory
|
|
file(GLOB srcs RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" *.cc)
|
|
set(tests)
|
|
foreach(src ${srcs})
|
|
get_filename_component(base ${src} NAME_WE)
|
|
list(APPEND tests ${base})
|
|
endforeach(src)
|
|
|
|
## these are generated by some tests, we need to remember to clean them
|
|
## up
|
|
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES
|
|
foo1.ft_handle foo2.ft_handle foo3.ft_handle foo4.ft_handle
|
|
bar1.ft_handle bar2.ft_handle bar3.ft_handle bar4.ft_handle
|
|
test-dump-ft.out)
|
|
|
|
## this macro will remove the test from the list of source files so it
|
|
## doesn't end up getting the default test rule applied to it
|
|
macro(declare_custom_tests)
|
|
foreach(test ${ARGN})
|
|
list(REMOVE_ITEM tests ${test})
|
|
endforeach(test)
|
|
endmacro(declare_custom_tests)
|
|
|
|
declare_custom_tests(logcursor-fw logcursor-bw)
|
|
add_test(ft/logcursor-fw echo "logcursor-fw must be run manually (needs logs to iterate over).")
|
|
add_test(ft/logcursor-bw echo "logcursor-bw must be run manually (needs logs to iterate over).")
|
|
|
|
foreach(test ${tests})
|
|
if(NOT "${test}" MATCHES "dir[.].*") ## annoying
|
|
add_executable(${test} ${test})
|
|
target_link_libraries(${test} ft ${LIBTOKUPORTABILITY})
|
|
add_common_options_to_binary_targets(${test})
|
|
set_property(TARGET ${test} APPEND PROPERTY
|
|
COMPILE_DEFINITIONS "__SRCFILE__=\"${test}\";TOKUSVNROOT=\"${TOKU_SVNROOT}\"")
|
|
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${test}.ft_handle")
|
|
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${test}.ft")
|
|
endif()
|
|
endforeach(test)
|
|
|
|
## declare some tests that should be run with specific options
|
|
|
|
declare_custom_tests(test-assert)
|
|
add_test(ft/test-assertA test-assert)
|
|
add_test(ft/test-assertB test-assert notok)
|
|
set_tests_properties(ft/test-assertA ft/test-assertB PROPERTIES WILL_FAIL TRUE)
|
|
add_test(ft/test-assertC test-assert ok)
|
|
|
|
declare_custom_tests(benchmark-test)
|
|
add_test(ft/benchmark-test benchmark-test -q --fname dir.check_benchmark-test)
|
|
add_test(ft/benchmark-test_256 benchmark-test --valsize 256 --verify 1 --fname dir.check_benchmark-test_256)
|
|
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES
|
|
dir.check_benchmark-test dir.check_benchmark-test_256)
|
|
|
|
declare_custom_tests(ftloader-test-merge-files-dbufio)
|
|
add_test(ft/ftloader-test-merge-files-dbufio ftloader-test-merge-files-dbufio -r 8000 -s dir.check_ftloader-test-merge-files-dbufio)
|
|
|
|
declare_custom_tests(ftloader-test)
|
|
add_test(ft/ftloader-test ftloader-test dir.check_ftloader-test)
|
|
|
|
declare_custom_tests(ftloader-test-bad-generate)
|
|
add_test(ft/ftloader-test-bad-generate ftloader-test-bad-generate dir.check_ftloader-test-bad-generate)
|
|
|
|
declare_custom_tests(ftloader-test-extractor)
|
|
add_test(ft/ftloader-test-extractor-1 ftloader-test-extractor -s -r 1000 --rowsets 1000 --asc dir.check_ftloader-test-extractor-1)
|
|
add_test(ft/ftloader-test-extractor-2 ftloader-test-extractor -s -r 1000 --rowsets 1000 --dsc dir.check_ftloader-test-extractor-2)
|
|
add_test(ft/ftloader-test-extractor-3 ftloader-test-extractor -s -r 1000 --rowsets 1000 --random dir.check_ftloader-test-extractor-3)
|
|
add_test(ft/ftloader-test-extractor-1a ftloader-test-extractor -s -r 1000 --rowsets 1000 --asc dir.check_ftloader-test-extractor-1a)
|
|
add_test(ft/ftloader-test-extractor-2a ftloader-test-extractor -s -r 1000 --rowsets 1000 --dsc dir.check_ftloader-test-extractor-2a)
|
|
add_test(ft/ftloader-test-extractor-3a ftloader-test-extractor -s -r 1000 --rowsets 1000 --random dir.check_ftloader-test-extractor-3a)
|
|
add_test(ft/ftloader-test-extractor-4a ftloader-test-extractor -s -r 1000 --rowsets 3 --asc dir.check_ftloader-test-extractor-4a)
|
|
add_test(ft/ftloader-test-extractor-5a ftloader-test-extractor -s -r 1000 --rowsets 3 --asc --asc-poison dir.check_ftloader-test-extractor-5a)
|
|
|
|
declare_custom_tests(ftloader-test-extractor-errors)
|
|
add_test(ft/ftloader-test-extractor-errors-1 ftloader-test-extractor-errors -w -m -u -r 1 dir.check_ftloader-test-extractor-errors-1)
|
|
add_test(ft/ftloader-test-extractor-errors-2 ftloader-test-extractor-errors -m -r 10000 dir.check_ftloader-test-extractor-errors-2)
|
|
|
|
declare_custom_tests(ftloader-test-open)
|
|
add_test(ft/ftloader-test-open ftloader-test-open dir.check_ftloader-test-open)
|
|
|
|
declare_custom_tests(ftloader-test-writer)
|
|
add_test(ft/ftloader-test-writer-1 ftloader-test-writer -r 1 -s dir.check_ftloader-test-writer-1)
|
|
add_test(ft/ftloader-test-writer-1000 ftloader-test-writer -r 1000 -s dir.check_ftloader-test-writer-1000)
|
|
add_test(ft/ftloader-test-writer-100000 ftloader-test-writer -r 100000 -s dir.check_ftloader-test-writer-100000)
|
|
add_test(ft/ftloader-test-writer-1000000 ftloader-test-writer -r 1000000 -s dir.check_ftloader-test-writer-1000000)
|
|
add_test(ft/ftloader-test-writer-1-x ftloader-test-writer -r 1 -s -x 42 dir.check_ftloader-test-writer-1-x)
|
|
add_test(ft/ftloader-test-writer-1000-x ftloader-test-writer -r 1000 -s -x 42 dir.check_ftloader-test-writer-1000-x)
|
|
add_test(ft/ftloader-test-writer-100000-x ftloader-test-writer -r 100000 -s -x 42 dir.check_ftloader-test-writer-100000-x)
|
|
add_test(ft/ftloader-test-writer-1000000-x ftloader-test-writer -r 1000000 -s -x 42 dir.check_ftloader-test-writer-1000000-x)
|
|
|
|
declare_custom_tests(ftloader-test-writer-errors)
|
|
add_test(ft/ftloader-test-writer-errors-1 ftloader-test-writer-errors -w -m -u -r 100000 dir.check_ftloader-test-writer-errors-1)
|
|
add_test(ft/ftloader-test-writer-errors-2 ftloader-test-writer-errors -s -w -m -u -r 10000 dir.check_ftloader-test-writer-errors-2)
|
|
add_test(ft/ftloader-test-writer-errors-3 ftloader-test-writer-errors -s -r 20000 --malloc_limit 0 --realloc_errors dir.check_ftloader-test-writer-errors-3)
|
|
add_test(ft/ftloader-test-writer-errors-4 ftloader-test-writer-errors -s -m --malloc_limit 0 -r 10000 dir.check_ftloader-test-writer-errors-4)
|
|
|
|
declare_custom_tests(ft-serialize-benchmark)
|
|
add_test(ft/ft-serialize-benchmark ft-serialize-benchmark 92 200000)
|
|
declare_custom_tests(bnc-insert-benchmark)
|
|
add_test(ft/bnc-insert-benchmark bnc-insert-benchmark 100 4096000 1000)
|
|
|
|
add_helgrind_test(ft/helgrind_test_partitioned_counter $<TARGET_FILE:test_partitioned_counter>)
|
|
|
|
foreach(test ${tests})
|
|
if(NOT "${test}" MATCHES "dir[.].*")
|
|
## add a default test rule that runs with no options
|
|
add_test(ft/${test} ${test})
|
|
endif()
|
|
endforeach(test)
|
|
|
|
## give some tests, that time out normally, 1 hour to complete
|
|
set(long_tests
|
|
ft/log-test7
|
|
ft/subblock-test-compression
|
|
ft/recovery-bad-last-entry
|
|
ft/ftloader-test-extractor-3a
|
|
ft/upgrade_test_simple
|
|
)
|
|
set_tests_properties(${long_tests} PROPERTIES TIMEOUT 3600)
|
|
## some take even longer, with valgrind
|
|
set(extra_long_tests
|
|
ft/is_empty
|
|
ft/subblock-test-checksum
|
|
)
|
|
set_tests_properties(${extra_long_tests} PROPERTIES TIMEOUT 7200)
|
|
## these take a really long time with valgrind
|
|
set(phenomenally_long_tests
|
|
ft/benchmark-test
|
|
ft/benchmark-test_256
|
|
)
|
|
set_tests_properties(${phenomenally_long_tests} PROPERTIES TIMEOUT 14400)
|
|
endif(BUILD_TESTING OR BUILD_FT_TESTS)
|