Skip to content

Commit

Permalink
disable Python tests when -DBUILD_TESTING=OFF
Browse files Browse the repository at this point in the history
  • Loading branch information
jbathegit committed Jun 14, 2024
1 parent 6995698 commit 6df7211
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,16 @@ if(ENABLE_DOCS)
add_dependencies(python_docs doc python_mod)
endif()

# Add tests
set(pytest_list checkpoint gps misc prepbufr rad satwnd write)
foreach(pytestname ${pytest_list})
add_test(
NAME test_pyncepbufr_${pytestname}
COMMAND
${CMAKE_COMMAND} -E env PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:$ENV{PYTHONPATH}
${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/test_${pytestname}.py
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/test/testfiles
)
endforeach()
if(BUILD_TESTING)
# Add tests
set(pytest_list checkpoint gps misc prepbufr rad satwnd write)
foreach(pytestname ${pytest_list})
add_test(
NAME test_pyncepbufr_${pytestname}
COMMAND
${CMAKE_COMMAND} -E env PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:$ENV{PYTHONPATH}
${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/test_${pytestname}.py
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/test/testfiles
)
endforeach()
endif()

0 comments on commit 6df7211

Please sign in to comment.