Skip to content

Commit

Permalink
[feat][document] Add tantivy_search test.
Browse files Browse the repository at this point in the history
Signed-off-by: Ketor <[email protected]>
  • Loading branch information
ketor authored and rock-git committed May 14, 2024
1 parent 91a1974 commit e7f38de
Show file tree
Hide file tree
Showing 64 changed files with 691 additions and 19 deletions.
48 changes: 29 additions & 19 deletions test/unit_test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,29 +1,39 @@
enable_testing()

add_subdirectory(legacy)
add_subdirectory(sdk)

SET(UNIT_TEST_BIN "dingodb_unit_test")
if(WITH_DOC)
add_subdirectory(document)
endif()

file(GLOB TEST_SRCS "test_*.cc")
SET(UNIT_TEST_BIN "dingodb_unit_test")

add_executable(${UNIT_TEST_BIN}
main.cc
${TEST_SRCS}
)
add_executable(${UNIT_TEST_BIN} main.cc)

add_dependencies(${UNIT_TEST_BIN} ${DEPEND_LIBS} sdk)

target_link_libraries(${UNIT_TEST_BIN}
$<TARGET_OBJECTS:PROTO_OBJS>
$<TARGET_OBJECTS:DINGODB_OBJS>
${DYNAMIC_LIB}
${VECTOR_LIB}
sdk
$<TARGET_OBJECTS:SDK_UNIT_TEST_OBJS>
${GTEST_LIBRARIES}
${GMOCK_LIBRARIES}
"-Xlinker \"-(\""
${BLAS_LIBRARIES}
"-Xlinker \"-)\""
)
set(UNIT_TEST_LIBS
$<TARGET_OBJECTS:PROTO_OBJS>
$<TARGET_OBJECTS:DINGODB_OBJS>
${DYNAMIC_LIB}
${VECTOR_LIB}
$<TARGET_OBJECTS:LEGACY_UNIT_TEST_OBJS>
sdk
$<TARGET_OBJECTS:SDK_UNIT_TEST_OBJS>
)

if(WITH_DOC)
list(APPEND UNIT_TEST_LIBS $<TARGET_OBJECTS:DOCUMENT_UNIT_TEST_OBJS>)
endif()

set(UNIT_TEST_LIBS
${UNIT_TEST_LIBS}
${GTEST_LIBRARIES}
${GMOCK_LIBRARIES}
"-Xlinker \"-(\""
${BLAS_LIBRARIES}
"-Xlinker \"-)\""
)

target_link_libraries(${UNIT_TEST_BIN} ${UNIT_TEST_LIBS})
12 changes: 12 additions & 0 deletions test/unit_test/document/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/)

set(DOCUMENT_UNIT_TEST_SRCS
test_tantivy_search.cc
)

add_library(DOCUMENT_UNIT_TEST_OBJS
OBJECT
${DOCUMENT_UNIT_TEST_SRCS}
)

add_dependencies(DOCUMENT_UNIT_TEST_OBJS ${DEPEND_LIBS})
634 changes: 634 additions & 0 deletions test/unit_test/document/test_tantivy_search.cc

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions test/unit_test/legacy/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# include_directories(${CMAKE_CURRENT_SOURCE_DIR}/)

file(GLOB LEGACY_UNIT_TEST_COMMON_SRCS "common/*.cc")
file(GLOB LEGACY_UNIT_TEST_VECTOR_SRCS "vector/*.cc")

set(LEGACY_UNIT_TEST_SRCS
${LEGACY_UNIT_TEST_COMMON_SRCS}
${LEGACY_UNIT_TEST_VECTOR_SRCS}
)

add_library(LEGACY_UNIT_TEST_OBJS
OBJECT
${LEGACY_UNIT_TEST_SRCS}
)

add_dependencies(LEGACY_UNIT_TEST_OBJS ${DEPEND_LIBS})
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit e7f38de

Please sign in to comment.