cmake: rework add_python_test()

* Add FILE_NAME option
* add optional COMPONENT_NAME option
  note: needed if test.py is not in a ortools/<component>/python/ dir
This commit is contained in:
Corentin Le Molgat
2024-01-12 08:55:24 +01:00
parent f225de8b20
commit 75f197409a
9 changed files with 44 additions and 19 deletions

View File

@@ -36,6 +36,6 @@ add_library(${PROJECT_NAMESPACE}::sorted_interval_list_pybind11 ALIAS sorted_int
if(BUILD_TESTING)
file(GLOB PYTHON_SRCS "*_test.py")
foreach(FILE_NAME IN LISTS PYTHON_SRCS)
add_python_test(${FILE_NAME})
add_python_test(FILE_NAME ${FILE_NAME})
endforeach()
endif()