diff --git a/ortools/algorithms/python/CMakeLists.txt b/ortools/algorithms/python/CMakeLists.txt index 19e4d8e7d1..87e29473d1 100644 --- a/ortools/algorithms/python/CMakeLists.txt +++ b/ortools/algorithms/python/CMakeLists.txt @@ -30,3 +30,10 @@ endif() target_link_libraries(knapsack_solver_pybind11 PRIVATE ${PROJECT_NAMESPACE}::ortools) add_library(${PROJECT_NAMESPACE}::knapsack_solver_pybind11 ALIAS knapsack_solver_pybind11) + +if(BUILD_TESTING) + file(GLOB PYTHON_SRCS "*_test.py") + foreach(FILE_NAME IN LISTS PYTHON_SRCS) + add_python_test(FILE_NAME ${FILE_NAME}) + endforeach() +endif()