Skip to content

Commit

Permalink
Fix errors when making the package
Browse files Browse the repository at this point in the history
1.make: unit_test is created by default.
2.make package: unit_test is not included.
3.Set -DWITH_TESTS=OFF to compile without unit_test.
  • Loading branch information
spasserby committed Jan 15, 2024
1 parent 1583b06 commit f68b796
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 18 deletions.
9 changes: 3 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ if (BUILD_PROCEDURE)
endif (BUILD_PROCEDURE)

# unit_test
add_subdirectory(test)
set(LGRAPH_TOOLKITS lgraph_import lgraph_backup lgraph_warmup lgraph_peek lgraph_export lgraph_binlog lgraph_peer)
add_dependencies(unit_test ${LGRAPH_TOOLKITS} lgraph_server)

set_target_properties(unit_test PROPERTIES EXCLUDE_FROM_ALL TRUE)
set_target_properties(fma_unit_test PROPERTIES EXCLUDE_FROM_ALL TRUE)
if (WITH_TESTS)
add_subdirectory(test)
endif (WITH_TESTS)
6 changes: 5 additions & 1 deletion Options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ if (BUILD_PROCEDURE)
message("Build procedures.")
endif (BUILD_PROCEDURE)

option(WITH_TESTS "build with tests" ON)
if (WITH_TESTS)
message("Build with tests.")
endif (WITH_TESTS)

# disable krb5
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DOPENSSL_NO_KRB5=1")

Expand Down Expand Up @@ -189,4 +194,3 @@ if (ENABLE_PREDOWNLOAD_DEPENDS_PACKAGE)
execute_process(COMMAND /bin/sh install.sh
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/src/python/FMA_shell/pkg)
endif ()

4 changes: 2 additions & 2 deletions ci/build_export.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ mkdir build && cd build
# build cpp
if [[ "$ASAN" == "asan" ]]; then
echo 'build with asan ...'
cmake .. -DCMAKE_BUILD_TYPE=Debug -DENABLE_ASAN=ON -DBUILD_PROCEDURE=$WITH_PROCEDURE
cmake .. -DCMAKE_BUILD_TYPE=Debug -DENABLE_ASAN=ON -DBUILD_PROCEDURE=$WITH_PROCEDURE -DWITH_TEST=OFF
else
cmake .. -DCMAKE_BUILD_TYPE=Coverage -DBUILD_PROCEDURE=$WITH_PROCEDURE
cmake .. -DCMAKE_BUILD_TYPE=Coverage -DBUILD_PROCEDURE=$WITH_PROCEDURE -DWITH_TEST=OFF
fi

make -j6
Expand Down
3 changes: 1 addition & 2 deletions ci/build_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,4 @@ else
cmake .. -DCMAKE_BUILD_TYPE=Release
fi

make -j6

make -j6 package
4 changes: 1 addition & 3 deletions ci/github_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ cmake .. -DCMAKE_BUILD_TYPE=Debug -DENABLE_ASAN=ON -DBUILD_PROCEDURE=$WITH_PROCE
else
cmake .. -DCMAKE_BUILD_TYPE=Coverage -DBUILD_PROCEDURE=$WITH_PROCEDURE
fi
make -j2
make -j2 package

if [[ "$TEST" == "ut" ]]; then
make unit_test fma_unit_test -j2

# build tugraph db management
cd $WORKSPACE/deps/tugraph-db-management/
sh local_build.sh
Expand Down
6 changes: 2 additions & 4 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,5 @@ target_link_libraries(unit_test

target_compile_definitions(unit_test PRIVATE
FMA_IN_UNIT_TEST=1)
# install
install(TARGETS unit_test
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib64)

add_dependencies(unit_test ${LGRAPH_TOOLKITS} lgraph_server)

0 comments on commit f68b796

Please sign in to comment.