# /* (c)  oblong industries */

project(PlasmaTests C CXX)

set(
  PlasmaTests_TESTS

  await_test
  bad_pool_name
  bad_type
  check-stepsize-behavior
  create_existing_pool
  deposit-timestamp
  empty-gang
  list_pools
  many_creates
  null_pool_name
  null_test
  participate_create
  pingpong_test
  pool-log-test
  random-access-test
  RecentServerOnly
  rewind_test
  seek_test
  MiscPoolTest #check_PROGRAMS_UNSCRIPTED
  TocUnitTest #check_PROGRAMS_UNSCRIPTED
  # dist_check_SCRIPTS:
  pool_tests
  protein_tests
  index_tests
  stress_tests
  # other tests
  #toc-pool-test -- just a wrapper around TocPoolTest
  #recent-server-only -- just a wrapper around RecentServerOnly
  tcp_pool_name
  test-await-index
  test-bigger
  test-info
  test-multi-await
  test-p-stop
  test-zap
  TocPoolTest
  too_big_pool
  too_long_pool_name
  too_small_pool
  wrap_test
)

if (WIN32)
  message("Skipping tests that rely on ruby plasma, as the gem build hasn't been ported to win32 yet")
else()
  LIST(APPEND PlasmaTests_TESTS
    resize-stress
    slashed-list-pools
    slashed-pool-name
    zombie
  )
endif()

# Test fixture X is defined by files in bld/cmake/fixtures/X, see bld/cmake/yotest.in
# The 'tcps' test fixture's certificates in bld/cmake/fixtures/tcps/
# were generated by ob-plasma-cert.sh, and will need to be regenerated
# again when they expire.  FIXME: run that script each time?
set(PlasmaTests_FIXTURES
  local
  tcp
  tcpo
  tcps
)
set(PlasmaTests_LINK_LIBS Plasma ${Plasma_LINK_LIBS})
generate_tests("${PlasmaTests_TESTS}" "${PlasmaTests_LINK_LIBS}" "${PlasmaTests_FIXTURES}")

# Not really manual; they're run indirectly by *_tests.sh
set(
  PlasmaTests_MANUAL_C_TESTS

  doppelganger
  perf_test
)

set(SUFFIX "c")
foreach( test ${PlasmaTests_MANUAL_C_TESTS} )
   add_executable(${test} ${test}.${SUFFIX})
   target_link_libraries(${test} Plasma)
endforeach()
