enhance: [skip e2e] add make run-test-cpp gtest (#35829) (#35837)

pr: https://github.com/milvus-io/milvus/pull/35829

Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com>
pull/35839/head
zhenshan.cao 2024-08-29 21:15:02 +08:00 committed by GitHub
parent cfc99e63b1
commit 1916aec67a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 21 additions and 0 deletions

View File

@ -346,6 +346,12 @@ test-cpp: build-cpp-with-unittest
@echo "Running cpp unittests..."
@(env bash $(PWD)/scripts/run_cpp_unittest.sh)
run-test-cpp:
@echo "Running cpp unittests..."
@echo $(PWD)/scripts/run_cpp_unittest.sh arg=${filter}
@(env bash $(PWD)/scripts/run_cpp_unittest.sh arg=${filter})
# Run code coverage.
codecov: codecov-go codecov-cpp

View File

@ -36,12 +36,26 @@ if [ -d "${CORE_INSTALL_PREFIX}/lib" ]; then
fi
# run unittest
arg="$1"
filter_value="${arg#*=}"
for UNITTEST_DIR in "${UNITTEST_DIRS[@]}"; do
if [ ! -d "${UNITTEST_DIR}" ]; then
echo "The unittest folder does not exist!"
exit 1
fi
if [[ $filter_value ]]; then
if [ $filter_value == "--gtest_list_tests" ]; then
${UNITTEST_DIR}/all_tests $filter_value
exit 0
else
${UNITTEST_DIR}/all_tests --gtest_filter=$filter_value
exit 0
fi
fi
echo "Running all unittest ..."
${UNITTEST_DIR}/all_tests
if [ $? -ne 0 ]; then
@ -56,6 +70,7 @@ for UNITTEST_DIR in "${UNITTEST_DIRS[@]}"; do
exit 1
fi
fi
done
# run cwrapper unittest