Commit 85855c3c authored by Leif Walsh's avatar Leif Walsh Committed by Yoni Fogel

[t:4871] use shared lib for {lock,range}_tree tests, speeds up build, and add...

[t:4871] use shared lib for {lock,range}_tree tests, speeds up build, and add prefixes to test names to use regexes better
also better osx/clang support, compile with -O4 now
and use the same compiler for the fractal tree and lzma


git-svn-id: file:///svn/toku/tokudb@44602 c7de825b-a66e-492c-adef-691d508d4ae1
parent 5836aff0
...@@ -2,61 +2,61 @@ cmake_policy(SET CMP0012 NEW) ...@@ -2,61 +2,61 @@ cmake_policy(SET CMP0012 NEW)
## these tests shouldn't run with valgrind ## these tests shouldn't run with valgrind
list(APPEND CTEST_CUSTOM_MEMCHECK_IGNORE list(APPEND CTEST_CUSTOM_MEMCHECK_IGNORE
ft_loader-test-extractor-1 ft/bnc-insert-benchmark
ft_loader-test-extractor-2 ft/brt-serialize-benchmark
ft_loader-test-extractor-3 ft/ft_loader-test-extractor-1
brt-serialize-benchmark ft/ft_loader-test-extractor-2
bnc-insert-benchmark ft/ft_loader-test-extractor-3
test_groupcommit_perf.tdb ft/upgrade_test_simple
test_groupcommit_perf.bdb portability/try-leak-lost
diskfull.tdb portability/try-leak-reachable
stress-gc.tdb portability/try-leak-uninit
insert-dup-prelock.tdb ydb/diskfull.tdb
test_3645.tdb ydb/drd_test_4015.tdb
test_large_update_broadcast_small_cachetable.tdb ydb/drd_test_groupcommit_count.tdb
test_update_broadcast_stress.tdb ydb/filesize.tdb
test_update_stress.tdb ydb/helgrind2.tdb
stress-test.tdb ydb/helgrind3.tdb
stress-test.bdb ydb/helgrind_helgrind1.tdb
hot-optimize-table-tests.tdb ydb/helgrind_test_groupcommit_count.tdb
test4573-logtrim.tdb ydb/hot-optimize-table-tests.tdb
test-xa-prepare.tdb ydb/insert-dup-prelock.tdb
test-recover1.tdb ydb/loader-cleanup-test2.tdb
test-recover2.tdb ydb/loader-cleanup-test3.tdb
test-recover3.tdb ydb/loader-stress-test4.tdb
test-prepare.tdb ydb/maxsize-for-loader-B.tdb
test-prepare2.tdb ydb/preload-db-nested.tdb
test-prepare3.tdb ydb/recovery_fileops_unit.tdb
filesize.tdb ydb/stress-gc.tdb
preload-db-nested.tdb ydb/stress-test.bdb
upgrade-test-4.tdb ydb/stress-test.tdb
recovery_fileops_unit.tdb ydb/test-prepare.tdb
helgrind_helgrind1.tdb ydb/test-prepare2.tdb
helgrind2.tdb ydb/test-prepare3.tdb
helgrind3.tdb ydb/test-recover1.tdb
drd_test_groupcommit_count.tdb ydb/test-recover2.tdb
helgrind_test_groupcommit_count.tdb ydb/test-recover3.tdb
loader-cleanup-test2.tdb ydb/test-xa-prepare.tdb
loader-cleanup-test3.tdb ydb/test4573-logtrim.tdb
loader-stress-test4.tdb ydb/test_3645.tdb
maxsize-for-loader-B.tdb ydb/test_groupcommit_perf.bdb
try-leak-lost ydb/test_groupcommit_perf.tdb
try-leak-reachable ydb/test_large_update_broadcast_small_cachetable.tdb
try-leak-uninit ydb/test_update_broadcast_stress.tdb
drd_test_4015.tdb ydb/test_update_stress.tdb
upgrade_test_simple ydb/upgrade-test-4.tdb
) )
## tests that are supposed to crash will generate memcheck failures ## tests that are supposed to crash will generate memcheck failures
set(tests_that_should_fail set(tests_that_should_fail
try-assert0 ft/test-assertA
try-assert-zero ft/test-assertB
test-assertA portability/try-assert-zero
test-assertB portability/try-assert0
test_truncate_txn_abort.tdb ydb/recover-missing-dbfile-2.abortrecover
test_db_no_env.tdb ydb/recover-missing-dbfile.abortrecover
recover-missing-dbfile.abortrecover ydb/test_db_no_env.tdb
recover-missing-dbfile-2.abortrecover ydb/test_truncate_txn_abort.tdb
) )
list(APPEND CTEST_CUSTOM_MEMCHECK_IGNORE ${tests_that_should_fail}) list(APPEND CTEST_CUSTOM_MEMCHECK_IGNORE ${tests_that_should_fail})
...@@ -69,31 +69,40 @@ set(stress_tests ...@@ -69,31 +69,40 @@ set(stress_tests
test_stress5.tdb test_stress5.tdb
test_stress6.tdb test_stress6.tdb
test_stress7.tdb test_stress7.tdb
test_stress_hot_indexing.tdb
test_stress_with_verify.tdb test_stress_with_verify.tdb
) )
foreach(test ${stress_tests}) foreach(test ${stress_tests})
list(APPEND CTEST_CUSTOM_MEMCHECK_IGNORE list(APPEND CTEST_CUSTOM_MEMCHECK_IGNORE
drd_tiny_${test} ydb/drd_tiny_${test}
drd_mid_${test} ydb/drd_mid_${test}
drd_large_${test} ydb/drd_large_${test}
) )
if(NOT test MATCHES "test_stress(1|3).tdb") if(NOT test MATCHES "test_stress(1|3).tdb")
list(APPEND CTEST_CUSTOM_TESTS_IGNORE list(APPEND CTEST_CUSTOM_TESTS_IGNORE
drd_large_${test} ydb/drd_large_${test}
) )
endif() endif()
if(NOT @RUN_LONG_TESTS@) if(NOT @RUN_LONG_TESTS@)
list(APPEND CTEST_CUSTOM_TESTS_IGNORE list(APPEND CTEST_CUSTOM_TESTS_IGNORE
drd_mid_${test} ydb/drd_mid_${test}
drd_large_${test} ydb/drd_large_${test}
) )
endif() endif()
endforeach(test) endforeach(test)
set(tdb_tests_that_should_fail "ydb/${stress_tests}")
## osx's pthreads prefer writers, so this test will deadlock
if (@CMAKE_SYSTEM_NAME@ STREQUAL Darwin)
list(APPEND CTEST_CUSTOM_MEMCHECK_IGNORE portability/test-pthread-rwlock-rwr)
list(APPEND CTEST_CUSTOM_TESTS_IGNORE portability/test-pthread-rwlock-rwr)
endif ()
string(REGEX REPLACE ";" ";ydb/" stress_tests "${stress_tests}")
set(recover_stress_tests set(recover_stress_tests
recover-test_stress1.abortrecover ydb/recover-test_stress1.abortrecover
recover-test_stress2.abortrecover ydb/recover-test_stress2.abortrecover
recover-test_stress3.abortrecover ydb/recover-test_stress3.abortrecover
) )
## we run stress tests separately, only run them if asked to ## we run stress tests separately, only run them if asked to
...@@ -103,13 +112,13 @@ if(NOT @RUN_STRESS_TESTS@) ...@@ -103,13 +112,13 @@ if(NOT @RUN_STRESS_TESTS@)
endif() endif()
set(perf_tests set(perf_tests
perf_checkpoint_var.tdb ydb/perf_checkpoint_var.tdb
perf_cursor_nop.tdb ydb/perf_cursor_nop.tdb
perf_malloc_free.tdb ydb/perf_malloc_free.tdb
perf_nop.tdb ydb/perf_nop.tdb
perf_ptquery.tdb ydb/perf_ptquery.tdb
perf_ptquery2.tdb ydb/perf_ptquery2.tdb
perf_xmalloc_free.tdb ydb/perf_xmalloc_free.tdb
) )
## we also don't need to run perf tests every time ## we also don't need to run perf tests every time
...@@ -121,38 +130,40 @@ endif() ...@@ -121,38 +130,40 @@ endif()
## don't run perf tests with valgrind (that's slow) ## don't run perf tests with valgrind (that's slow)
file(GLOB perf_test_srcs RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/src/tests" perf_*.c) file(GLOB perf_test_srcs RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/src/tests" perf_*.c)
string(REGEX REPLACE "\\.c(;|$)" ".tdb\\1" perf_tests "${perf_test_srcs}") string(REGEX REPLACE "\\.c(;|$)" ".tdb\\1" perf_tests "${perf_test_srcs}")
set(tdb_tests_that_should_fail "ydb/${perf_tests}")
string(REGEX REPLACE ";" ";ydb/" perf_tests "${perf_tests}")
list(APPEND CTEST_CUSTOM_MEMCHECK_IGNORE ${perf_tests}) list(APPEND CTEST_CUSTOM_MEMCHECK_IGNORE ${perf_tests})
## these tests fail often and aren't helpful ## these tests fail often and aren't helpful
set(known_failing_tests set(known_failing_tests
diskfull.tdb ydb/diskfull.tdb
) )
list(APPEND CTEST_CUSTOM_MEMCHECK_IGNORE ${known_failing_tests}) list(APPEND CTEST_CUSTOM_MEMCHECK_IGNORE ${known_failing_tests})
list(APPEND CTEST_CUSTOM_TESTS_IGNORE ${known_failing_tests}) list(APPEND CTEST_CUSTOM_TESTS_IGNORE ${known_failing_tests})
## these tests take a long time, only run them if asked to ## these tests take a long time, only run them if asked to
set(long_running_tests set(long_running_tests
recover_stress.tdb ft/is_empty
checkpoint_stress.tdb ft/upgrade_test_simple
root_fifo_1.tdb ydb/checkpoint_1.tdb
root_fifo_2.tdb ydb/checkpoint_stress.tdb
root_fifo_31.tdb ydb/hot-optimize-table-tests.tdb
root_fifo_32.tdb ydb/hotindexer-with-queries.tdb
is_empty ydb/loader-stress-test4.tdb
test_txn_nested2.tdb ydb/manyfiles.tdb
test_logmax.tdb ydb/preload-db-nested.tdb
checkpoint_1.tdb ydb/recover_stress.tdb
manyfiles.tdb ydb/root_fifo_1.tdb
loader-stress-test4.tdb ydb/root_fifo_2.tdb
preload-db-nested.tdb ydb/root_fifo_31.tdb
test_update_stress.tdb ydb/root_fifo_32.tdb
test_update_broadcast_stress.tdb ydb/stress-gc.tdb
stress-test.tdb ydb/stress-test.tdb
stress-gc.tdb ydb/test3529.tdb
hot-optimize-table-tests.tdb ydb/test_logmax.tdb
hotindexer-with-queries.tdb ydb/test_txn_nested2.tdb
upgrade_test_simple ydb/test_update_broadcast_stress.tdb
test3529.tdb ydb/test_update_stress.tdb
) )
if(NOT @RUN_LONG_TESTS@) if(NOT @RUN_LONG_TESTS@)
list(APPEND CTEST_CUSTOM_MEMCHECK_IGNORE ${long_running_tests}) list(APPEND CTEST_CUSTOM_MEMCHECK_IGNORE ${long_running_tests})
......
...@@ -57,17 +57,21 @@ set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g3 -ggdb -O0") ...@@ -57,17 +57,21 @@ set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g3 -ggdb -O0")
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG FORTIFY_SOURCE=2) set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG FORTIFY_SOURCE=2)
## set extra release flags, we overwrite this because the default passes -DNDEBUG and we don't want that ## set extra release flags, we overwrite this because the default passes -DNDEBUG and we don't want that
set(CMAKE_C_FLAGS_RELEASE "-g -O3") if (CMAKE_C_COMPILER_ID STREQUAL Clang AND CMAKE_SYSTEM_NAME STREQUAL Darwin)
set(CMAKE_C_FLAGS_RELEASE "-g -O4")
else ()
set(CMAKE_C_FLAGS_RELEASE "-g -O3")
## check how to do inter-procedural optimization ## check how to do inter-procedural optimization
check_c_compiler_flag(-flto HAVE_CC_FLAG_FLTO) check_c_compiler_flag(-flto HAVE_CC_FLAG_FLTO)
check_c_compiler_flag(-ipo HAVE_CC_FLAG_IPO) check_c_compiler_flag(-ipo HAVE_CC_FLAG_IPO)
## add inter-procedural optimization flags ## add inter-procedural optimization flags
if (HAVE_CC_FLAG_FLTO) if (HAVE_CC_FLAG_FLTO)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -flto") set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -flto")
elseif (HAVE_CC_FLAG_IPO) elseif (HAVE_CC_FLAG_IPO)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -ip -ipo1") set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -ip -ipo1")
endif ()
endif () endif ()
if (CMAKE_C_COMPILER_ID MATCHES Intel) if (CMAKE_C_COMPILER_ID MATCHES Intel)
......
...@@ -9,9 +9,10 @@ if (CMAKE_SYSTEM_NAME MATCHES Darwin) ...@@ -9,9 +9,10 @@ if (CMAKE_SYSTEM_NAME MATCHES Darwin)
list(APPEND xz_configure_opts --disable-assembler) list(APPEND xz_configure_opts --disable-assembler)
endif () endif ()
list(APPEND xz_configure_opts CC=${CMAKE_C_COMPILER})
if (CMAKE_BUILD_TYPE MATCHES Release) if (CMAKE_BUILD_TYPE MATCHES Release)
if (CMAKE_C_COMPILER_ID MATCHES Intel) if (CMAKE_C_COMPILER_ID MATCHES Intel)
list(APPEND xz_configure_opts CC=icc "CFLAGS=-O2 -g -ip -ipo1" AR=xiar) list(APPEND xz_configure_opts "CFLAGS=-O2 -g -ip -ipo1" AR=xiar)
endif () endif ()
else () else ()
list(APPEND xz_configure_opts --enable-debug) list(APPEND xz_configure_opts --enable-debug)
......
...@@ -20,8 +20,8 @@ if(BUILD_TESTING) ...@@ -20,8 +20,8 @@ if(BUILD_TESTING)
endmacro(declare_custom_tests) endmacro(declare_custom_tests)
declare_custom_tests(logcursor-fw.c logcursor-bw.c) declare_custom_tests(logcursor-fw.c logcursor-bw.c)
add_test(logcursor-fw echo "logcursor-fw must be run manually (needs logs to iterate over).") add_test(ft/logcursor-fw echo "logcursor-fw must be run manually (needs logs to iterate over).")
add_test(logcursor-bw echo "logcursor-bw 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).")
get_filename_component(toku_svn_root "${TokuDB_SOURCE_DIR}/../.." REALPATH) get_filename_component(toku_svn_root "${TokuDB_SOURCE_DIR}/../.." REALPATH)
...@@ -41,91 +41,91 @@ if(BUILD_TESTING) ...@@ -41,91 +41,91 @@ if(BUILD_TESTING)
## declare some tests that should be run with specific options ## declare some tests that should be run with specific options
declare_custom_tests(test-assert.c) declare_custom_tests(test-assert.c)
add_test(test-assertA test-assert) add_test(ft/test-assertA test-assert)
add_test(test-assertB test-assert notok) add_test(ft/test-assertB test-assert notok)
set_tests_properties(test-assertA test-assertB PROPERTIES WILL_FAIL TRUE) set_tests_properties(ft/test-assertA ft/test-assertB PROPERTIES WILL_FAIL TRUE)
add_test(test-assertC test-assert ok) add_test(ft/test-assertC test-assert ok)
declare_custom_tests(benchmark-test.c) declare_custom_tests(benchmark-test.c)
add_test(benchmark-test benchmark-test -q --fname dir.check_benchmark-test) add_test(ft/benchmark-test benchmark-test -q --fname dir.check_benchmark-test)
add_test(benchmark-test_256 benchmark-test --valsize 256 --verify 1 --fname dir.check_benchmark-test_256) 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 set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES
dir.check_benchmark-test dir.check_benchmark-test_256) dir.check_benchmark-test dir.check_benchmark-test_256)
declare_custom_tests(ftloader-test-merge-files-dbufio.c) declare_custom_tests(ftloader-test-merge-files-dbufio.c)
add_test(ftloader-test-merge-files-dbufio ftloader-test-merge-files-dbufio -r 8000 -s dir.check_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.c) declare_custom_tests(ftloader-test.c)
add_test(ftloader-test ftloader-test dir.check_ftloader-test) add_test(ft/ftloader-test ftloader-test dir.check_ftloader-test)
declare_custom_tests(ftloader-test-bad-generate.c) declare_custom_tests(ftloader-test-bad-generate.c)
add_test(ftloader-test-bad-generate ftloader-test-bad-generate dir.check_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.c) declare_custom_tests(ftloader-test-extractor.c)
add_test(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-1 ftloader-test-extractor -s -r 1000 --rowsets 1000 --asc dir.check_ftloader-test-extractor-1)
add_test(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-2 ftloader-test-extractor -s -r 1000 --rowsets 1000 --dsc dir.check_ftloader-test-extractor-2)
add_test(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-3 ftloader-test-extractor -s -r 1000 --rowsets 1000 --random dir.check_ftloader-test-extractor-3)
add_test(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-1a ftloader-test-extractor -s -r 1000 --rowsets 1000 --asc dir.check_ftloader-test-extractor-1a)
add_test(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-2a ftloader-test-extractor -s -r 1000 --rowsets 1000 --dsc dir.check_ftloader-test-extractor-2a)
add_test(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-3a ftloader-test-extractor -s -r 1000 --rowsets 1000 --random dir.check_ftloader-test-extractor-3a)
add_test(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-4a ftloader-test-extractor -s -r 1000 --rowsets 3 --asc dir.check_ftloader-test-extractor-4a)
add_test(ftloader-test-extractor-5a ftloader-test-extractor -s -r 1000 --rowsets 3 --asc --asc-poison dir.check_ftloader-test-extractor-5a) 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.c) declare_custom_tests(ftloader-test-extractor-errors.c)
add_test(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-1 ftloader-test-extractor-errors -w -m -u -r 1 dir.check_ftloader-test-extractor-errors-1)
add_test(ftloader-test-extractor-errors-2 ftloader-test-extractor-errors -m -r 10000 dir.check_ftloader-test-extractor-errors-2) 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.c) declare_custom_tests(ftloader-test-open.c)
add_test(ftloader-test-open ftloader-test-open dir.check_ftloader-test-open) add_test(ft/ftloader-test-open ftloader-test-open dir.check_ftloader-test-open)
declare_custom_tests(ftloader-test-writer.c) declare_custom_tests(ftloader-test-writer.c)
add_test(ftloader-test-writer-1 ftloader-test-writer -r 1 -s dir.check_ftloader-test-writer-1) add_test(ft/ftloader-test-writer-1 ftloader-test-writer -r 1 -s dir.check_ftloader-test-writer-1)
add_test(ftloader-test-writer-1000 ftloader-test-writer -r 1000 -s dir.check_ftloader-test-writer-1000) add_test(ft/ftloader-test-writer-1000 ftloader-test-writer -r 1000 -s dir.check_ftloader-test-writer-1000)
add_test(ftloader-test-writer-100000 ftloader-test-writer -r 100000 -s dir.check_ftloader-test-writer-100000) add_test(ft/ftloader-test-writer-100000 ftloader-test-writer -r 100000 -s dir.check_ftloader-test-writer-100000)
add_test(ftloader-test-writer-1000000 ftloader-test-writer -r 1000000 -s dir.check_ftloader-test-writer-1000000) add_test(ft/ftloader-test-writer-1000000 ftloader-test-writer -r 1000000 -s dir.check_ftloader-test-writer-1000000)
add_test(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-1-x ftloader-test-writer -r 1 -s -x 42 dir.check_ftloader-test-writer-1-x)
add_test(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-1000-x ftloader-test-writer -r 1000 -s -x 42 dir.check_ftloader-test-writer-1000-x)
add_test(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-100000-x ftloader-test-writer -r 100000 -s -x 42 dir.check_ftloader-test-writer-100000-x)
add_test(ftloader-test-writer-1000000-x ftloader-test-writer -r 1000000 -s -x 42 dir.check_ftloader-test-writer-1000000-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.c) declare_custom_tests(ftloader-test-writer-errors.c)
add_test(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-1 ftloader-test-writer-errors -w -m -u -r 100000 dir.check_ftloader-test-writer-errors-1)
add_test(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-2 ftloader-test-writer-errors -s -w -m -u -r 10000 dir.check_ftloader-test-writer-errors-2)
add_test(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-3 ftloader-test-writer-errors -s -r 20000 --malloc_limit 0 --realloc_errors dir.check_ftloader-test-writer-errors-3)
add_test(ftloader-test-writer-errors-4 ftloader-test-writer-errors -s -m --malloc_limit 0 -r 10000 dir.check_ftloader-test-writer-errors-4) 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.c) declare_custom_tests(ft-serialize-benchmark.c)
add_test(ft-serialize-benchmark ft-serialize-benchmark 92 200000) add_test(ft/ft-serialize-benchmark ft-serialize-benchmark 92 200000)
declare_custom_tests(bnc-insert-benchmark.c) declare_custom_tests(bnc-insert-benchmark.c)
add_test(bnc-insert-benchmark bnc-insert-benchmark 100 4096000 1000) add_test(ft/bnc-insert-benchmark bnc-insert-benchmark 100 4096000 1000)
foreach(src ${srcs}) foreach(src ${srcs})
if(NOT "${src}" MATCHES "dir[.].*[.]c") if(NOT "${src}" MATCHES "dir[.].*[.]c")
## add a default test rule that runs with no options ## add a default test rule that runs with no options
get_filename_component(base ${src} NAME_WE) get_filename_component(base ${src} NAME_WE)
add_test(${base} ${base}) add_test(ft/${base} ${base})
endif() endif()
endforeach(src) endforeach(src)
## give some tests, that time out normally, 1 hour to complete ## give some tests, that time out normally, 1 hour to complete
set(long_tests set(long_tests
log-test7 ft/log-test7
subblock-test-compression ft/subblock-test-compression
is_empty ft/is_empty
recovery-bad-last-entry ft/recovery-bad-last-entry
ftloader-test-extractor-3a ft/ftloader-test-extractor-3a
upgrade_test_simple ft/upgrade_test_simple
) )
set_tests_properties(${long_tests} PROPERTIES TIMEOUT 3600) set_tests_properties(${long_tests} PROPERTIES TIMEOUT 3600)
## some take even longer, with valgrind ## some take even longer, with valgrind
set(extra_long_tests set(extra_long_tests
subblock-test-checksum ft/subblock-test-checksum
) )
set_tests_properties(${extra_long_tests} PROPERTIES TIMEOUT 7200) set_tests_properties(${extra_long_tests} PROPERTIES TIMEOUT 7200)
## these take a really long time with valgrind ## these take a really long time with valgrind
set(phenomenally_long_tests set(phenomenally_long_tests
benchmark-test ft/benchmark-test
benchmark-test_256 ft/benchmark-test_256
) )
set_tests_properties(${phenomenally_long_tests} PROPERTIES TIMEOUT 14400) set_tests_properties(${phenomenally_long_tests} PROPERTIES TIMEOUT 14400)
endif(BUILD_TESTING) endif(BUILD_TESTING)
...@@ -30,23 +30,23 @@ if(BUILD_TESTING) ...@@ -30,23 +30,23 @@ if(BUILD_TESTING)
endforeach(src) endforeach(src)
list(REMOVE_ITEM tests test-pwrite4g) list(REMOVE_ITEM tests test-pwrite4g)
add_test(test-pwrite4g test-pwrite4g .) add_test(portability/test-pwrite4g test-pwrite4g .)
configure_file(ensure_memcheck_fails.sh . COPYONLY) configure_file(ensure_memcheck_fails.sh . COPYONLY)
foreach(test try-leak-lost try-leak-reachable try-uninit) foreach(test try-leak-lost try-leak-reachable try-uninit)
list(REMOVE_ITEM tests ${test}) list(REMOVE_ITEM tests ${test})
add_test(NAME ${test} add_test(NAME portability/${test}
COMMAND ensure_memcheck_fails.sh $<TARGET_FILE:${test}> valgrind --error-exitcode=1 --quiet --leak-check=full --show-reachable=yes --trace-children=yes --trace-children-skip=sh,*/sh,rm,*/rm,cp,*/cp,mv,*/mv,cat,*/cat,diff,test,wc,*/wc) COMMAND ensure_memcheck_fails.sh $<TARGET_FILE:${test}> valgrind --error-exitcode=1 --quiet --leak-check=full --show-reachable=yes --trace-children=yes --trace-children-skip=sh,*/sh,rm,*/rm,cp,*/cp,mv,*/mv,cat,*/cat,diff,test,wc,*/wc)
endforeach(test) endforeach(test)
foreach(test ${tests}) foreach(test ${tests})
add_test(${test} ${test}) add_test(portability/${test} ${test})
endforeach(test) endforeach(test)
set(portability_tests_should_fail set(portability_tests_should_fail
try-assert0 portability/try-assert0
try-assert-zero portability/try-assert-zero
) )
set_tests_properties(${portability_tests_should_fail} PROPERTIES WILL_FAIL TRUE) set_tests_properties(${portability_tests_should_fail} PROPERTIES WILL_FAIL TRUE)
......
...@@ -2,15 +2,17 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}) ...@@ -2,15 +2,17 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR})
set(lock_tree_srcs locktree.c idlth.c lth.c rth.c txnid_set.c wfg.c) set(lock_tree_srcs locktree.c idlth.c lth.c rth.c txnid_set.c wfg.c)
## make the linear library ## make the linear library for tests
add_library(lock_tree_lin_static STATIC ${lock_tree_srcs}) add_library(lock_tree_lin SHARED ${lock_tree_srcs})
add_dependencies(lock_tree_lin_static install_tdb_h) target_link_libraries(lock_tree_lin range_tree_lin)
add_dependencies(lock_tree_lin install_tdb_h)
## make the log library ## make the log library for tests
add_library(lock_tree_tlog_static STATIC ${lock_tree_srcs}) add_library(lock_tree_tlog SHARED ${lock_tree_srcs})
set_property(TARGET lock_tree_tlog_static APPEND PROPERTY set_property(TARGET lock_tree_tlog APPEND PROPERTY
COMPILE_DEFINITIONS TOKU_RT_NOOVERLAPS) COMPILE_DEFINITIONS TOKU_RT_NOOVERLAPS)
add_dependencies(lock_tree_tlog_static install_tdb_h) target_link_libraries(lock_tree_tlog range_tree_tlog)
add_dependencies(lock_tree_tlog install_tdb_h)
## make the real library, it's going to go into libtokudb.so so it needs ## make the real library, it's going to go into libtokudb.so so it needs
## to be PIC ## to be PIC
...@@ -20,6 +22,6 @@ set_property(TARGET lock_tree_static APPEND PROPERTY ...@@ -20,6 +22,6 @@ set_property(TARGET lock_tree_static APPEND PROPERTY
COMPILE_DEFINITIONS TOKU_RT_NOOVERLAPS) COMPILE_DEFINITIONS TOKU_RT_NOOVERLAPS)
add_dependencies(lock_tree_static install_tdb_h) add_dependencies(lock_tree_static install_tdb_h)
maybe_add_gcov_to_libraries(lock_tree_lin_static lock_tree_tlog_static lock_tree_static) maybe_add_gcov_to_libraries(lock_tree_lin lock_tree_tlog lock_tree_static)
add_subdirectory(tests) add_subdirectory(tests)
...@@ -6,19 +6,15 @@ if(BUILD_TESTING) ...@@ -6,19 +6,15 @@ if(BUILD_TESTING)
foreach(impl lin tlog) foreach(impl lin tlog)
## each source file test_foo.c creates binaries lt_test_foo.lin and ## each source file test_foo.c creates binaries lt_test_foo.lin and
## lt_test_foo.tlog ## lt_test_foo.tlog
## need lt_ prefix so that we have unique target names for cmake
add_executable(lt_${base}.${impl} ${src}) add_executable(lt_${base}.${impl} ${src})
set_property(TARGET lt_${base}.${impl} APPEND PROPERTY set_property(TARGET lt_${base}.${impl} APPEND PROPERTY
COMPILE_DEFINITIONS "TESTDIR=\"dir.${base}.c.${impl}\"") COMPILE_DEFINITIONS "TESTDIR=\"dir.${base}.c.${impl}\"")
add_space_separated_property(TARGET lt_${base}.${impl} COMPILE_FLAGS -fvisibility=hidden) add_common_options_to_binary_targets(lt_${base}.${impl})
target_link_libraries(lt_${base}.${impl} target_link_libraries(lt_${base}.${impl} lock_tree_${impl})
lock_tree_${impl}_static
range_tree_${impl}_static
ft
${LIBTOKUPORTABILITY}
)
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "dir.${base}.c.${impl}") set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "dir.${base}.c.${impl}")
add_test(lt_${base}.${impl} lt_${base}.${impl}) add_test(lock_tree/${base}.${impl} lt_${base}.${impl})
endforeach(impl) endforeach(impl)
set_property(TARGET lt_${base}.tlog APPEND PROPERTY set_property(TARGET lt_${base}.tlog APPEND PROPERTY
...@@ -27,17 +23,16 @@ if(BUILD_TESTING) ...@@ -27,17 +23,16 @@ if(BUILD_TESTING)
## run test_footprint_point_write.c and test_footprint_range_write.c in ## run test_footprint_point_write.c and test_footprint_range_write.c in
## a bunch of different ways. ## a bunch of different ways.
## TODO: add lt_ prefix to test names
foreach(impl lin tlog) foreach(impl lin tlog)
foreach(type point range) foreach(type point range)
foreach(i 1 2) foreach(i 1 2)
add_test(check_footprint_${type}_${i}.${impl} add_test(lock_tree/check_footprint_${type}_${i}.${impl}
lt_test_footprint_${type}_write.${impl} --nrows ${i}) lt_test_footprint_${type}_write.${impl} --nrows ${i})
endforeach(i) endforeach(i)
foreach(i 10 100 1000) foreach(i 10 100 1000)
math(EXPR nlocks "${i} * 100") math(EXPR nlocks "${i} * 100")
math(EXPR memsize "(${i} / 10) * 4096") math(EXPR memsize "(${i} / 10) * 4096")
add_test(check_footprint_${type}_${i}.${impl} add_test(lock_tree/check_footprint_${type}_${i}.${impl}
lt_test_footprint_${type}_write.${impl} --nrows ${i} --max_locks ${nlocks} --max_lock_memory ${memsize}) lt_test_footprint_${type}_write.${impl} --nrows ${i} --max_locks ${nlocks} --max_lock_memory ${memsize})
endforeach(i) endforeach(i)
endforeach(type) endforeach(type)
......
include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR})
## make the linear library ## make the linear library for tests
add_library(range_tree_lin_static STATIC linear.c) add_library(range_tree_lin SHARED linear.c)
add_dependencies(range_tree_lin_static install_tdb_h) target_link_libraries(range_tree_lin ft ${LIBTOKUPORTABILITY})
add_dependencies(range_tree_lin install_tdb_h)
## make the log library ## make the log library for tests
add_library(range_tree_tlog_static STATIC log_nooverlap.c) add_library(range_tree_tlog SHARED log_nooverlap.c)
add_dependencies(range_tree_tlog_static install_tdb_h) target_link_libraries(range_tree_tlog ft ${LIBTOKUPORTABILITY})
add_dependencies(range_tree_tlog install_tdb_h)
## make the real library, it's going to go into libtokudb.so so it needs ## make the real library, it's going to go into libtokudb.so so it needs
## to be PIC ## to be PIC
...@@ -14,6 +16,6 @@ add_library(range_tree_static STATIC log_nooverlap.c) ...@@ -14,6 +16,6 @@ add_library(range_tree_static STATIC log_nooverlap.c)
add_space_separated_property(TARGET range_tree_static COMPILE_FLAGS "-fvisibility=hidden -fPIC") add_space_separated_property(TARGET range_tree_static COMPILE_FLAGS "-fvisibility=hidden -fPIC")
add_dependencies(range_tree_static install_tdb_h) add_dependencies(range_tree_static install_tdb_h)
maybe_add_gcov_to_libraries(range_tree_lin_static range_tree_tlog_static range_tree_static) maybe_add_gcov_to_libraries(range_tree_lin range_tree_tlog range_tree_static)
add_subdirectory(tests) add_subdirectory(tests)
...@@ -6,18 +6,15 @@ if(BUILD_TESTING) ...@@ -6,18 +6,15 @@ if(BUILD_TESTING)
foreach(impl lin tlog) foreach(impl lin tlog)
## each source file test_foo.c creates binaries rt_test_foo.lin and ## each source file test_foo.c creates binaries rt_test_foo.lin and
## rt_test_foo.tlog ## rt_test_foo.tlog
## need rt_ prefix so that we have unique target names for cmake
add_executable(rt_${base}.${impl} ${src}) add_executable(rt_${base}.${impl} ${src})
set_property(TARGET rt_${base}.${impl} APPEND PROPERTY set_property(TARGET rt_${base}.${impl} APPEND PROPERTY
COMPILE_DEFINITIONS "TESTDIR=\"dir.${base}.c.${impl}\"") COMPILE_DEFINITIONS "TESTDIR=\"dir.${base}.c.${impl}\"")
add_space_separated_property(TARGET rt_${base}.${impl} COMPILE_FLAGS -fvisibility=hidden) add_common_options_to_binary_targets(rt_${base}.${impl})
target_link_libraries(rt_${base}.${impl} target_link_libraries(rt_${base}.${impl} range_tree_${impl})
range_tree_${impl}_static
ft
${LIBTOKUPORTABILITY}
)
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "dir.${base}.c.${impl}") set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "dir.${base}.c.${impl}")
add_test(rt_${base}.${impl} rt_${base}.${impl}) add_test(range_tree/${base}.${impl} rt_${base}.${impl})
endforeach(impl) endforeach(impl)
set_property(TARGET rt_${base}.tlog APPEND PROPERTY set_property(TARGET rt_${base}.tlog APPEND PROPERTY
......
...@@ -369,80 +369,83 @@ if(BUILD_TESTING) ...@@ -369,80 +369,83 @@ if(BUILD_TESTING)
declare_custom_bdb_tests(test1426.bdb) declare_custom_bdb_tests(test1426.bdb)
configure_file(run_test1426.sh . COPYONLY) configure_file(run_test1426.sh . COPYONLY)
add_test(NAME test1426.tdb add_test(NAME ydb/test1426.tdb
COMMAND run_test1426.sh COMMAND run_test1426.sh
$<TARGET_FILE:test1426.tdb> $<TARGET_FILE:test1426.bdb> $<TARGET_FILE:test1426.tdb> $<TARGET_FILE:test1426.bdb>
$<TARGET_FILE:tokudb_dump> "${BDBDIR}/bin/db_dump" $<TARGET_FILE:tokudb_dump> "${BDBDIR}/bin/db_dump"
test1426.bdbdump/dump.bdb.1426) test1426.bdbdump/dump.bdb.1426)
add_dependencies(test1426.tdb tokudb_dump) add_dependencies(ydb/test1426.tdb tokudb_dump)
endif() endif()
string(REGEX REPLACE "\\.c(;|$)" ".tdb\\1" recover_would_be_tdb_tests "${recover_srcs}") string(REGEX REPLACE "\\.c(;|$)" ".tdb\\1" recover_would_be_tdb_tests "${recover_srcs}")
declare_custom_tests(${recover_would_be_tdb_tests}) declare_custom_tests(${recover_would_be_tdb_tests})
declare_custom_tests(powerfail.tdb) declare_custom_tests(powerfail.tdb)
add_test(powerfail.tdb echo must run powerfail by hand) add_test(ydb/powerfail.tdb echo must run powerfail by hand)
declare_custom_tests(checkpoint_stress.tdb) declare_custom_tests(checkpoint_stress.tdb)
configure_file(run_checkpoint_stress_test.sh . COPYONLY) configure_file(run_checkpoint_stress_test.sh . COPYONLY)
add_test(NAME checkpoint_stress.tdb add_test(NAME ydb/checkpoint_stress.tdb
COMMAND run_checkpoint_stress_test.sh $<TARGET_FILE:checkpoint_stress.tdb> 5 5001 137) COMMAND run_checkpoint_stress_test.sh $<TARGET_FILE:checkpoint_stress.tdb> 5 5001 137)
declare_custom_tests(recover_stress.tdb) declare_custom_tests(recover_stress.tdb)
add_custom_executable(recover stress.tdb checkpoint_stress.c) add_custom_executable(recover stress.tdb checkpoint_stress.c)
configure_file(run_recover_stress_test.sh . COPYONLY) configure_file(run_recover_stress_test.sh . COPYONLY)
add_test(NAME recover_stress.tdb add_test(NAME ydb/recover_stress.tdb
COMMAND run_recover_stress_test.sh $<TARGET_FILE:recover_stress.tdb> 5 5001 137) COMMAND run_recover_stress_test.sh $<TARGET_FILE:recover_stress.tdb> 5 5001 137)
declare_custom_tests(diskfull.tdb) declare_custom_tests(diskfull.tdb)
configure_file(run_diskfull_test.sh . COPYONLY) configure_file(run_diskfull_test.sh . COPYONLY)
add_test(NAME diskfull.tdb add_test(NAME ydb/diskfull.tdb
COMMAND run_diskfull_test.sh $<TARGET_FILE:diskfull.tdb> 134) COMMAND run_diskfull_test.sh $<TARGET_FILE:diskfull.tdb> 134)
declare_custom_tests(recovery_fileops_unit.tdb) declare_custom_tests(recovery_fileops_unit.tdb)
configure_file(run_recovery_fileops_unit_test.sh . COPYONLY) configure_file(run_recovery_fileops_unit_test.sh . COPYONLY)
add_test(NAME recovery_fileops_unit.tdb add_test(NAME ydb/recovery_fileops_unit.tdb
COMMAND run_recovery_fileops_unit_test.sh $<TARGET_FILE:recovery_fileops_unit.tdb> 137) COMMAND run_recovery_fileops_unit_test.sh $<TARGET_FILE:recovery_fileops_unit.tdb> 137)
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "dir.recovery_fileops_unit.c.errors") set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "dir.recovery_fileops_unit.c.errors")
if (NOT (CMAKE_SYSTEM_NAME MATCHES Darwin OR USE_GCOV)) if (NOT (CMAKE_SYSTEM_NAME MATCHES Darwin OR
(CMAKE_C_COMPILER_ID STREQUAL Intel AND
CMAKE_BUILD_TYPE STREQUAL Release)
OR USE_GCOV))
declare_custom_tests(helgrind1.tdb) declare_custom_tests(helgrind1.tdb)
add_test(NAME helgrind_helgrind1.tdb add_test(NAME ydb/helgrind_helgrind1.tdb
COMMAND valgrind --quiet --tool=helgrind --error-exitcode=1 --log-file=helgrind1.tdb.deleteme $<TARGET_FILE:helgrind1.tdb>) COMMAND valgrind --quiet --tool=helgrind --error-exitcode=1 --log-file=helgrind1.tdb.deleteme $<TARGET_FILE:helgrind1.tdb>)
set_tests_properties(helgrind_helgrind1.tdb PROPERTIES WILL_FAIL TRUE) set_tests_properties(ydb/helgrind_helgrind1.tdb PROPERTIES WILL_FAIL TRUE)
endif() endif()
declare_custom_tests(helgrind2.tdb) declare_custom_tests(helgrind2.tdb)
declare_custom_tests(helgrind3.tdb) declare_custom_tests(helgrind3.tdb)
add_helgrind_test(helgrind2.tdb $<TARGET_FILE:helgrind2.tdb>) add_helgrind_test(ydb/helgrind_helgrind2.tdb $<TARGET_FILE:helgrind2.tdb>)
add_helgrind_test(helgrind3.tdb $<TARGET_FILE:helgrind3.tdb>) add_helgrind_test(ydb/helgrind_helgrind3.tdb $<TARGET_FILE:helgrind3.tdb>)
declare_custom_tests(test_groupcommit_count.tdb) declare_custom_tests(test_groupcommit_count.tdb)
add_test(test_groupcommit_count.tdb test_groupcommit_count.tdb -n 1 -p vgrind) add_test(ydb/test_groupcommit_count.tdb test_groupcommit_count.tdb -n 1 -p vgrind)
add_custom_executable(helgrind test_groupcommit_count.tdb test_groupcommit_count.c) add_custom_executable(helgrind test_groupcommit_count.tdb test_groupcommit_count.c)
add_helgrind_test(helgrind_test_groupcommit_count.tdb $<TARGET_FILE:helgrind_test_groupcommit_count.tdb> -n 1 -p hgrind) add_helgrind_test(ydb/helgrind_test_groupcommit_count.tdb $<TARGET_FILE:helgrind_test_groupcommit_count.tdb> -n 1 -p hgrind)
add_custom_executable(drd test_groupcommit_count.tdb test_groupcommit_count.c) add_custom_executable(drd test_groupcommit_count.tdb test_groupcommit_count.c)
add_drd_test(drd_test_groupcommit_count.tdb $<TARGET_FILE:drd_test_groupcommit_count.tdb> -n 1 -p drd) add_drd_test(ydb/drd_test_groupcommit_count.tdb $<TARGET_FILE:drd_test_groupcommit_count.tdb> -n 1 -p drd)
add_custom_executable(drd test_4015.tdb test_4015.c) add_custom_executable(drd test_4015.tdb test_4015.c)
add_drd_test(drd_test_4015.tdb $<TARGET_FILE:drd_test_4015.tdb>) add_drd_test(ydb/drd_test_4015.tdb $<TARGET_FILE:drd_test_4015.tdb>)
configure_file(run_stress_test.sh . COPYONLY) configure_file(run_stress_test.sh . COPYONLY)
foreach(src ${stress_test_srcs}) foreach(src ${stress_test_srcs})
if(NOT ${src} MATCHES hot_index) if(NOT ${src} MATCHES hot_index)
string(REGEX REPLACE "\\.c$" ".tdb" test "${src}") string(REGEX REPLACE "\\.c$" ".tdb" test "${src}")
add_test(${test} ${CMAKE_CFG_INTDIR}/run_stress_test.sh $<TARGET_FILE:${test}> 150000 1000) add_test(ydb/${test} ${CMAKE_CFG_INTDIR}/run_stress_test.sh $<TARGET_FILE:${test}> 150000 1000)
add_custom_executable(tiny ${test} ${src}) add_custom_executable(tiny ${test} ${src})
add_drd_test(drd_tiny_${test} $<TARGET_FILE:tiny_${test}> --num_seconds 5 --num_elements 150) add_drd_test(ydb/drd_tiny_${test} $<TARGET_FILE:tiny_${test}> --num_seconds 5 --num_elements 150)
add_custom_executable(mid ${test} ${src}) add_custom_executable(mid ${test} ${src})
add_drd_test(drd_mid_${test} ${CMAKE_CFG_INTDIR}/run_stress_test.sh $<TARGET_FILE:mid_${test}> 10000 100) add_drd_test(ydb/drd_mid_${test} ${CMAKE_CFG_INTDIR}/run_stress_test.sh $<TARGET_FILE:mid_${test}> 10000 100)
set_tests_properties(drd_mid_${test} PROPERTIES TIMEOUT 14400) set_tests_properties(ydb/drd_mid_${test} PROPERTIES TIMEOUT 14400)
add_custom_executable(large ${test} ${src}) add_custom_executable(large ${test} ${src})
add_drd_test(drd_large_${test} ${CMAKE_CFG_INTDIR}/run_stress_test.sh $<TARGET_FILE:large_${test}> 150000 1000) add_drd_test(ydb/drd_large_${test} ${CMAKE_CFG_INTDIR}/run_stress_test.sh $<TARGET_FILE:large_${test}> 150000 1000)
set_tests_properties(drd_large_${test} PROPERTIES TIMEOUT 28800) set_tests_properties(ydb/drd_large_${test} PROPERTIES TIMEOUT 28800)
endif() endif()
endforeach(src) endforeach(src)
...@@ -453,12 +456,12 @@ if(BUILD_TESTING) ...@@ -453,12 +456,12 @@ if(BUILD_TESTING)
# MAIN_DEPENDENCY run_test_thread_stack.sh # MAIN_DEPENDENCY run_test_thread_stack.sh
# VERBATIM) # VERBATIM)
#add_custom_target(install_run_test_thread_stack.sh ALL DEPENDS run_test_thread_stack.sh) #add_custom_target(install_run_test_thread_stack.sh ALL DEPENDS run_test_thread_stack.sh)
#add_test(test_thread_stack.tdb run_test_thread_stack.sh "${CMAKE_CFG_INTDIR}/test_thread_stack.tdb") #add_test(ydb/test_thread_stack.tdb run_test_thread_stack.sh "${CMAKE_CFG_INTDIR}/test_thread_stack.tdb")
declare_custom_tests(root_fifo_41.tdb) declare_custom_tests(root_fifo_41.tdb)
foreach(num RANGE 1 100) foreach(num RANGE 1 100)
add_test(root_fifo_41_${num}_populate.tdb root_fifo_41.tdb -n ${num} -h root_fifo_41_${num}_populate.tdbdir -populate) add_test(ydb/root_fifo_41_${num}_populate.tdb root_fifo_41.tdb -n ${num} -h root_fifo_41_${num}_populate.tdbdir -populate)
add_test(root_fifo_41_${num}_nopopulate.tdb root_fifo_41.tdb -n ${num} -h root_fifo_41_${num}_nopopulate.tdbdir) add_test(ydb/root_fifo_41_${num}_nopopulate.tdb root_fifo_41.tdb -n ${num} -h root_fifo_41_${num}_nopopulate.tdbdir)
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES
root_fifo_41_${num}_populate.tdbdir root_fifo_41_${num}_populate.tdbdir
root_fifo_41_${num}_nopopulate.tdbdir root_fifo_41_${num}_nopopulate.tdbdir
...@@ -467,24 +470,24 @@ if(BUILD_TESTING) ...@@ -467,24 +470,24 @@ if(BUILD_TESTING)
declare_custom_tests(test3039.tdb) declare_custom_tests(test3039.tdb)
configure_file(run_test3039.sh . COPYONLY) configure_file(run_test3039.sh . COPYONLY)
add_test(NAME test3039.tdb add_test(NAME ydb/test3039.tdb
COMMAND run_test3039.sh $<TARGET_FILE:test3039.tdb>) COMMAND run_test3039.sh $<TARGET_FILE:test3039.tdb>)
declare_custom_tests(test_abort4.tdb) declare_custom_tests(test_abort4.tdb)
foreach(num RANGE -1 19) foreach(num RANGE -1 19)
add_test(test_abort4_${num}_0.tdb test_abort4.tdb -e dir.test_abort4_${num}_0.tdb -c 0 -l ${num}) add_test(ydb/test_abort4_${num}_0.tdb test_abort4.tdb -e dir.test_abort4_${num}_0.tdb -c 0 -l ${num})
add_test(test_abort4_${num}_1.tdb test_abort4.tdb -e dir.test_abort4_${num}_1.tdb -c 1 -l ${num}) add_test(ydb/test_abort4_${num}_1.tdb test_abort4.tdb -e dir.test_abort4_${num}_1.tdb -c 1 -l ${num})
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES dir.test_abort4_${num}_0.tdb dir.test_abort4_${num}_1.tdb) set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES dir.test_abort4_${num}_0.tdb dir.test_abort4_${num}_1.tdb)
endforeach(num) endforeach(num)
set_property(SOURCE loader-stress-test.c APPEND PROPERTY COMPILE_DEFINITIONS set_property(SOURCE loader-stress-test.c APPEND PROPERTY COMPILE_DEFINITIONS
"OLDDATADIR=\"${CMAKE_CURRENT_SOURCE_DIR}/../../../../tokudb.data/\"") "OLDDATADIR=\"${CMAKE_CURRENT_SOURCE_DIR}/../../../../tokudb.data/\"")
list(REMOVE_ITEM loader_tests loader-stress-test.loader) list(REMOVE_ITEM loader_tests loader-stress-test.loader)
add_test(loader-stress-test0.tdb loader-stress-test.tdb -c -e dir.loader-stress-test0.tdb) add_test(ydb/loader-stress-test0.tdb loader-stress-test.tdb -c -e dir.loader-stress-test0.tdb)
add_test(loader-stress-test1.tdb loader-stress-test.tdb -c -p -e dir.loader-stress-test1.tdb) add_test(ydb/loader-stress-test1.tdb loader-stress-test.tdb -c -p -e dir.loader-stress-test1.tdb)
add_test(loader-stress-test2.tdb loader-stress-test.tdb -r 5000 -s -e dir.loader-stress-test2.tdb) add_test(ydb/loader-stress-test2.tdb loader-stress-test.tdb -r 5000 -s -e dir.loader-stress-test2.tdb)
add_test(loader-stress-test3.tdb loader-stress-test.tdb -u -c -e dir.loader-stress-test3.tdb) add_test(ydb/loader-stress-test3.tdb loader-stress-test.tdb -u -c -e dir.loader-stress-test3.tdb)
add_test(loader-stress-test4.tdb loader-stress-test.tdb -r 10000000 -c -e dir.loader-stress-test4.tdb) add_test(ydb/loader-stress-test4.tdb loader-stress-test.tdb -r 10000000 -c -e dir.loader-stress-test4.tdb)
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES
dir.loader-stress-test0.tdb dir.loader-stress-test0.tdb
dir.loader-stress-test1.tdb dir.loader-stress-test1.tdb
...@@ -494,12 +497,12 @@ if(BUILD_TESTING) ...@@ -494,12 +497,12 @@ if(BUILD_TESTING)
) )
list(REMOVE_ITEM loader_tests loader-dup-test.loader) list(REMOVE_ITEM loader_tests loader-dup-test.loader)
add_test(loader-dup-test0.tdb loader-dup-test.tdb -e dir.loader-dup-test0.tdb) add_test(ydb/loader-dup-test0.tdb loader-dup-test.tdb -e dir.loader-dup-test0.tdb)
add_test(loader-dup-test1.tdb loader-dup-test.tdb -d 1 -r 500000 -e dir.loader-dup-test1.tdb) add_test(ydb/loader-dup-test1.tdb loader-dup-test.tdb -d 1 -r 500000 -e dir.loader-dup-test1.tdb)
add_test(loader-dup-test2.tdb loader-dup-test.tdb -d 1 -r 1000000 -e dir.loader-dup-test2.tdb) add_test(ydb/loader-dup-test2.tdb loader-dup-test.tdb -d 1 -r 1000000 -e dir.loader-dup-test2.tdb)
add_test(loader-dup-test3.tdb loader-dup-test.tdb -d 1 -s -r 100 -e dir.loader-dup-test3.tdb) add_test(ydb/loader-dup-test3.tdb loader-dup-test.tdb -d 1 -s -r 100 -e dir.loader-dup-test3.tdb)
add_test(loader-dup-test4.tdb loader-dup-test.tdb -d 1 -s -r 1000 -e dir.loader-dup-test4.tdb) add_test(ydb/loader-dup-test4.tdb loader-dup-test.tdb -d 1 -s -r 1000 -e dir.loader-dup-test4.tdb)
add_test(loader-dup-test5.tdb loader-dup-test.tdb -d 1 -s -r 1000 -E -e dir.loader-dup-test5.tdb) add_test(ydb/loader-dup-test5.tdb loader-dup-test.tdb -d 1 -s -r 1000 -E -e dir.loader-dup-test5.tdb)
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES
dir.loader-dup-test0.tdb dir.loader-dup-test0.tdb
dir.loader-dup-test1.tdb dir.loader-dup-test1.tdb
...@@ -511,10 +514,10 @@ if(BUILD_TESTING) ...@@ -511,10 +514,10 @@ if(BUILD_TESTING)
## as part of #4503, we took out test 1 and 3 ## as part of #4503, we took out test 1 and 3
list(REMOVE_ITEM loader_tests loader-cleanup-test.loader) list(REMOVE_ITEM loader_tests loader-cleanup-test.loader)
add_test(loader-cleanup-test0.tdb loader-cleanup-test.tdb -s -r 800 -e dir.loader-cleanup-test0.tdb) add_test(ydb/loader-cleanup-test0.tdb loader-cleanup-test.tdb -s -r 800 -e dir.loader-cleanup-test0.tdb)
#add_test(loader-cleanup-test1.tdb loader-cleanup-test.tdb -s -r 800 -p -e dir.loader-cleanup-test1.tdb) #add_test(ydb/loader-cleanup-test1.tdb loader-cleanup-test.tdb -s -r 800 -p -e dir.loader-cleanup-test1.tdb)
add_test(loader-cleanup-test2.tdb loader-cleanup-test.tdb -s -r 8000 -e dir.loader-cleanup-test2.tdb) add_test(ydb/loader-cleanup-test2.tdb loader-cleanup-test.tdb -s -r 8000 -e dir.loader-cleanup-test2.tdb)
#add_test(loader-cleanup-test3.tdb loader-cleanup-test.tdb -s -r 8000 -p -e dir.loader-cleanup-test3.tdb) #add_test(ydb/loader-cleanup-test3.tdb loader-cleanup-test.tdb -s -r 8000 -p -e dir.loader-cleanup-test3.tdb)
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES
dir.loader-cleanup-test0.tdb dir.loader-cleanup-test0.tdb
dir.loader-cleanup-test1.tdb dir.loader-cleanup-test1.tdb
...@@ -523,12 +526,12 @@ if(BUILD_TESTING) ...@@ -523,12 +526,12 @@ if(BUILD_TESTING)
) )
declare_custom_tests(keyrange.tdb) declare_custom_tests(keyrange.tdb)
add_test(keyrange-get0.tdb keyrange.tdb --get 0 --envdir dir.keyrange-get0.tdb) add_test(ydb/keyrange-get0.tdb keyrange.tdb --get 0 --envdir dir.keyrange-get0.tdb)
add_test(keyrange-get1.tdb keyrange.tdb --get 1 --envdir dir.keyrange-get1.tdb) add_test(ydb/keyrange-get1.tdb keyrange.tdb --get 1 --envdir dir.keyrange-get1.tdb)
add_test(keyrange-random-get0.tdb keyrange.tdb --get 0 --random_keys 1 --envdir dir.keyrange-random-get0.tdb) add_test(ydb/keyrange-random-get0.tdb keyrange.tdb --get 0 --random_keys 1 --envdir dir.keyrange-random-get0.tdb)
add_test(keyrange-random-get1.tdb keyrange.tdb --get 1 --random_keys 1 --envdir dir.keyrange-random-get1.tdb) add_test(ydb/keyrange-random-get1.tdb keyrange.tdb --get 1 --random_keys 1 --envdir dir.keyrange-random-get1.tdb)
add_test(keyrange-loader-get0.tdb keyrange.tdb --get 0 --loader 1 --envdir dir.keyrange-loader-get0.tdb) add_test(ydb/keyrange-loader-get0.tdb keyrange.tdb --get 0 --loader 1 --envdir dir.keyrange-loader-get0.tdb)
add_test(keyrange-loader-get1.tdb keyrange.tdb --get 1 --loader 1 --envdir dir.keyrange-loader-get1.tdb) add_test(ydb/keyrange-loader-get1.tdb keyrange.tdb --get 1 --loader 1 --envdir dir.keyrange-loader-get1.tdb)
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES
dir.keyrange-get0.tdb dir.keyrange-get0.tdb
dir.keyrange-get1.tdb dir.keyrange-get1.tdb
...@@ -539,8 +542,8 @@ if(BUILD_TESTING) ...@@ -539,8 +542,8 @@ if(BUILD_TESTING)
) )
declare_custom_tests(maxsize-for-loader.tdb) declare_custom_tests(maxsize-for-loader.tdb)
add_test(maxsize-for-loader-A.tdb maxsize-for-loader.tdb -e dir.maxsize-for-loader-A.tdb -f) add_test(ydb/maxsize-for-loader-A.tdb maxsize-for-loader.tdb -e dir.maxsize-for-loader-A.tdb -f)
add_test(maxsize-for-loader-B.tdb maxsize-for-loader.tdb -e dir.maxsize-for-loader-B.tdb) add_test(ydb/maxsize-for-loader-B.tdb maxsize-for-loader.tdb -e dir.maxsize-for-loader-B.tdb)
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES
dir.maxsize-for-loader-A.tdb dir.maxsize-for-loader-A.tdb
dir.maxsize-for-loader-B.tdb dir.maxsize-for-loader-B.tdb
...@@ -555,17 +558,17 @@ if(BUILD_TESTING) ...@@ -555,17 +558,17 @@ if(BUILD_TESTING)
endforeach(result) endforeach(result)
foreach(test ${hotindexer_tests}) foreach(test ${hotindexer_tests})
configure_file(${test} ${test} COPYONLY) configure_file(${test} ${test} COPYONLY)
add_test(NAME ${test} COMMAND run-hotindexer-undo-do-tests.bash ${test}) add_test(NAME ydb/${test} COMMAND run-hotindexer-undo-do-tests.bash ${test})
endforeach() endforeach()
foreach(test ${tdb_tests} ${bdb_tests}) foreach(test ${tdb_tests} ${bdb_tests})
add_test(${test} ${test}) add_test(ydb/${test} ${test})
endforeach(test) endforeach(test)
configure_file(run_recover_test.sh . COPYONLY) configure_file(run_recover_test.sh . COPYONLY)
foreach(recover_test ${recover_tests}) foreach(recover_test ${recover_tests})
get_filename_component(base ${recover_test} NAME_WE) get_filename_component(base ${recover_test} NAME_WE)
add_test(NAME ${recover_test} add_test(NAME ydb/${recover_test}
COMMAND run_recover_test.sh $<TARGET_FILE:${base}.tdb> "dir.${base}.c.tdb" $<TARGET_FILE:tdb-recover> $<TARGET_FILE:tokudb_dump_static>) COMMAND run_recover_test.sh $<TARGET_FILE:${base}.tdb> "dir.${base}.c.tdb" $<TARGET_FILE:tdb-recover> $<TARGET_FILE:tokudb_dump_static>)
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "dir.${base}.c.tdb" "dir.${base}.c.tdb.recover") set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "dir.${base}.c.tdb" "dir.${base}.c.tdb.recover")
endforeach(recover_test) endforeach(recover_test)
...@@ -573,14 +576,14 @@ if(BUILD_TESTING) ...@@ -573,14 +576,14 @@ if(BUILD_TESTING)
configure_file(run_abortrecover_test.sh . COPYONLY) configure_file(run_abortrecover_test.sh . COPYONLY)
foreach(abortrecover_test ${abortrecover_tests}) foreach(abortrecover_test ${abortrecover_tests})
get_filename_component(base ${abortrecover_test} NAME_WE) get_filename_component(base ${abortrecover_test} NAME_WE)
add_test(NAME ${base}.abortrecover add_test(NAME ydb/${base}.abortrecover
COMMAND run_abortrecover_test.sh $<TARGET_FILE:${base}.tdb> 137) COMMAND run_abortrecover_test.sh $<TARGET_FILE:${base}.tdb> 137)
endforeach(abortrecover_test) endforeach(abortrecover_test)
foreach(loader_test ${loader_tests}) foreach(loader_test ${loader_tests})
get_filename_component(base ${loader_test} NAME_WE) get_filename_component(base ${loader_test} NAME_WE)
add_test(${base}.nop.loader ${base}.tdb -e "dir.${base}.nop.loader") add_test(ydb/${base}.nop.loader ${base}.tdb -e "dir.${base}.nop.loader")
add_test(${base}.p.loader ${base}.tdb -p -e "dir.${base}.p.loader") add_test(ydb/${base}.p.loader ${base}.tdb -p -e "dir.${base}.p.loader")
if("${tdb_tests_that_should_fail}" MATCHES "${base}.loader") if("${tdb_tests_that_should_fail}" MATCHES "${base}.loader")
list(REMOVE_ITEM tdb_tests_that_should_fail ${base}.loader) list(REMOVE_ITEM tdb_tests_that_should_fail ${base}.loader)
list(APPEND tdb_tests_that_should_fail ${base}.nop.loader ${base}.p.loader) list(APPEND tdb_tests_that_should_fail ${base}.nop.loader ${base}.p.loader)
...@@ -588,64 +591,66 @@ if(BUILD_TESTING) ...@@ -588,64 +591,66 @@ if(BUILD_TESTING)
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "dir.${base}.nop.loader" "dir.${base}.p.loader") set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "dir.${base}.nop.loader" "dir.${base}.p.loader")
endforeach(loader_test) endforeach(loader_test)
set(tdb_tests_that_should_fail "ydb/${tdb_tests_that_should_fail}")
string(REGEX REPLACE ";" ";ydb/" tdb_tests_that_should_fail "${tdb_tests_that_should_fail}")
set_tests_properties(${tdb_tests_that_should_fail} PROPERTIES WILL_FAIL TRUE) set_tests_properties(${tdb_tests_that_should_fail} PROPERTIES WILL_FAIL TRUE)
## give some tests, that time out normally, 1 hour to complete ## give some tests, that time out normally, 1 hour to complete
set(long_tests set(long_tests
test_query.tdb ydb/test_query.tdb
test1572.tdb ydb/test1572.tdb
checkpoint_1.tdb ydb/checkpoint_1.tdb
env-put-multiple.tdb ydb/env-put-multiple.tdb
loader-cleanup-test0.tdb ydb/loader-cleanup-test0.tdb
loader-cleanup-test2.tdb ydb/loader-cleanup-test2.tdb
loader-stress-test4.tdb ydb/loader-stress-test4.tdb
manyfiles.tdb ydb/manyfiles.tdb
root_fifo_1.tdb ydb/root_fifo_1.tdb
root_fifo_2.tdb ydb/root_fifo_2.tdb
root_fifo_31.tdb ydb/root_fifo_31.tdb
root_fifo_32.tdb ydb/root_fifo_32.tdb
shutdown-3344.tdb ydb/shutdown-3344.tdb
stat64-create-modify-times.tdb ydb/stat64-create-modify-times.tdb
test_abort4_19_0.tdb ydb/test_abort4_19_0.tdb
test_abort4_19_1.tdb ydb/test_abort4_19_1.tdb
test_abort5.tdb ydb/test_abort5.tdb
test_archive1.tdb ydb/test_archive1.tdb
test_logmax.tdb ydb/test_logmax.tdb
test_txn_abort5.tdb ydb/test_txn_abort5.tdb
test_txn_abort5a.tdb ydb/test_txn_abort5a.tdb
test_txn_abort6.tdb ydb/test_txn_abort6.tdb
test_txn_nested2.tdb ydb/test_txn_nested2.tdb
test_txn_nested4.tdb ydb/test_txn_nested4.tdb
test_txn_nested5.tdb ydb/test_txn_nested5.tdb
recovery_fileops_stress.tdb ydb/recovery_fileops_stress.tdb
recovery_fileops_unit.tdb ydb/recovery_fileops_unit.tdb
) )
if (BDB_FOUND) if (BDB_FOUND)
list(APPEND long_tests list(APPEND long_tests
test1426.tdb ydb/test1426.tdb
root_fifo_1.bdb ydb/root_fifo_1.bdb
root_fifo_31.bdb ydb/root_fifo_31.bdb
test_log10.bdb ydb/test_log10.bdb
test_log7.bdb ydb/test_log7.bdb
test_logmax.bdb ydb/test_logmax.bdb
rowsize.bdb ydb/rowsize.bdb
) )
endif (BDB_FOUND) endif (BDB_FOUND)
set_tests_properties(${long_tests} PROPERTIES TIMEOUT 3600) set_tests_properties(${long_tests} PROPERTIES TIMEOUT 3600)
## some take even longer, with valgrind ## some take even longer, with valgrind
set(extra_long_tests set(extra_long_tests
drd_test_4015.tdb ydb/drd_test_4015.tdb
test3039.tdb ydb/test3039.tdb
loader-dup-test0.tdb ydb/loader-dup-test0.tdb
loader-stress-del.p.loader ydb/loader-stress-del.p.loader
loader-stress-del.nop.loader ydb/loader-stress-del.nop.loader
hotindexer-with-queries.tdb ydb/hotindexer-with-queries.tdb
) )
set_tests_properties(${extra_long_tests} PROPERTIES TIMEOUT 7200) set_tests_properties(${extra_long_tests} PROPERTIES TIMEOUT 7200)
## these really take a long time with valgrind ## these really take a long time with valgrind
set(phenomenally_long_tests set(phenomenally_long_tests
checkpoint_stress.tdb ydb/checkpoint_stress.tdb
recover_stress.tdb ydb/recover_stress.tdb
) )
set_tests_properties(${phenomenally_long_tests} PROPERTIES TIMEOUT 14400) set_tests_properties(${phenomenally_long_tests} PROPERTIES TIMEOUT 14400)
endif(BUILD_TESTING) endif(BUILD_TESTING)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment