CMakeLists.txt 28.4 KB
Newer Older
1
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS _GNU_SOURCE DONT_DEPRECATE_ERRNO)
Leif Walsh's avatar
Leif Walsh committed
2

3
if(BUILD_TESTING OR BUILD_SRC_TESTS)
4
  file(GLOB transparent_upgrade_srcs RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" upgrade*.cc)
5

6
  file(GLOB tdb_dontrun_srcs RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" bdb-simple-deadlock*.cc)
7
  string(REGEX REPLACE "\\.cc(;|$)" "\\1" tdb_dontrun_tests "${tdb_dontrun_srcs}")
8

9
  file(GLOB srcs RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" *.cc)
10 11
  list(REMOVE_ITEM srcs ${transparent_upgrade_srcs})

12 13 14 15
  set(recover_srcs test_log2.cc test_log3.cc test_log4.cc test_log5.cc test_log6.cc test_log7.cc test_log8.cc test_log9.cc test_log10.cc)
  file(GLOB abortrecover_srcs RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" recover-*.cc)
  file(GLOB loader_srcs RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" loader-*.cc)
  file(GLOB stress_test_srcs RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" test_stress*.cc)
16 17 18 19
  string(REGEX REPLACE "\\.cc(;|$)" ".recover\\1" recover_tests "${recover_srcs}")
  string(REGEX REPLACE "\\.cc(;|$)" ".abortrecover\\1" abortrecover_tests "${abortrecover_srcs}")
  string(REGEX REPLACE "\\.cc(;|$)" ".loader\\1" loader_tests "${loader_srcs}")
  string(REGEX REPLACE "\\.cc(;|$)" ".tdb\\1" stress_tests "${stress_test_srcs}")
20 21 22

  set(tdb_srcs ${srcs})
  list(REMOVE_ITEM tdb_srcs ${tdb_dontrun_srcs})
23
  string(REGEX REPLACE "\\.cc(;|$)" ".tdb\\1" tdb_bins "${tdb_srcs}")
24
  list(REMOVE_ITEM tdb_srcs ${abortrecover_srcs} ${loader_srcs})
25
  string(REGEX REPLACE "\\.cc(;|$)" ".tdb\\1" tdb_tests "${tdb_srcs}")
26 27 28

  if(BDB_FOUND)
    set(bdb_dontrun_srcs
29
      backwards_10_each_le_and_msg
30
      blackhole
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
      blocking-prelock-range
      blocking-set-range-reverse-0
      blocking-table-lock
      bug1381
      bug627
      cachetable-race
      checkpoint_1
      checkpoint_callback
      checkpoint_stress
      cursor-isolation
      cursor-set-del-rmw
      cursor-set-range-rmw
      db-put-simple-deadlock
      del-simple
      del-multiple
      del-multiple-huge-primary-row
      del-multiple-srcdb
      directory_lock
      diskfull
      env-put-multiple
      env_startup
      execute-updates
      filesize
      helgrind1
      helgrind2
      helgrind3
      hotindexer-bw
      hotindexer-error-callback
      hotindexer-insert-committed-optimized
      hotindexer-insert-committed
      hotindexer-insert-provisional
      hotindexer-lock-test
      hotindexer-multiclient
      hotindexer-nested-insert-committed
      hotindexer-put-abort
      hotindexer-put-commit
      hotindexer-put-multiple
      hotindexer-simple-abort
      hotindexer-simple-abort-put
      hotindexer-undo-do-test
      hotindexer-with-queries
      hot-optimize-table-tests
      insert-dup-prelock
      isolation
      isolation-read-committed
      keyrange
      keyrange-merge
      last-verify-time
      loader-cleanup-test
      loader-create-abort
      loader-create-close
      loader-dup-test
      loader-no-puts
      loader-reference-test
      loader-stress-del
      loader-stress-test
      loader-tpch-load
      lock-pressure
      manyfiles
      maxsize-for-loader
      multiprocess
      mvcc-create-table
      mvcc-many-committed
      perf_checkpoint_var
95
      perf_child_txn
96
      perf_cursor_nop
97
      perf_iibench
98 99 100 101 102 103
      perf_insert
      perf_insert_multiple
      perf_malloc_free
      perf_nop
      perf_ptquery
      perf_ptquery2
104
      perf_read_write
105
      perf_txn_single_thread
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196
      perf_xmalloc_free
      prelock-read-read
      prelock-read-write
      prelock-write-read
      prelock-write-write
      print_engine_status
      powerfail
      preload-db
      preload-db-nested
      progress
      put-multiple
      queries_with_deletes
      recover-2483
      recover-3113
      recover-5146
      recover-compare-db
      recover-compare-db-descriptor
      recover-del-multiple
      recover-del-multiple-abort
      recover-del-multiple-srcdb-fdelete-all
      recover-delboth-after-checkpoint
      recover-delboth-checkpoint
      recover-descriptor
      recover-descriptor2
      recover-descriptor3
      recover-descriptor4
      recover-descriptor5
      recover-descriptor6
      recover-descriptor7
      recover-descriptor8
      recover-descriptor9
      recover-descriptor10
      recover-descriptor11
      recover-descriptor12
      recover-fclose-in-checkpoint
      recover-fcreate-basementnodesize
      recover-flt1
      recover-flt2
      recover-flt3
      recover-flt4
      recover-flt5
      recover-flt6
      recover-flt7
      recover-flt8
      recover-flt9
      recover-flt10
      recover-hotindexer-simple-abort-put
      recover-loader-test
      recover-lsn-filter-multiple
      recover-put-multiple
      recover-put-multiple-abort
      recover-put-multiple-fdelete-all
      recover-put-multiple-fdelete-some
      recover-put-multiple-srcdb-fdelete-all
      recover-split-checkpoint
      recover-tablelock
      recover-test-logsuppress
      recover-test-logsuppress-put
      recover-test_stress1
      recover-test_stress2
      recover-test_stress3
      recover-test_stress_openclose
      recover-upgrade-db-descriptor-multihandle
      recover-upgrade-db-descriptor
      recover-update-multiple
      recover-update-multiple-abort
      recover-update_aborts
      recover-update_aborts_before_checkpoint
      recover-update_aborts_before_close
      recover-update_changes_values
      recover-update_changes_values_before_checkpoint
      recover-update_changes_values_before_close
      recover-update_broadcast_aborts
      recover-update_broadcast_aborts2
      recover-update_broadcast_aborts3
      recover-update_broadcast_aborts_before_checkpoint
      recover-update_broadcast_aborts_before_close
      recover-update_broadcast_changes_values
      recover-update_broadcast_changes_values2
      recover-update_broadcast_changes_values3
      recover-update_broadcast_changes_values_before_checkpoint
      recover-update_broadcast_changes_values_before_close
      recover-update_changes_values_before_close
      recovery_fileops_stress
      recovery_fileops_unit
      recovery_stress
      redirect
      replace-into-write-lock
      root_fifo_2
      root_fifo_32
      root_fifo_41
197
      seqinsert
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220
      shutdown-3344
      stat64
      stat64-create-modify-times
      stat64_flatten
      stat64-null-txn
      stat64-root-changes
      stress-gc
      stress-gc2
      test-xa-prepare
      test1324
      test1572
      test3219
      test3522
      test3522b
      test3529
      test_3645
      test_3529_insert_2
      test_3529_table_lock
      test_3755
      test_4015
      test_4368
      test_4657
      test_5015
Zardosht Kasheff's avatar
Zardosht Kasheff committed
221
      test_5469
222 223 224 225 226 227 228 229 230
      test-5138
      test938c
      test_abort1
      test_abort4
      test_abort5
      test_blobs_leaf_split
      test_bulk_fetch
      test_compression_methods
      test_cmp_descriptor
Zardosht Kasheff's avatar
Zardosht Kasheff committed
231
      test_db_change_pagesize
232 233 234 235 236 237 238 239 240 241 242 243 244
      test_db_change_xxx
      test_cursor_delete_2119
      test_db_descriptor
      test_db_descriptor_named_db
      test_db_txn_locks_read_uncommitted
      test_get_max_row_size
      test_large_update_broadcast_small_cachetable
      test_locktree_close
      test_logflush
      test_multiple_checkpoints_block_commit
      test_query
      test_redirect_func
      test_row_size_supported
245
      test_stress0
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292
      test_stress1
      test_stress2
      test_stress3
      test_stress4
      test_stress5
      test_stress6
      test_stress7
      test_stress_openclose
      test_stress_with_verify
      test_stress_hot_indexing
      test_transactional_descriptor
      test_trans_desc_during_chkpt
      test_trans_desc_during_chkpt2
      test_trans_desc_during_chkpt3
      test_trans_desc_during_chkpt4
      test_txn_abort6
      test_txn_abort8
      test_txn_abort9
      test_txn_close_open_commit
      test_txn_commit8
      test_txn_nested1
      test_txn_nested2
      test_txn_nested3
      test_txn_nested4
      test_txn_nested5
      test_update_abort_works
      test_update_calls_back
      test_update_can_delete_elements
      test_update_changes_values
      test_update_nonexistent_keys
      test_update_previously_deleted
      test_update_stress
      test_update_txn_snapshot_works_concurrently
      test_update_txn_snapshot_works_correctly_with_deletes
      test_update_broadcast_abort_works
      test_update_broadcast_calls_back
      test_update_broadcast_can_delete_elements
      test_update_broadcast_changes_values
      test_update_broadcast_previously_deleted
      test_update_broadcast_stress
      test_update_broadcast_update_fun_has_choices
      test_update_broadcast_with_empty_table
      test_update_broadcast_indexer
      test_update_broadcast_loader
      test_update_broadcast_nested_updates
      test_update_nested_updates
      test_update_with_empty_table
Zardosht Kasheff's avatar
Zardosht Kasheff committed
293
      test_updates_single_key
294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309
      txn-ignore
      transactional_fileops
      update-multiple-data-diagonal
      update-multiple-key0
      update-multiple-nochange
      update-multiple-with-indexer
      update
      upgrade_simple
      upgrade-test-1
      upgrade-test-2
      upgrade-test-3
      upgrade-test-4
      upgrade-test-5
      upgrade-test-6
      upgrade-test-7
      zombie_db
310 311
      )
    set(bdb_srcs ${srcs})
312 313
    string(REGEX REPLACE "\\.cc(;|$)" "\\1" bdb_testbases "${bdb_srcs}")
    list(REMOVE_ITEM bdb_testbases ${bdb_dontrun_srcs})
314
    string(REGEX REPLACE "(.)(;|$)" "\\1.bdb\\2" bdb_tests "${bdb_testbases}")
315 316 317 318 319 320 321 322 323 324 325 326 327
    set(bdb_bins ${bdb_tests})
  endif()

  set(tdb_tests_that_should_fail
    test_db_no_env.tdb
    test_log8.recover
    test_log9.recover
    test_log10.recover
    recover-missing-dbfile.abortrecover
    recover-missing-dbfile-2.abortrecover
    loader-tpch-load.loader
    )

Leif Walsh's avatar
Leif Walsh committed
328 329
  ## #5138 only reproduces when using the static library.
  list(REMOVE_ITEM tdb_bins test-5138.tdb)
330
  add_executable(test-5138.tdb test-5138)
Leif Walsh's avatar
Leif Walsh committed
331 332
  target_link_libraries(test-5138.tdb ${LIBTOKUDB}_static ${LIBTOKUPORTABILITY}_static)
  set_property(TARGET test-5138.tdb APPEND PROPERTY
333
    COMPILE_DEFINITIONS "ENVDIR=\"dir.test-5138.tdb\";USE_TDB;IS_TDB=1;TOKUDB=1")
Leif Walsh's avatar
Leif Walsh committed
334 335 336 337
  set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "dir.test-5138.tdb")
  add_common_options_to_binary_targets(test-5138.tdb)
  add_test(ydb/test-5138.tdb test-5138.tdb)

338 339 340
  foreach(bin ${tdb_bins})
    get_filename_component(base ${bin} NAME_WE)

341
    add_executable(${base}.tdb ${base})
342 343 344 345 346
    # Some of the symbols in util may not be exported properly by
    # libtokudb.so.
    # We link the test with util directly so that the test code itself can use
    # some of those things (i.e. kibbutz in the threaded tests).
    target_link_libraries(${base}.tdb util ${LIBTOKUDB} ${LIBTOKUPORTABILITY})
347
    set_property(TARGET ${base}.tdb APPEND PROPERTY
348
      COMPILE_DEFINITIONS "ENVDIR=\"dir.${bin}\";USE_TDB;IS_TDB=1;TOKUDB=1")
349
    set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "dir.${bin}")
350
    add_common_options_to_binary_targets(${base}.tdb)
351 352 353 354 355 356
  endforeach(bin)

  if(BDB_FOUND)
    foreach(bin ${bdb_bins})
      get_filename_component(base ${bin} NAME_WE)

357
      add_executable(${base}.bdb ${base})
358
      set_property(TARGET ${base}.bdb APPEND PROPERTY
359
        COMPILE_DEFINITIONS "ENVDIR=\"dir.${bin}\";USE_BDB;IS_TDB=0;TOKU_ALLOW_DEPRECATED")
360 361 362
      set_target_properties(${base}.bdb PROPERTIES
        INCLUDE_DIRECTORIES "${BDB_INCLUDE_DIR};${CMAKE_CURRENT_BINARY_DIR}/../../toku_include;${CMAKE_CURRENT_SOURCE_DIR}/../../toku_include;${CMAKE_CURRENT_SOURCE_DIR}/../../portability;${CMAKE_CURRENT_SOURCE_DIR}/../..")
      target_link_libraries(${base}.bdb ${LIBTOKUPORTABILITY} ${BDB_LIBRARIES})
363
      set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "dir.${bin}")
364
      add_common_options_to_binary_targets(${base}.bdb)
365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380
    endforeach(bin)
  endif()

  foreach(bin loader-cleanup-test.tdb diskfull.tdb)
    set_property(TARGET ${bin} APPEND PROPERTY
      COMPILE_DEFINITIONS DONT_DEPRECATE_WRITES)
  endforeach(bin)

  macro(declare_custom_tests)
    foreach(test ${ARGN})
      list(REMOVE_ITEM tdb_tests ${test})
    endforeach(test)
  endmacro(declare_custom_tests)

  function(add_custom_executable prefix binary source)
    add_executable(${prefix}_${binary} ${source})
381
    target_link_libraries(${prefix}_${binary} util ${LIBTOKUDB} ${LIBTOKUPORTABILITY})
382
    set_target_properties(${prefix}_${binary} PROPERTIES
383
      COMPILE_DEFINITIONS "ENVDIR=\"dir.${prefix}_${source}.tdb\";USE_TDB;IS_TDB=1;TOKUDB=1")
384
    set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "dir.${prefix}_${source}.tdb")
385
    add_common_options_to_binary_targets(${prefix}_${binary})
386 387 388 389 390 391 392 393 394 395 396 397
  endfunction(add_custom_executable)

  declare_custom_tests(test1426.tdb)
  if(BDB_FOUND)
    macro(declare_custom_bdb_tests)
      foreach(test ${ARGN})
        list(REMOVE_ITEM bdb_tests ${test})
      endforeach(test)
    endmacro(declare_custom_bdb_tests)

    declare_custom_bdb_tests(test1426.bdb)
    configure_file(run_test1426.sh . COPYONLY)
398
    add_test(NAME ydb/test1426.tdb
399 400
      COMMAND run_test1426.sh
          $<TARGET_FILE:test1426.tdb> $<TARGET_FILE:test1426.bdb>
401
          $<TARGET_FILE:tokudb_dump> "${BDB_INCLUDE_DIR}/../bin/db_dump")
Leif Walsh's avatar
Leif Walsh committed
402
    add_dependencies(test1426.tdb tokudb_dump)
403 404
  endif()

405
  string(REGEX REPLACE "\\.cc(;|$)" ".tdb\\1" recover_would_be_tdb_tests "${recover_srcs}")
406 407 408
  declare_custom_tests(${recover_would_be_tdb_tests})

  declare_custom_tests(powerfail.tdb)
409
  add_test(ydb/powerfail.tdb echo must run powerfail by hand)
410 411 412

  declare_custom_tests(checkpoint_stress.tdb)
  configure_file(run_checkpoint_stress_test.sh . COPYONLY)
413
  add_test(NAME ydb/checkpoint_stress.tdb
414 415 416
    COMMAND run_checkpoint_stress_test.sh $<TARGET_FILE:checkpoint_stress.tdb> 5 5001 137)

  declare_custom_tests(recover_stress.tdb)
417
  add_custom_executable(recover stress.tdb checkpoint_stress)
418
  configure_file(run_recover_stress_test.sh . COPYONLY)
419
  add_test(NAME ydb/recover_stress.tdb
420 421 422 423
    COMMAND run_recover_stress_test.sh $<TARGET_FILE:recover_stress.tdb> 5 5001 137)

  declare_custom_tests(diskfull.tdb)
  configure_file(run_diskfull_test.sh . COPYONLY)
424
  add_test(NAME ydb/diskfull.tdb
425 426 427 428
    COMMAND run_diskfull_test.sh $<TARGET_FILE:diskfull.tdb> 134)

  declare_custom_tests(recovery_fileops_unit.tdb)
  configure_file(run_recovery_fileops_unit_test.sh . COPYONLY)
429
  add_test(NAME ydb/recovery_fileops_unit.tdb
430
    COMMAND run_recovery_fileops_unit_test.sh $<TARGET_FILE:recovery_fileops_unit.tdb> 137)
431
  set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "dir.recovery_fileops_unit.cc.errors")
432

433
  if (NOT (CMAKE_SYSTEM_NAME MATCHES Darwin OR
434
           (CMAKE_CXX_COMPILER_ID STREQUAL Intel AND
435 436
            CMAKE_BUILD_TYPE STREQUAL Release)
           OR USE_GCOV))
437
    declare_custom_tests(helgrind1.tdb)
438
    add_test(NAME ydb/helgrind_helgrind1.tdb
439
      COMMAND valgrind --quiet --tool=helgrind --error-exitcode=1 --log-file=helgrind1.tdb.deleteme $<TARGET_FILE:helgrind1.tdb>)
440
    set_tests_properties(ydb/helgrind_helgrind1.tdb PROPERTIES WILL_FAIL TRUE)
441 442 443
  endif()
  declare_custom_tests(helgrind2.tdb)
  declare_custom_tests(helgrind3.tdb)
444 445
  add_helgrind_test(ydb/helgrind_helgrind2.tdb $<TARGET_FILE:helgrind2.tdb>)
  add_helgrind_test(ydb/helgrind_helgrind3.tdb $<TARGET_FILE:helgrind3.tdb>)
446 447

  declare_custom_tests(test_groupcommit_count.tdb)
448
  add_test(ydb/test_groupcommit_count.tdb test_groupcommit_count.tdb -n 1 -p vgrind)
449

450
  add_custom_executable(helgrind test_groupcommit_count.tdb test_groupcommit_count)
451
  add_helgrind_test(ydb/helgrind_test_groupcommit_count.tdb $<TARGET_FILE:helgrind_test_groupcommit_count.tdb> -n 1 -p hgrind)
452

453
  add_custom_executable(drd test_groupcommit_count.tdb test_groupcommit_count)
454
  add_drd_test(ydb/drd_test_groupcommit_count.tdb $<TARGET_FILE:drd_test_groupcommit_count.tdb> -n 1 -p drd)
455

456
  add_custom_executable(drd test_4015.tdb test_4015)
457
  add_drd_test(ydb/drd_test_4015.tdb $<TARGET_FILE:drd_test_4015.tdb>)
458

459
  # Set up drd tests. Exclude hot_index.
460 461
  configure_file(run_stress_test.sh . COPYONLY)
  foreach(src ${stress_test_srcs})
462
    if(NOT ${src} MATCHES hot_index)
463 464
      get_filename_component(base ${src} NAME_WE)
      set(test ${base}.tdb)
465

466 467 468
      if (NOT ${src} MATCHES test_stress0)
        add_test(ydb/${test} ${CMAKE_CFG_INTDIR}/run_stress_test.sh $<TARGET_FILE:${test}> 150000 1000 600)
      endif ()
469

Leif Walsh's avatar
Leif Walsh committed
470
      add_custom_executable(tiny ${test} ${base})
471 472
      add_drd_test(ydb/drd_tiny_${test} $<TARGET_FILE:tiny_${test}> --num_seconds 5 --num_elements 150 --join_timeout 2500)
      set_tests_properties(ydb/drd_tiny_${test} PROPERTIES TIMEOUT 3000)
Leif Walsh's avatar
Leif Walsh committed
473
      add_custom_executable(mid ${test} ${base})
474
      add_drd_test(ydb/drd_mid_${test} ${CMAKE_CFG_INTDIR}/run_stress_test.sh $<TARGET_FILE:mid_${test}> 10000 100 10800)
475
      set_tests_properties(ydb/drd_mid_${test} PROPERTIES TIMEOUT 21600)
Leif Walsh's avatar
Leif Walsh committed
476
      add_custom_executable(large ${test} ${base})
477 478
      add_drd_test(ydb/drd_large_${test} ${CMAKE_CFG_INTDIR}/run_stress_test.sh $<TARGET_FILE:large_${test}> 150000 1000 18000)
      set_tests_properties(ydb/drd_large_${test} PROPERTIES TIMEOUT 21600)
479
    endif()
480 481
  endforeach(src)

482
  # Run test_stress0 with a special size
483
  add_test(ydb/test_stress0.tdb ${CMAKE_CFG_INTDIR}/run_stress_test.sh $<TARGET_FILE:test_stress0.tdb> 512 1000 600)
484

485
  # Set up upgrade tests. Exclude test_stress_openclose
486 487 488
  configure_file(run_upgrade_stress_test.sh . COPYONLY)
  foreach(src ${stress_test_srcs})
    if (NOT ${src} MATCHES test_stress_openclose)
489 490
      get_filename_component(base ${src} NAME_WE)
      set(test ${base}.tdb)
491

492
      foreach(oldver 4.2.0 5.0.8 5.2.7 6.0.0 6.1.0)
493
        foreach(p_or_s pristine stressed)
494
          if (NOT (${base} MATCHES test_stress4 AND ${p_or_s} MATCHES stressed))
495
            foreach(size 2000)
496
              add_custom_executable(upgrade_${oldver}_${p_or_s}_${size} ${test} ${base})
Leif Walsh's avatar
Leif Walsh committed
497
              add_test(
498
                NAME ydb/${test}/upgrade/${oldver}/${p_or_s}/${size}
499
                COMMAND ${CMAKE_CFG_INTDIR}/run_upgrade_stress_test.sh $<TARGET_FILE:upgrade_${oldver}_${p_or_s}_${size}_${test}> ${TOKU_SVNROOT}/tokudb.data/old-stress-test-envs/${oldver}/saved${p_or_s}-${size}-dir dir.upgrade_${oldver}_${p_or_s}_${size}_${base}.tdb ${size} 600)
500
              set_tests_properties(ydb/${test}/upgrade/${oldver}/${p_or_s}/${size} PROPERTIES TIMEOUT 10800)
501 502 503
            endforeach(size)
          endif ()
        endforeach(p_or_s)
Leif Walsh's avatar
Leif Walsh committed
504
      endforeach(oldver)
505 506 507
    endif ()
  endforeach(src)

508 509 510 511 512 513 514
  ## for some reason this rule doesn't run with the makefile and it crashes with this rule, so I'm disabling this special case
  #declare_custom_tests(test_thread_stack.tdb)
  #add_custom_command(OUTPUT run_test_thread_stack.sh
  #  COMMAND install "${CMAKE_CURRENT_SOURCE_DIR}/run_test_thread_stack.sh" "${CMAKE_CFG_INTDIR}"
  #  MAIN_DEPENDENCY run_test_thread_stack.sh
  #  VERBATIM)
  #add_custom_target(install_run_test_thread_stack.sh ALL DEPENDS run_test_thread_stack.sh)
515
  #add_test(ydb/test_thread_stack.tdb run_test_thread_stack.sh "${CMAKE_CFG_INTDIR}/test_thread_stack.tdb")
516 517 518

  declare_custom_tests(root_fifo_41.tdb)
  foreach(num RANGE 1 100)
519 520
    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(ydb/root_fifo_41_${num}_nopopulate.tdb root_fifo_41.tdb -n ${num} -h root_fifo_41_${num}_nopopulate.tdbdir)
521 522 523 524 525 526 527 528
    set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES
      root_fifo_41_${num}_populate.tdbdir
      root_fifo_41_${num}_nopopulate.tdbdir
      )
  endforeach(num)

  declare_custom_tests(test3039.tdb)
  configure_file(run_test3039.sh . COPYONLY)
529
  add_test(NAME ydb/test3039.tdb
530 531 532 533
    COMMAND run_test3039.sh $<TARGET_FILE:test3039.tdb>)

  declare_custom_tests(test_abort4.tdb)
  foreach(num RANGE -1 19)
534 535
    add_test(ydb/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}_1.tdb test_abort4.tdb -e dir.test_abort4_${num}_1.tdb -c 1 -l ${num})
536 537 538
    set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES dir.test_abort4_${num}_0.tdb dir.test_abort4_${num}_1.tdb)
  endforeach(num)

539 540
  set_property(SOURCE loader-stress-test APPEND PROPERTY COMPILE_DEFINITIONS
    "OLDDATADIR=\"${TOKU_SVNROOT}/tokudb.data/\"")
541
  list(REMOVE_ITEM loader_tests loader-stress-test.loader)
542 543 544 545 546
  add_test(ydb/loader-stress-test0.tdb loader-stress-test.tdb -c -e dir.loader-stress-test0.tdb)
  add_test(ydb/loader-stress-test1.tdb loader-stress-test.tdb -c -p -e dir.loader-stress-test1.tdb)
  add_test(ydb/loader-stress-test2.tdb loader-stress-test.tdb -r 5000 -s -e dir.loader-stress-test2.tdb)
  add_test(ydb/loader-stress-test3.tdb loader-stress-test.tdb -u -c -e dir.loader-stress-test3.tdb)
  add_test(ydb/loader-stress-test4.tdb loader-stress-test.tdb -r 10000000 -c -e dir.loader-stress-test4.tdb)
547
  add_test(ydb/loader-stress-test5.tdb loader-stress-test.tdb -c -z -e dir.loader-stress-test5.tdb)
548 549 550 551 552 553
  set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES
    dir.loader-stress-test0.tdb
    dir.loader-stress-test1.tdb
    dir.loader-stress-test2.tdb
    dir.loader-stress-test3.tdb
    dir.loader-stress-test4.tdb
554
    dir.loader-stress-test5.tdb
555 556 557
    )

  list(REMOVE_ITEM loader_tests loader-dup-test.loader)
558 559 560 561 562 563
  add_test(ydb/loader-dup-test0.tdb loader-dup-test.tdb -e dir.loader-dup-test0.tdb)
  add_test(ydb/loader-dup-test1.tdb loader-dup-test.tdb -d 1 -r 500000 -e dir.loader-dup-test1.tdb)
  add_test(ydb/loader-dup-test2.tdb loader-dup-test.tdb -d 1 -r 1000000 -e dir.loader-dup-test2.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(ydb/loader-dup-test4.tdb loader-dup-test.tdb -d 1 -s -r 1000 -e dir.loader-dup-test4.tdb)
  add_test(ydb/loader-dup-test5.tdb loader-dup-test.tdb -d 1 -s -r 1000 -E -e dir.loader-dup-test5.tdb)
564 565 566 567 568 569 570 571 572 573 574
  set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES
    dir.loader-dup-test0.tdb
    dir.loader-dup-test1.tdb
    dir.loader-dup-test2.tdb
    dir.loader-dup-test3.tdb
    dir.loader-dup-test4.tdb
    dir.loader-dup-test5.tdb
    )

  ## as part of #4503, we took out test 1 and 3
  list(REMOVE_ITEM loader_tests loader-cleanup-test.loader)
575 576 577 578
  add_test(ydb/loader-cleanup-test0.tdb loader-cleanup-test.tdb -s -r 800 -e dir.loader-cleanup-test0.tdb)
  #add_test(ydb/loader-cleanup-test1.tdb loader-cleanup-test.tdb -s -r 800 -p -e dir.loader-cleanup-test1.tdb)
  add_test(ydb/loader-cleanup-test2.tdb loader-cleanup-test.tdb -s -r 8000 -e dir.loader-cleanup-test2.tdb)
  #add_test(ydb/loader-cleanup-test3.tdb loader-cleanup-test.tdb -s -r 8000 -p -e dir.loader-cleanup-test3.tdb)
579 580 581 582 583 584 585 586
  set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES
    dir.loader-cleanup-test0.tdb
    dir.loader-cleanup-test1.tdb
    dir.loader-cleanup-test2.tdb
    dir.loader-cleanup-test3.tdb
    )

  declare_custom_tests(keyrange.tdb)
587 588
  add_test(ydb/keyrange-get0.tdb keyrange.tdb --get 0 --envdir dir.keyrange-get0.tdb)
  add_test(ydb/keyrange-get1.tdb keyrange.tdb --get 1 --envdir dir.keyrange-get1.tdb)
589 590 591 592 593
  if (0)
    add_test(ydb/keyrange-random-get0.tdb keyrange.tdb --get 0 --random_keys 1 --envdir dir.keyrange-random-get0.tdb)
    add_test(ydb/keyrange-random-get1.tdb keyrange.tdb --get 1 --random_keys 1 --envdir dir.keyrange-random-get1.tdb)
  else ()
    message(WARNING "TODO(leif): re-enable keyrange tests, see #5666")
Leif Walsh's avatar
Leif Walsh committed
594
    declare_custom_tests(keyrange-merge.tdb)
595 596
    list(REMOVE_ITEM abortrecover_tests recover-flt1.abortrecover)
  endif ()
597 598
  add_test(ydb/keyrange-loader-get0.tdb keyrange.tdb --get 0 --loader 1 --envdir dir.keyrange-loader-get0.tdb)
  add_test(ydb/keyrange-loader-get1.tdb keyrange.tdb --get 1 --loader 1 --envdir dir.keyrange-loader-get1.tdb)
599 600 601 602 603 604 605 606 607 608
  set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES
    dir.keyrange-get0.tdb
    dir.keyrange-get1.tdb
    dir.keyrange-random-get0.tdb
    dir.keyrange-random-get1.tdb
    dir.keyrange-loader-get0.tdb
    dir.keyrange-loader-get1.tdb
    )

  declare_custom_tests(maxsize-for-loader.tdb)
609 610
  add_test(ydb/maxsize-for-loader-A.tdb maxsize-for-loader.tdb -e dir.maxsize-for-loader-A.tdb -f)
  add_test(ydb/maxsize-for-loader-B.tdb maxsize-for-loader.tdb -e dir.maxsize-for-loader-B.tdb)
611 612 613 614 615 616 617 618 619 620 621 622 623 624
  set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES
    dir.maxsize-for-loader-A.tdb
    dir.maxsize-for-loader-B.tdb
    )

  declare_custom_tests(hotindexer-undo-do-test.tdb)
  file(GLOB hotindexer_tests RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "hotindexer-undo-do-tests/*.test")
  file(GLOB hotindexer_results RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "hotindexer-undo-do-tests/*.result")
  configure_file(run-hotindexer-undo-do-tests.bash . COPYONLY)
  foreach(result ${hotindexer_results})
    configure_file(${result} ${result} COPYONLY)
  endforeach(result)
  foreach(test ${hotindexer_tests})
    configure_file(${test} ${test} COPYONLY)
625
    add_test(NAME ydb/${test} COMMAND run-hotindexer-undo-do-tests.bash ${test})
626 627 628
  endforeach()

  foreach(test ${tdb_tests} ${bdb_tests})
629
    add_test(ydb/${test} ${test})
630 631 632 633 634
  endforeach(test)

  configure_file(run_recover_test.sh . COPYONLY)
  foreach(recover_test ${recover_tests})
    get_filename_component(base ${recover_test} NAME_WE)
635
    add_test(NAME ydb/${recover_test}
636 637
      COMMAND run_recover_test.sh $<TARGET_FILE:${base}.tdb> "dir.${base}.tdb" $<TARGET_FILE:tdb-recover> $<TARGET_FILE:tokudb_dump_static>)
    set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "dir.${base}.tdb" "dir.${base}.tdb.recover")
638 639 640 641 642
  endforeach(recover_test)

  configure_file(run_abortrecover_test.sh . COPYONLY)
  foreach(abortrecover_test ${abortrecover_tests})
    get_filename_component(base ${abortrecover_test} NAME_WE)
643
    add_test(NAME ydb/${base}.abortrecover
644
      COMMAND run_abortrecover_test.sh $<TARGET_FILE:${base}.tdb>)
645 646 647 648
  endforeach(abortrecover_test)

  foreach(loader_test ${loader_tests})
    get_filename_component(base ${loader_test} NAME_WE)
