tests/CMakeLists.txt: Fix trying to run tests even if no python interpreter is available
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
@@ -15,10 +15,9 @@ if (BUILDSWIGPYTHON)
|
|||||||
elseif (PYTHON3INTERP_FOUND AND EXISTS "${CMAKE_BINARY_DIR}/src/python/python3/mraa.py")
|
elseif (PYTHON3INTERP_FOUND AND EXISTS "${CMAKE_BINARY_DIR}/src/python/python3/mraa.py")
|
||||||
set (PYTHON_DEFAULT_PYTHONPATH "${CMAKE_BINARY_DIR}/src/python/python3")
|
set (PYTHON_DEFAULT_PYTHONPATH "${CMAKE_BINARY_DIR}/src/python/python3")
|
||||||
set (PYTHON_DEFAULT_INTERP "${PYTHON3_EXECUTABLE}")
|
set (PYTHON_DEFAULT_INTERP "${PYTHON3_EXECUTABLE}")
|
||||||
else ()
|
|
||||||
message (STATUS "Could not run tests since python interpreter or python bindings not built")
|
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
if (DEFINED PYTHON_DEFAULT_INTERP)
|
||||||
if (MOCKPLAT)
|
if (MOCKPLAT)
|
||||||
add_subdirectory (mock)
|
add_subdirectory (mock)
|
||||||
else ()
|
else ()
|
||||||
@@ -31,4 +30,7 @@ if (BUILDSWIGPYTHON)
|
|||||||
add_test (NAME py_gpio COMMAND ${PYTHON_DEFAULT_INTERP} ${CMAKE_CURRENT_SOURCE_DIR}/gpio_checks.py)
|
add_test (NAME py_gpio COMMAND ${PYTHON_DEFAULT_INTERP} ${CMAKE_CURRENT_SOURCE_DIR}/gpio_checks.py)
|
||||||
set_tests_properties(py_gpio PROPERTIES ENVIRONMENT "PYTHONPATH=${PYTHON_DEFAULT_PYTHONPATH}")
|
set_tests_properties(py_gpio PROPERTIES ENVIRONMENT "PYTHONPATH=${PYTHON_DEFAULT_PYTHONPATH}")
|
||||||
endif ()
|
endif ()
|
||||||
|
else ()
|
||||||
|
message (STATUS "Could not run tests since python interpreter or python bindings not built")
|
||||||
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
|
|||||||
Reference in New Issue
Block a user