Skip to content
Snippets Groups Projects
Commit 0123ab60 authored by Sergey Kosukhin's avatar Sergey Kosukhin
Browse files

cmake: test Python interface

parent d37460fa
No related branches found
No related tags found
1 merge request!56CMake support for the Python interface
......@@ -28,3 +28,36 @@ target_link_libraries(
test_runner PRIVATE mtime_check mtime::mtime Check::Interface
)
add_test(NAME test_runner COMMAND test_runner)
if(MTIME_ENABLE_PYTHON)
find_package(UnixCommands)
if(NOT BASH)
message(
FATAL_ERROR
"Could not find the Bash interpreter required for the Python tests"
)
endif()
include(AutoconfConfigure)
set(test_python_tmp
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/mtime/test_python.sh"
)
autoconf_configure(
INPUTS ${CMAKE_CURRENT_SOURCE_DIR}/test_python.sh.in
OUTPUTS ${test_python_tmp}
VARIABLES SHELL ENABLE_PYTHON_FALSE abs_top_builddir PYTHON
VALUES "${BASH}" "#" "${PROJECT_BINARY_DIR}" "${Python_EXECUTABLE}"
)
file(
COPY ${test_python_tmp}
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}
FILE_PERMISSIONS
OWNER_READ
OWNER_WRITE
OWNER_EXECUTE
GROUP_READ
GROUP_EXECUTE
WORLD_READ
WORLD_EXECUTE
)
add_test(NAME test_python.sh COMMAND test_python.sh)
endif()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment