File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed
test_cmake_build/installed_target Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -147,9 +147,13 @@ install:
147147- |
148148 # Install dependencies
149149 if [ -n "$DOCKER" ]; then
150+ if [ -n "$DEBUG" ]; then
151+ PY_DEBUG="python$PY-dbg python$PY-scipy-dbg"
152+ export CMAKE_EXTRA_ARGS="${CMAKE_EXTRA_ARGS} -DPYTHON_EXECUTABLE=/usr/bin/python${PYTHON}dm"
153+ fi
150154 docker exec --tty "$containerid" sh -c "for s in 0 15; do sleep \$s; \
151155 apt-get -qy --no-install-recommends $APT_GET_EXTRA install \
152- python$PY-dev python$PY-pytest python$PY-scipy \
156+ $PY_DEBUG python$PY-dev python$PY-pytest python$PY-scipy \
153157 libeigen3-dev cmake make ${COMPILER_PACKAGES} && break; done"
154158 else
155159 pip install numpy scipy pytest
Original file line number Diff line number Diff line change @@ -159,7 +159,7 @@ if(NOT PYBIND11_PYTEST_FOUND)
159159endif ()
160160
161161# A single command to compile and run the tests
162- add_custom_target (pytest COMMAND ${PYTHON_EXECUTABLE} -m pytest -rws ${PYBIND11_PYTEST_FILES}
162+ add_custom_target (pytest COMMAND ${PYTHON_EXECUTABLE} -m pytest -rws --capture=sys ${PYBIND11_PYTEST_FILES}
163163 DEPENDS pybind11_tests WORKING_DIRECTORY ${testdir} )
164164
165165if (PYBIND11_TEST_OVERRIDE)
Original file line number Diff line number Diff line change @@ -14,5 +14,9 @@ target_link_libraries(test_cmake_build PRIVATE pybind11::module)
1414set_target_properties (test_cmake_build PROPERTIES PREFIX "${PYTHON_MODULE_PREFIX} "
1515 SUFFIX "${PYTHON_MODULE_EXTENSION} " )
1616
17+ # Do not treat includes from IMPORTED target as SYSTEM (Python headers in pybind11::module).
18+ # This may be needed to resolve header conflicts, e.g. between Python release and debug headers.
19+ set_target_properties (test_cmake_build PROPERTIES NO_SYSTEM_FROM_IMPORTED ON )
20+
1721add_custom_target (check ${CMAKE_COMMAND} -E env PYTHONPATH=$<TARGET_FILE_DIR:test_cmake_build>
1822 ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR} /../test .py ${PROJECT_NAME} )
You can’t perform that action at this time.
0 commit comments