Commit 38e4748e authored by Leif Walsh's avatar Leif Walsh Committed by Yoni Fogel

refs #6566 set TOKUDB_DATA in cmake, rather than relying on svn layout

git-svn-id: file:///svn/toku/tokudb@55578 c7de825b-a66e-492c-adef-691d508d4ae1
parent 1a573e61
......@@ -81,6 +81,13 @@ set(BUILDNAME "${branchname} ${buildname_build_type} ${CMAKE_SYSTEM} ${machine_t
include(CTest)
set(TOKUDB_DATA "${TokuDB_SOURCE_DIR}/../tokudb.data" CACHE FILEPATH "Path to data files for tests")
set(WARNED_ABOUT_DATA 0)
if (NOT EXISTS "${TOKUDB_DATA}/" AND NOT WARNED_ABOUT_DATA)
message(WARNING "Test data files are missing from ${TOKUDB_DATA}, which will cause some tests to fail. Please put them there or modify TOKUDB_DATA to avoid this.")
set(WARNED_ABOUT_DATA 1)
endif ()
if (BUILD_TESTING OR BUILD_FT_TESTS OR BUILD_SRC_TESTS)
## set up full valgrind suppressions file (concatenate the suppressions files)
file(READ ft/valgrind.suppressions valgrind_suppressions)
......
......@@ -99,7 +99,7 @@ if(BUILD_TESTING OR BUILD_FT_TESTS)
add_ft_test(${test})
endforeach(test)
set_property(TEST ft/upgrade_test_simple APPEND PROPERTY ENVIRONMENT "TOKU_SVNROOT=${TOKU_SVNROOT}")
set_property(TEST ft/upgrade_test_simple APPEND PROPERTY ENVIRONMENT "TOKUDB_DATA=${TOKUDB_DATA}")
## give some tests, that time out normally, 1 hour to complete
set(long_tests
......
......@@ -219,9 +219,8 @@ run_test(const char *prog, const char *origft) {
toku_free(fullprog);
{
char origbuf[TOKU_PATH_MAX + 1];
char *svnroot = getenv("TOKU_SVNROOT");
invariant_notnull(svnroot);
toku_path_join(origbuf, 3, svnroot, "tokudb.data", origft);
char *datadir = getenv("TOKUDB_DATA");
toku_path_join(origbuf, 2, datadir, origft);
size_t len = 13 + strlen(origbuf) + strlen(tempft);
char buf[len + 1];
snprintf(buf, len + 1, "gunzip -c %s > %s", origbuf, tempft);
......
......@@ -566,9 +566,10 @@ if(BUILD_TESTING OR BUILD_SRC_TESTS)
set(test ${base}.tdb)
foreach(oldver 4.2.0 5.0.8 5.2.7 6.0.0 6.1.0 6.5.1 6.6.3)
set(versiondir ${TOKU_SVNROOT}/tokudb.data/old-stress-test-envs/${oldver})
if (NOT EXISTS "${versiondir}/")
set(versiondir ${TOKUDB_DATA}/old-stress-test-envs/${oldver})
if (NOT EXISTS "${versiondir}/" AND NOT WARNED_ABOUT_DATA)
message(WARNING "Test data for upgrade tests for version ${oldver} doesn't exist, check out ${versiondir}/*-2000-dir first or upgrade stress tests may fail.")
set(WARNED_ABOUT_DATA 1)
endif ()
foreach(p_or_s pristine stressed)
if (NOT (${base} MATCHES test_stress4 AND ${p_or_s} MATCHES stressed))
......@@ -600,17 +601,18 @@ if(BUILD_TESTING OR BUILD_SRC_TESTS)
endif ()
endforeach(src)
if (NOT EXISTS "${TOKU_SVNROOT}/tokudb.data/test_5902/")
message(WARNING "Test data for dump-env.tdb doesn't exist, check out ${TOKU_SVNROOT}/tokudb.data/test_5902 first or dump-env.tdb may fail.")
if (NOT EXISTS "${TOKUDB_DATA}/test_5902/" AND NOT WARNED_ABOUT_DATA)
message(WARNING "Test data for dump-env.tdb doesn't exist, check out ${TOKUDB_DATA}/test_5902 first or dump-env.tdb may fail.")
set(WARNED_ABOUT_DATA 1)
endif ()
declare_custom_tests(dump-env.tdb)
add_test(NAME ydb/dump-env.tdb/remove
COMMAND ${CMAKE_COMMAND} -E remove_directory "dump-env.tdb.ctest-data")
add_test(NAME ydb/dump-env.tdb/copy
COMMAND ${CMAKE_COMMAND} -E copy_directory "${TOKU_SVNROOT}/tokudb.data/test_5902" "dump-env.tdb.ctest-data")
COMMAND ${CMAKE_COMMAND} -E copy_directory "${TOKUDB_DATA}/test_5902" "dump-env.tdb.ctest-data")
set_tests_properties(ydb/dump-env.tdb/copy PROPERTIES
DEPENDS ydb/dump-env.tdb/remove
REQUIRED_FILES "${TOKU_SVNROOT}/tokudb.data/test_5902")
REQUIRED_FILES "${TOKUDB_DATA}/test_5902")
add_ydb_test(dump-env.tdb)
set_tests_properties(ydb/dump-env.tdb PROPERTIES
DEPENDS ydb/dump-env.tdb/copy
......@@ -639,9 +641,10 @@ if(BUILD_TESTING OR BUILD_SRC_TESTS)
add_ydb_test_aux(test_abort4_${num}_1.tdb test_abort4.tdb -c 1 -l ${num})
endforeach(num)
set(old_loader_upgrade_data "${TOKU_SVNROOT}/tokudb.data/env_preload.4.2.0.emptydictionaries.cleanshutdown")
if (NOT EXISTS "${old_loader_upgrade_data}/")
set(old_loader_upgrade_data "${TOKUDB_DATA}/env_preload.4.2.0.emptydictionaries.cleanshutdown")
if (NOT EXISTS "${old_loader_upgrade_data}/" AND NOT WARNED_ABOUT_DATA)
message(WARNING "Test data for loader upgrade tests doesn't exist, check out ${old_loader_upgrade_data} first, or loader-stress-test3.tdb may fail.")
set(WARNED_ABOUT_DATA 1)
endif ()
function(add_loader_upgrade_test name bin)
add_test(NAME ydb/${name}/remove
......
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