649 650
    add_test(ydb/${base}.nop.loader ${base}.tdb -e "dir.${base}.nop.loader")
    add_test(ydb/${base}.p.loader ${base}.tdb -p -e "dir.${base}.p.loader")
651
    add_test(ydb/${base}.comp.loader ${base}.tdb -z -e "dir.${base}.comp.loader")
652 653
    if("${tdb_tests_that_should_fail}" MATCHES "${base}.loader")
      list(REMOVE_ITEM tdb_tests_that_should_fail ${base}.loader)
654
      list(APPEND tdb_tests_that_should_fail ${base}.nop.loader ${base}.p.loader ${base}.comp.loader)
655
    endif()
656
    set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "dir.${base}.nop.loader" "dir.${base}.p.loader" "dir.${base}.comp.loader")
657 658
  endforeach(loader_test)

659 660
  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}")
661
  set_tests_properties(${tdb_tests_that_should_fail} PROPERTIES WILL_FAIL TRUE)
662

663
  ## give some tests, that time out normally, 1 hour to complete
664
  set(long_tests
665
    ydb/checkpoint_1.tdb
666
    ydb/drd_test_groupcommit_count.tdb
667
    ydb/env-put-multiple.tdb
668
    ydb/filesize.tdb
669
    ydb/hot-optimize-table-tests.tdb
670 671 672
    ydb/loader-cleanup-test0.tdb
    ydb/loader-cleanup-test2.tdb
    ydb/manyfiles.tdb
673
    ydb/recovery_fileops_stress.tdb
674 675 676 677 678 679
    ydb/root_fifo_1.tdb
    ydb/root_fifo_2.tdb
    ydb/root_fifo_31.tdb
    ydb/root_fifo_32.tdb
    ydb/shutdown-3344.tdb
    ydb/stat64-create-modify-times.tdb
680
    ydb/test1572.tdb
681 682 683 684 685
    ydb/test_abort4_19_0.tdb
    ydb/test_abort4_19_1.tdb
    ydb/test_abort5.tdb
    ydb/test_archive1.tdb
    ydb/test_logmax.tdb
686
    ydb/test_query.tdb
687 688 689 690 691 692
    ydb/test_txn_abort5.tdb
    ydb/test_txn_abort5a.tdb
    ydb/test_txn_abort6.tdb
    ydb/test_txn_nested2.tdb
    ydb/test_txn_nested4.tdb
    ydb/test_txn_nested5.tdb
693
    ydb/test_update_broadcast_stress.tdb
694
    ydb/test_update_stress.tdb
695
    )
