Skip to content

Commit

Permalink
Put pytest_discover_tests into a BUILD_TESTING block
Browse files Browse the repository at this point in the history
  • Loading branch information
adamkewley committed Jan 29, 2025
1 parent 2881513 commit 48a7919
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions opensimcreator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@ set_target_properties(opensimcreator_core PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src/opensimcreator
)

# use `pytest` to automatically discover all of the available tests
pytest_discover_tests(
PythonTest
PYTHON_PATH_PREPEND ${CMAKE_CURRENT_SOURCE_DIR}/src
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests
DEPENDS opensimcreator_core
INCLUDE_FILE_PATH
)
if(BUILD_TESTING)
# use `pytest` to automatically discover all of the available tests
pytest_discover_tests(
PythonTest
PYTHON_PATH_PREPEND ${CMAKE_CURRENT_SOURCE_DIR}/src
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests
DEPENDS opensimcreator_core
INCLUDE_FILE_PATH
)
endif()

0 comments on commit 48a7919

Please sign in to comment.