Commit d6d59ec4 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 0ec18d4e
...@@ -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")
## check how to do inter-procedural optimization else ()
check_c_compiler_flag(-flto HAVE_CC_FLAG_FLTO) set(CMAKE_C_FLAGS_RELEASE "-g -O3")
check_c_compiler_flag(-ipo HAVE_CC_FLAG_IPO)
## check how to do inter-procedural optimization
## add inter-procedural optimization flags check_c_compiler_flag(-flto HAVE_CC_FLAG_FLTO)
if (HAVE_CC_FLAG_FLTO) check_c_compiler_flag(-ipo HAVE_CC_FLAG_IPO)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -flto")
elseif (HAVE_CC_FLAG_IPO) ## add inter-procedural optimization flags
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -ip -ipo1") if (HAVE_CC_FLAG_FLTO)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -flto")
elseif (HAVE_CC_FLAG_IPO)
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
......
This diff is collapsed.
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