diff options
author | Vasil Velichkov <vvvelichkov@gmail.com> | 2019-09-05 01:35:11 +0300 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2020-01-10 21:24:10 -0800 |
commit | adfb62fb12af16cb6939bbe9841d19b51423707e (patch) | |
tree | 1232aff4e88febacb4b9ba2f5f2c9bac6ace7ed9 /grc | |
parent | e05ef84a5bf20f5b01af32a6fa98e71856411612 (diff) |
grc: Execute tests only when pytest is available
Diffstat (limited to 'grc')
-rw-r--r-- | grc/tests/CMakeLists.txt | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/grc/tests/CMakeLists.txt b/grc/tests/CMakeLists.txt index e4d3de56b0..f45a7a15db 100644 --- a/grc/tests/CMakeLists.txt +++ b/grc/tests/CMakeLists.txt @@ -20,8 +20,16 @@ include(GrPython) if(ENABLE_TESTING) - add_test (NAME grc_tests - COMMAND ${QA_PYTHON_EXECUTABLE} -m pytest - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - ) + GR_PYTHON_CHECK_MODULE_RAW( + "pytest" + "import pytest" + PYTEST_FOUND + ) + + if(PYTEST_FOUND) + add_test (NAME grc_tests + COMMAND ${QA_PYTHON_EXECUTABLE} -m pytest + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + ) + endif() endif(ENABLE_TESTING) |