File tree Expand file tree Collapse file tree 5 files changed +29
-14
lines changed
Expand file tree Collapse file tree 5 files changed +29
-14
lines changed Original file line number Diff line number Diff line change 6565 shell : bash
6666 run : |
6767 sudo yum install --setopt=tsflags=nodocs -y eigen3-devel ceres-solver-devel json-devel
68- sudo python -m pip install nanobind
68+ sudo python -m pip install nanobind pytest
6969
7070 - name : Configure CMake
7171 # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
@@ -153,7 +153,7 @@ jobs:
153153 shell : bash
154154 run : |
155155 sudo yum install --setopt=tsflags=nodocs -y eigen3-devel ceres-solver-devel json-devel
156- sudo python -m pip install nanobind
156+ sudo python -m pip install nanobind pytest
157157
158158 - name : Configure CMake
159159 # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
Original file line number Diff line number Diff line change @@ -10,3 +10,5 @@ time sudo apt-get -q -f install -y \
1010 libopencv-dev \
1111 openimageio-tools libopenimageio-dev \
1212 nanobind-dev
13+
14+ pip3 install pytest
Original file line number Diff line number Diff line change 33set -ex
44
55brew install ceres-solver nlohmann-json openimageio nanobind robin-map
6+
7+ python3 -m pip install --break-system-packages pytest
Original file line number Diff line number Diff line change @@ -7,3 +7,5 @@ vcpkg install \
77 nlohmann-json:x64-windows \
88 openimageio:x64-windows \
99 nanobind:x64-windows
10+
11+ pip install pytest
Original file line number Diff line number Diff line change @@ -202,18 +202,27 @@ add_test ( NAME Test_ImageConverter COMMAND Test_ImageConverter )
202202
203203################################################################################
204204# Python tests
205- find_program (PYTHON_EXECUTABLE python3)
206- if (PYTHON_EXECUTABLE)
207- add_test (
208- NAME Test_Python_ImageConverter
209- COMMAND ${PYTHON_EXECUTABLE} -m pytest ${CMAKE_CURRENT_SOURCE_DIR} /python/test_image_converter.py -v
210- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
211- )
212-
213- # Set environment for Python test to find the compiled module
214- set_tests_properties (Test_Python_ImageConverter PROPERTIES
215- ENVIRONMENT "PYTHONPATH=${CMAKE_BINARY_DIR} /src/bindings:$ENV{PYTHONPATH} "
216- )
205+ if (RTA_BUILD_PYTHON_BINDINGS)
206+ find_program (PYTHON_EXECUTABLE python3)
207+ if (PYTHON_EXECUTABLE)
208+ add_test (
209+ NAME Test_Python_ImageConverter
210+ COMMAND ${PYTHON_EXECUTABLE} -m pytest ${CMAKE_CURRENT_SOURCE_DIR} /python/test_image_converter.py -v
211+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
212+ )
213+
214+ # Set environment for Python test to find the compiled module
215+ # Handle both single-config (Linux/macOS) and multi-config (Windows) generators
216+ if (WIN32 )
217+ set_tests_properties (Test_Python_ImageConverter PROPERTIES
218+ ENVIRONMENT "PYTHONPATH=${CMAKE_BINARY_DIR} /src/bindings/Release;${CMAKE_BINARY_DIR} /src/bindings;$ENV{PYTHONPATH} "
219+ )
220+ else ()
221+ set_tests_properties (Test_Python_ImageConverter PROPERTIES
222+ ENVIRONMENT "PYTHONPATH=${CMAKE_BINARY_DIR} /src/bindings:$ENV{PYTHONPATH} "
223+ )
224+ endif ()
225+ endif ()
217226endif ()
218227
219228################################################################################
You can’t perform that action at this time.
0 commit comments