Skip to content

Commit

Permalink
Make having pytest mandatory only if PYTHON_TEST_FORCE is set in CMake
Browse files Browse the repository at this point in the history
  • Loading branch information
lgeretti committed Jul 10, 2024
1 parent acc9ab1 commit d0b6e0e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:

- name: Configure CMake
working-directory: ${{runner.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=g++-11 -G "Ninja" -DCOVERAGE=ON
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=g++-11 -G "Ninja" -DCOVERAGE=ON -DPYTHON_TEST_FORCE=ON

- name: Build Library, Bindings and Tests
working-directory: ${{runner.workspace}}/build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:

- name: Configure CMake
working-directory: ${{runner.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_CXX_COMPILER=${{matrix.config.cxx}} -G "Ninja" -DWERROR=ON
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_CXX_COMPILER=${{matrix.config.cxx}} -G "Ninja" -DWERROR=ON -DPYTHON_TEST_FORCE=ON

- name: Build Library and Bindings
working-directory: ${{runner.workspace}}/build
Expand Down
4 changes: 2 additions & 2 deletions python/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ if(${PYTEST_result} EQUAL 0)
set(PYTHON_TESTS ON)
message(STATUS "pytest package found, Python tests will be performed.")
else()
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
message(FATAL_ERROR "pytest package not available, can not perform Python tests.")
if(PYTHON_TESTS_REQUIRED)
message(ERROR "pytest package not available, will not perform Python tests.")
else()
message(WARNING "pytest package not available, will not perform Python tests.")
endif()
Expand Down

0 comments on commit d0b6e0e

Please sign in to comment.