function(mit_unittest case)
  if(ARGC EQUAL 1)
    add_executable(${case} ${case}.cpp)
  else()
    add_executable(${ARGV})
  endif()
  if (case MATCHES "^test_.*")
    add_test(${case} ${case})
    set_tests_properties(${case} PROPERTIES TIMEOUT 300)
  endif()
  target_link_libraries(${case} PRIVATE -Wl,--whole-archive mock_di -Wl,--no-whole-archive oceanbase gtest gmock)
  target_include_directories(${case}
    PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/unittest ${CMAKE_SOURCE_DIR}/deps/oblib/unittest ${CMAKE_SOURCE_DIR}/sensitive_test)
endfunction()

function(mit_shared_storage_unittest case)
  mit_unittest(${case})
  if (case MATCHES "^test_.*")
    set_tests_properties(${case} PROPERTIES TIMEOUT 600)
  endif()
endfunction()

add_subdirectory(tmp_file)
add_subdirectory(simple_server)