696
  if (BDB_FOUND)
697
    list(APPEND long_tests
698 699
      ydb/root_fifo_1.bdb
      ydb/root_fifo_31.bdb
700
      ydb/rowsize.bdb
701 702 703
      ydb/test_log10.bdb
      ydb/test_log7.bdb
      ydb/test_logmax.bdb
704
      )
705 706
  endif (BDB_FOUND)
  set_tests_properties(${long_tests} PROPERTIES TIMEOUT 3600)
707 708
  ## some take even longer, with valgrind
  set(extra_long_tests
709
    ydb/drd_test_4015.tdb
710
    ydb/hotindexer-with-queries.tdb
711 712
    ydb/loader-dup-test0.tdb
    ydb/loader-stress-del.nop.loader
713
    ydb/loader-stress-del.p.loader
714
    ydb/loader-stress-del.comp.loader
715 716
    ydb/loader-stress-test4.tdb
    ydb/test3039.tdb
717
    ydb/test3529.tdb
718
    )
719 720 721 722 723
  if (BDB_FOUND)
    list(APPEND extra_long_tests
      ydb/test_groupcommit_count.bdb
      )
  endif (BDB_FOUND)
724
  set_tests_properties(${extra_long_tests} PROPERTIES TIMEOUT 7200)
725 726
  ## these really take a long time with valgrind
  set(phenomenally_long_tests
727 728
    ydb/checkpoint_stress.tdb
    ydb/recover_stress.tdb
729
    ydb/recovery_fileops_unit.tdb
730
    )
731 732 733 734 735
  if (BDB_FOUND)
    list(APPEND phenomenally_long_tests
      ydb/test1426.tdb
      )
  endif (BDB_FOUND)
736
  set_tests_properties(${phenomenally_long_tests} PROPERTIES TIMEOUT 14400)
737
endif(BUILD_TESTING OR BUILD_SRC_TESTS)