Skip to content

Commit

Permalink
cmake: run tests in base/
Browse files Browse the repository at this point in the history
  • Loading branch information
Mizux committed Jan 16, 2025
1 parent 54b8c24 commit d4b9dd8
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions ortools/base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,22 @@ target_link_libraries(${NAME} PRIVATE
protobuf::libprotobuf
${PROJECT_NAMESPACE}::ortools_proto)
#add_library(${PROJECT_NAMESPACE}::base ALIAS ${NAME})

if(BUILD_TESTING)
file(GLOB _TEST_SRCS "*_test.cc")
foreach(_FULL_FILE_NAME IN LISTS _TEST_SRCS)
get_filename_component(_NAME ${_FULL_FILE_NAME} NAME_WE)
get_filename_component(_FILE_NAME ${_FULL_FILE_NAME} NAME)
ortools_cxx_test(
NAME
base_${_NAME}
SOURCES
${_FILE_NAME}
LINK_LIBRARIES
benchmark::benchmark
GTest::gtest
GTest::gtest_main
GTest::gmock
)
endforeach()
endif()

0 comments on commit d4b9dd8

Please sign in to comment.