🧪 test: 增加gtest

This commit is contained in:
“pengxuanzheng”
2022-03-02 07:53:16 +00:00
parent 9d688a9e9e
commit e7f4277894
17 changed files with 280 additions and 219 deletions

View File

@@ -15,9 +15,28 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall ")
set(CMAKE_INSTALL_PREFIX /opt/MESA)
set(SUPPORT_INSTALL_PREFIX /usr/local/lib64)
find_program(CMAKE_CXX_CPPCHECK NAMES cppcheck)
if (CMAKE_CXX_CPPCHECK)
list(
APPEND CMAKE_CXX_CPPCHECK
"--enable=all"
"--error-exitcode=0"
"--suppress=unusedFunction"
"--suppress=missingInclude"
"--suppress=uselessAssignmentPtrArg"
"--suppress=unmatchedSuppression"
)
set(CMAKE_C_CPPCHECK ${CMAKE_CXX_CPPCHECK})
else()
message(FATAL_ERROR "Could not find the program cppcheck.")
endif()
add_subdirectory(support)
add_subdirectory(src)
enable_testing()
add_subdirectory(gtest)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/src/libhos-client-cpp.so DESTINATION ${CMAKE_INSTALL_PREFIX}/lib COMPONENT LIBRARIES)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/hos_client.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include COMPONENT HEADER)
#install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/conf/hos.conf DESTINATION /etc/ld.so.conf.d COMPONENT PROFILE)