2021-04-19 03:16:16 +00:00
|
|
|
# Copyright (C) 2019-2020 Zilliz. All rights reserved.
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
|
|
|
|
# with the License. You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software distributed under the License
|
|
|
|
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
|
|
|
# or implied. See the License for the specific language governing permissions and limitations under the License
|
|
|
|
|
2020-09-15 02:00:00 +00:00
|
|
|
include_directories(${CMAKE_HOME_DIRECTORY}/src)
|
2021-03-04 09:09:48 +00:00
|
|
|
include_directories(${CMAKE_HOME_DIRECTORY}/src/thirdparty)
|
|
|
|
|
|
|
|
add_definitions(-DMILVUS_TEST_SEGCORE_YAML_PATH="${CMAKE_SOURCE_DIR}/unittest/test_utils/test_segcore.yaml")
|
|
|
|
|
2022-04-08 07:29:31 +00:00
|
|
|
# TODO: better to use ls/find pattern
|
|
|
|
set(MILVUS_TEST_FILES
|
|
|
|
init_gtest.cpp
|
2022-07-01 14:28:23 +00:00
|
|
|
test_bf.cpp
|
2022-04-08 07:29:31 +00:00
|
|
|
test_binary.cpp
|
|
|
|
test_bitmap.cpp
|
|
|
|
test_bool_index.cpp
|
|
|
|
test_common.cpp
|
|
|
|
test_concurrent_vector.cpp
|
|
|
|
test_c_api.cpp
|
|
|
|
test_expr.cpp
|
2023-09-08 02:03:16 +00:00
|
|
|
test_float16.cpp
|
2022-07-18 01:58:28 +00:00
|
|
|
test_growing.cpp
|
2023-04-26 02:14:41 +00:00
|
|
|
test_growing_index.cpp
|
2022-04-08 07:29:31 +00:00
|
|
|
test_indexing.cpp
|
|
|
|
test_index_c_api.cpp
|
|
|
|
test_index_wrapper.cpp
|
|
|
|
test_init.cpp
|
2022-06-24 13:12:15 +00:00
|
|
|
test_parquet_c.cpp
|
2022-04-08 07:29:31 +00:00
|
|
|
test_query.cpp
|
|
|
|
test_reduce.cpp
|
|
|
|
test_reduce_c.cpp
|
2022-04-29 05:35:49 +00:00
|
|
|
test_relational.cpp
|
2022-04-08 07:29:31 +00:00
|
|
|
test_retrieve.cpp
|
|
|
|
test_scalar_index.cpp
|
|
|
|
test_sealed.cpp
|
|
|
|
test_segcore.cpp
|
|
|
|
test_similarity_corelation.cpp
|
|
|
|
test_span.cpp
|
2022-04-29 05:35:49 +00:00
|
|
|
test_string_expr.cpp
|
2022-04-08 07:29:31 +00:00
|
|
|
test_timestamp_index.cpp
|
|
|
|
test_utils.cpp
|
2022-09-09 14:12:34 +00:00
|
|
|
test_data_codec.cpp
|
2023-02-21 01:48:32 +00:00
|
|
|
test_range_search_sort.cpp
|
2023-03-21 08:31:57 +00:00
|
|
|
test_tracer.cpp
|
2023-06-25 06:38:44 +00:00
|
|
|
test_local_chunk_manager.cpp
|
|
|
|
test_disk_file_manager_test.cpp
|
2023-07-05 02:18:24 +00:00
|
|
|
test_integer_overflow.cpp
|
2023-08-01 12:29:05 +00:00
|
|
|
test_offset_ordered_map.cpp
|
|
|
|
test_offset_ordered_array.cpp
|
2023-08-16 12:20:17 +00:00
|
|
|
test_always_true_expr.cpp
|
2023-09-15 02:21:20 +00:00
|
|
|
test_plan_proto.cpp
|
|
|
|
test_chunk_cache.cpp
|
2023-10-31 18:20:15 +00:00
|
|
|
test_binlog_index.cpp
|
2023-11-19 09:22:25 +00:00
|
|
|
test_storage.cpp
|
2023-09-15 02:21:20 +00:00
|
|
|
)
|
2022-04-08 07:29:31 +00:00
|
|
|
|
2022-09-21 12:16:51 +00:00
|
|
|
if ( BUILD_DISK_ANN STREQUAL "ON" )
|
|
|
|
set(MILVUS_TEST_FILES
|
|
|
|
${MILVUS_TEST_FILES}
|
2023-10-13 06:15:35 +00:00
|
|
|
#need update aws-sdk-cpp, see more from https://github.com/aws/aws-sdk-cpp/issues/1757
|
2022-10-20 02:23:27 +00:00
|
|
|
#test_minio_chunk_manager.cpp
|
2022-09-21 12:16:51 +00:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2022-06-02 02:48:03 +00:00
|
|
|
if (LINUX OR APPLE)
|
2022-02-09 06:27:46 +00:00
|
|
|
set(MILVUS_TEST_FILES
|
2022-04-08 07:29:31 +00:00
|
|
|
${MILVUS_TEST_FILES}
|
2022-03-21 06:23:24 +00:00
|
|
|
test_scalar_index_creator.cpp
|
2022-04-01 07:31:29 +00:00
|
|
|
test_string_index.cpp
|
2023-09-19 06:23:23 +00:00
|
|
|
test_array.cpp test_array_expr.cpp)
|
2022-04-08 07:29:31 +00:00
|
|
|
endif()
|
|
|
|
|
2023-09-19 02:01:23 +00:00
|
|
|
if (DEFINED AZURE_BUILD_DIR)
|
|
|
|
set(MILVUS_TEST_FILES
|
|
|
|
${MILVUS_TEST_FILES}
|
|
|
|
test_azure_chunk_manager.cpp
|
|
|
|
#need update aws-sdk-cpp, see more from https://github.com/aws/aws-sdk-cpp/issues/2119
|
|
|
|
#test_remote_chunk_manager.cpp
|
|
|
|
)
|
|
|
|
include_directories("${AZURE_BUILD_DIR}/vcpkg_installed/${VCPKG_TARGET_TRIPLET}/include")
|
|
|
|
endif()
|
|
|
|
|
2022-04-08 07:29:31 +00:00
|
|
|
if (LINUX)
|
2022-12-29 07:29:31 +00:00
|
|
|
message( STATUS "Building Milvus Unit Test on Linux")
|
|
|
|
option(USE_ASAN "Whether to use AddressSanitizer" OFF)
|
|
|
|
if ( USE_ASAN )
|
|
|
|
message( STATUS "Building Milvus using AddressSanitizer")
|
|
|
|
add_compile_options(-fno-stack-protector -fno-omit-frame-pointer -fno-var-tracking -fsanitize=address)
|
|
|
|
add_link_options(-fno-stack-protector -fno-omit-frame-pointer -fno-var-tracking -fsanitize=address)
|
|
|
|
endif()
|
|
|
|
|
2022-02-09 06:27:46 +00:00
|
|
|
# check if memory leak exists in index builder
|
|
|
|
set(INDEX_BUILDER_TEST_FILES
|
|
|
|
test_index_wrapper.cpp
|
2022-03-21 06:23:24 +00:00
|
|
|
test_scalar_index_creator.cpp
|
|
|
|
test_index_c_api.cpp
|
2022-02-09 06:27:46 +00:00
|
|
|
)
|
2021-03-04 09:09:48 +00:00
|
|
|
|
2022-02-09 06:27:46 +00:00
|
|
|
add_executable(index_builder_test
|
|
|
|
${INDEX_BUILDER_TEST_FILES}
|
|
|
|
)
|
2020-08-27 02:08:42 +00:00
|
|
|
|
2022-02-09 06:27:46 +00:00
|
|
|
target_link_libraries(index_builder_test
|
|
|
|
gtest
|
|
|
|
gtest_main
|
|
|
|
milvus_segcore
|
2022-11-03 06:39:40 +00:00
|
|
|
milvus_storage
|
2022-02-09 06:27:46 +00:00
|
|
|
milvus_indexbuilder
|
2023-12-05 08:48:54 +00:00
|
|
|
milvus_common
|
2022-02-09 06:27:46 +00:00
|
|
|
)
|
|
|
|
install(TARGETS index_builder_test DESTINATION unittest)
|
|
|
|
endif()
|
2021-03-04 09:09:48 +00:00
|
|
|
|
2022-02-09 06:27:46 +00:00
|
|
|
add_executable(all_tests
|
|
|
|
${MILVUS_TEST_FILES}
|
2021-02-23 06:35:00 +00:00
|
|
|
)
|
2021-02-20 02:14:03 +00:00
|
|
|
|
2020-09-15 02:00:00 +00:00
|
|
|
target_link_libraries(all_tests
|
|
|
|
gtest
|
2020-10-31 07:11:47 +00:00
|
|
|
milvus_segcore
|
2022-11-03 06:39:40 +00:00
|
|
|
milvus_storage
|
2020-12-25 03:10:31 +00:00
|
|
|
milvus_indexbuilder
|
2020-09-15 02:00:00 +00:00
|
|
|
pthread
|
2023-12-05 08:48:54 +00:00
|
|
|
milvus_common
|
2020-10-15 13:31:50 +00:00
|
|
|
)
|
2020-12-09 01:55:56 +00:00
|
|
|
|
2021-05-28 02:39:30 +00:00
|
|
|
install(TARGETS all_tests DESTINATION unittest)
|
2021-12-07 12:17:03 +00:00
|
|
|
|
2022-04-05 04:43:30 +00:00
|
|
|
if (LINUX)
|
|
|
|
add_subdirectory(bench)
|
|
|
|
endif ()
|
2023-07-13 08:22:30 +00:00
|
|
|
|
|
|
|
if (USE_DYNAMIC_SIMD)
|
|
|
|
add_executable(dynamic_simd_test
|
|
|
|
test_simd.cpp)
|
|
|
|
|
|
|
|
target_link_libraries(dynamic_simd_test
|
|
|
|
milvus_simd
|
|
|
|
milvus_log
|
|
|
|
gtest
|
|
|
|
${CONAN_LIBS})
|
|
|
|
|
|
|
|
install(TARGETS dynamic_simd_test DESTINATION unittest)
|
|
|
|
endif()
|
|
|
|
|