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)
## these tests shouldn't run with valgrind
list(APPEND CTEST_CUSTOM_MEMCHECK_IGNORE
ft_loader-test-extractor-1
ft_loader-test-extractor-2
ft_loader-test-extractor-3
brt-serialize-benchmark
bnc-insert-benchmark
test_groupcommit_perf.tdb
test_groupcommit_perf.bdb
diskfull.tdb
stress-gc.tdb
insert-dup-prelock.tdb
test_3645.tdb
test_large_update_broadcast_small_cachetable.tdb
test_update_broadcast_stress.tdb
test_update_stress.tdb
stress-test.tdb
stress-test.bdb
hot-optimize-table-tests.tdb
test4573-logtrim.tdb
test-xa-prepare.tdb
test-recover1.tdb
test-recover2.tdb
test-recover3.tdb
test-prepare.tdb
test-prepare2.tdb
test-prepare3.tdb
filesize.tdb
preload-db-nested.tdb
upgrade-test-4.tdb
recovery_fileops_unit.tdb
helgrind_helgrind1.tdb
helgrind2.tdb
helgrind3.tdb
drd_test_groupcommit_count.tdb
helgrind_test_groupcommit_count.tdb
loader-cleanup-test2.tdb
loader-cleanup-test3.tdb
loader-stress-test4.tdb
maxsize-for-loader-B.tdb
try-leak-lost
try-leak-reachable
try-leak-uninit
drd_test_4015.tdb
upgrade_test_simple
ft/bnc-insert-benchmark
ft/brt-serialize-benchmark
ft/ft_loader-test-extractor-1
ft/ft_loader-test-extractor-2
ft/ft_loader-test-extractor-3
ft/upgrade_test_simple
portability/try-leak-lost
portability/try-leak-reachable
portability/try-leak-uninit
ydb/diskfull.tdb
ydb/drd_test_4015.tdb
ydb/drd_test_groupcommit_count.tdb
ydb/filesize.tdb
ydb/helgrind2.tdb
ydb/helgrind3.tdb
ydb/helgrind_helgrind1.tdb
ydb/helgrind_test_groupcommit_count.tdb
ydb/hot-optimize-table-tests.tdb
ydb/insert-dup-prelock.tdb
ydb/loader-cleanup-test2.tdb
ydb/loader-cleanup-test3.tdb
ydb/loader-stress-test4.tdb
ydb/maxsize-for-loader-B.tdb
ydb/preload-db-nested.tdb
ydb/recovery_fileops_unit.tdb
ydb/stress-gc.tdb
ydb/stress-test.bdb
ydb/stress-test.tdb
ydb/test-prepare.tdb
ydb/test-prepare2.tdb
ydb/test-prepare3.tdb
ydb/test-recover1.tdb
ydb/test-recover2.tdb
ydb/test-recover3.tdb
ydb/test-xa-prepare.tdb
ydb/test4573-logtrim.tdb
ydb/test_3645.tdb
ydb/test_groupcommit_perf.bdb
ydb/test_groupcommit_perf.tdb
ydb/test_large_update_broadcast_small_cachetable.tdb
ydb/test_update_broadcast_stress.tdb
ydb/test_update_stress.tdb
ydb/upgrade-test-4.tdb
)
## tests that are supposed to crash will generate memcheck failures
set(tests_that_should_fail
try-assert0
try-assert-zero
test-assertA
test-assertB
test_truncate_txn_abort.tdb
test_db_no_env.tdb
recover-missing-dbfile.abortrecover
recover-missing-dbfile-2.abortrecover
ft/test-assertA
ft/test-assertB
portability/try-assert-zero
portability/try-assert0
ydb/recover-missing-dbfile-2.abortrecover
ydb/recover-missing-dbfile.abortrecover
ydb/test_db_no_env.tdb
ydb/test_truncate_txn_abort.tdb
)
list(APPEND CTEST_CUSTOM_MEMCHECK_IGNORE ${tests_that_should_fail})
......@@ -69,31 +69,40 @@ set(stress_tests
test_stress5.tdb
test_stress6.tdb
test_stress7.tdb
test_stress_hot_indexing.tdb
test_stress_with_verify.tdb
)
foreach(test ${stress_tests})
list(APPEND CTEST_CUSTOM_MEMCHECK_IGNORE
drd_tiny_${test}
drd_mid_${test}
drd_large_${test}
ydb/drd_tiny_${test}
ydb/drd_mid_${test}
ydb/drd_large_${test}
)
if(NOT test MATCHES "test_stress(1|3).tdb")
list(APPEND CTEST_CUSTOM_TESTS_IGNORE
drd_large_${test}
ydb/drd_large_${test}
)
endif()
if(NOT @RUN_LONG_TESTS@)
list(APPEND CTEST_CUSTOM_TESTS_IGNORE
drd_mid_${test}
drd_large_${test}
ydb/drd_mid_${test}
ydb/drd_large_${test}
)
endif()
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
recover-test_stress1.abortrecover
recover-test_stress2.abortrecover
recover-test_stress3.abortrecover
ydb/recover-test_stress1.abortrecover
ydb/recover-test_stress2.abortrecover
ydb/recover-test_stress3.abortrecover
)
## we run stress tests separately, only run them if asked to
......@@ -103,13 +112,13 @@ if(NOT @RUN_STRESS_TESTS@)
endif()
set(perf_tests
perf_checkpoint_var.tdb
perf_cursor_nop.tdb
perf_malloc_free.tdb
perf_nop.tdb
perf_ptquery.tdb
perf_ptquery2.tdb
perf_xmalloc_free.tdb
ydb/perf_checkpoint_var.tdb
ydb/perf_cursor_nop.tdb
ydb/perf_malloc_free.tdb
ydb/perf_nop.tdb
ydb/perf_ptquery.tdb
ydb/perf_ptquery2.tdb
ydb/perf_xmalloc_free.tdb
)
## we also don't need to run perf tests every time
......@@ -121,38 +130,40 @@ endif()
## don't run perf tests with valgrind (that's slow)
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}")
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})
## these tests fail often and aren't helpful
set(known_failing_tests
diskfull.tdb
ydb/diskfull.tdb
)
list(APPEND CTEST_CUSTOM_MEMCHECK_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
set(long_running_tests
recover_stress.tdb
checkpoint_stress.tdb
root_fifo_1.tdb
root_fifo_2.tdb
root_fifo_31.tdb
root_fifo_32.tdb
is_empty
test_txn_nested2.tdb
test_logmax.tdb
checkpoint_1.tdb
manyfiles.tdb
loader-stress-test4.tdb
preload-db-nested.tdb
test_update_stress.tdb
test_update_broadcast_stress.tdb
stress-test.tdb
stress-gc.tdb
hot-optimize-table-tests.tdb
hotindexer-with-queries.tdb
upgrade_test_simple
test3529.tdb
ft/is_empty
ft/upgrade_test_simple
ydb/checkpoint_1.tdb
ydb/checkpoint_stress.tdb
ydb/hot-optimize-table-tests.tdb
ydb/hotindexer-with-queries.tdb
ydb/loader-stress-test4.tdb
ydb/manyfiles.tdb
ydb/preload-db-nested.tdb
ydb/recover_stress.tdb
ydb/root_fifo_1.tdb
ydb/root_fifo_2.tdb
ydb/root_fifo_31.tdb
ydb/root_fifo_32.tdb
ydb/stress-gc.tdb
ydb/stress-test.tdb
ydb/test3529.tdb
ydb/test_logmax.tdb
ydb/test_txn_nested2.tdb
ydb/test_update_broadcast_stress.tdb
ydb/test_update_stress.tdb
)
if(NOT @RUN_LONG_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")
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(CMAKE_C_FLAGS_RELEASE "-g -O3")
## check how to do inter-procedural optimization
check_c_compiler_flag(-flto HAVE_CC_FLAG_FLTO)
check_c_compiler_flag(-ipo HAVE_CC_FLAG_IPO)
## add inter-procedural optimization flags
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")
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_c_compiler_flag(-flto HAVE_CC_FLAG_FLTO)
check_c_compiler_flag(-ipo HAVE_CC_FLAG_IPO)
## add inter-procedural optimization flags
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 ()
if (CMAKE_C_COMPILER_ID MATCHES Intel)
......
......@@ -9,9 +9,10 @@ if (CMAKE_SYSTEM_NAME MATCHES Darwin)
list(APPEND xz_configure_opts --disable-assembler)
endif ()
list(APPEND xz_configure_opts CC=${CMAKE_C_COMPILER})
if (CMAKE_BUILD_TYPE MATCHES Release)
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 ()
else ()
list(APPEND xz_configure_opts --enable-debug)
......
......@@ -20,8 +20,8 @@ if(BUILD_TESTING)
endmacro(declare_custom_tests)
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(logcursor-bw echo "logcursor-bw 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(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)
......@@ -41,91 +41,91 @@ if(BUILD_TESTING)
## declare some tests that should be run with specific options
declare_custom_tests(test-assert.c)
add_test(test-assertA test-assert)
add_test(test-assertB test-assert notok)
set_tests_properties(test-assertA test-assertB PROPERTIES WILL_FAIL TRUE)
add_test(test-assertC test-assert ok)
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.c)
add_test(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 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.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)
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)
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)
add_test(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(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(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(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-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.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(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-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.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)
add_test(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(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(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(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-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.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(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(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-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.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)
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})
if(NOT "${src}" MATCHES "dir[.].*[.]c")
## add a default test rule that runs with no options
get_filename_component(base ${src} NAME_WE)
add_test(${base} ${base})
add_test(ft/${base} ${base})
endif()
endforeach(src)
## give some tests, that time out normally, 1 hour to complete
set(long_tests
log-test7
subblock-test-compression
is_empty
recovery-bad-last-entry
ftloader-test-extractor-3a
upgrade_test_simple
ft/log-test7
ft/subblock-test-compression
ft/is_empty
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
subblock-test-checksum
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
benchmark-test
benchmark-test_256
ft/benchmark-test
ft/benchmark-test_256
)
set_tests_properties(${phenomenally_long_tests} PROPERTIES TIMEOUT 14400)
endif(BUILD_TESTING)
......@@ -30,23 +30,23 @@ if(BUILD_TESTING)
endforeach(src)
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)
foreach(test try-leak-lost try-leak-reachable try-uninit)
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)
endforeach(test)
foreach(test ${tests})
add_test(${test} ${test})
add_test(portability/${test} ${test})
endforeach(test)
set(portability_tests_should_fail
try-assert0
try-assert-zero
portability/try-assert0
portability/try-assert-zero
)
set_tests_properties(${portability_tests_should_fail} PROPERTIES WILL_FAIL TRUE)
......
......@@ -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)
## make the linear library
add_library(lock_tree_lin_static STATIC ${lock_tree_srcs})
add_dependencies(lock_tree_lin_static install_tdb_h)
## make the linear library for tests
add_library(lock_tree_lin SHARED ${lock_tree_srcs})
target_link_libraries(lock_tree_lin range_tree_lin)
add_dependencies(lock_tree_lin install_tdb_h)
## make the log library
add_library(lock_tree_tlog_static STATIC ${lock_tree_srcs})
set_property(TARGET lock_tree_tlog_static APPEND PROPERTY
## make the log library for tests
add_library(lock_tree_tlog SHARED ${lock_tree_srcs})
set_property(TARGET lock_tree_tlog APPEND PROPERTY
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
## to be PIC
......@@ -20,6 +22,6 @@ set_property(TARGET lock_tree_static APPEND PROPERTY
COMPILE_DEFINITIONS TOKU_RT_NOOVERLAPS)
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)
......@@ -6,19 +6,15 @@ if(BUILD_TESTING)
foreach(impl lin tlog)
## each source file test_foo.c creates binaries lt_test_foo.lin and
## lt_test_foo.tlog
## need lt_ prefix so that we have unique target names for cmake
add_executable(lt_${base}.${impl} ${src})
set_property(TARGET lt_${base}.${impl} APPEND PROPERTY
COMPILE_DEFINITIONS "TESTDIR=\"dir.${base}.c.${impl}\"")
add_space_separated_property(TARGET lt_${base}.${impl} COMPILE_FLAGS -fvisibility=hidden)
target_link_libraries(lt_${base}.${impl}
lock_tree_${impl}_static
range_tree_${impl}_static
ft
${LIBTOKUPORTABILITY}
)
add_common_options_to_binary_targets(lt_${base}.${impl})
target_link_libraries(lt_${base}.${impl} lock_tree_${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)
set_property(TARGET lt_${base}.tlog APPEND PROPERTY
......@@ -27,17 +23,16 @@ if(BUILD_TESTING)
## run test_footprint_point_write.c and test_footprint_range_write.c in
## a bunch of different ways.
## TODO: add lt_ prefix to test names
foreach(impl lin tlog)
foreach(type point range)
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})
endforeach(i)
foreach(i 10 100 1000)
math(EXPR nlocks "${i} * 100")
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})
endforeach(i)
endforeach(type)
......
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
## make the linear library
add_library(range_tree_lin_static STATIC linear.c)
add_dependencies(range_tree_lin_static install_tdb_h)
## make the linear library for tests
add_library(range_tree_lin SHARED linear.c)
target_link_libraries(range_tree_lin ft ${LIBTOKUPORTABILITY})
add_dependencies(range_tree_lin install_tdb_h)
## make the log library
add_library(range_tree_tlog_static STATIC log_nooverlap.c)
add_dependencies(range_tree_tlog_static install_tdb_h)
## make the log library for tests
add_library(range_tree_tlog SHARED log_nooverlap.c)
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
## to be PIC
......@@ -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_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)
......@@ -6,18 +6,15 @@ if(BUILD_TESTING)
foreach(impl lin tlog)
## each source file test_foo.c creates binaries rt_test_foo.lin and
## rt_test_foo.tlog
## need rt_ prefix so that we have unique target names for cmake
add_executable(rt_${base}.${impl} ${src})
set_property(TARGET rt_${base}.${impl} APPEND PROPERTY
COMPILE_DEFINITIONS "TESTDIR=\"dir.${base}.c.${impl}\"")
add_space_separated_property(TARGET rt_${base}.${impl} COMPILE_FLAGS -fvisibility=hidden)
target_link_libraries(rt_${base}.${impl}
range_tree_${impl}_static
ft
${LIBTOKUPORTABILITY}
)
add_common_options_to_binary_targets(rt_${base}.${impl})
target_link_libraries(rt_${base}.${impl} range_tree_${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)
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