Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
620a808a
Commit
620a808a
authored
Feb 27, 2017
by
Dean Moldovan
Committed by
Wenzel Jakob
Feb 28, 2017
Browse files
Test with debug build of Python when DEBUG=1 on Travis
parent
5fe9908b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
2 deletions
+10
-2
.travis.yml
.travis.yml
+5
-1
tests/CMakeLists.txt
tests/CMakeLists.txt
+1
-1
tests/test_cmake_build/installed_target/CMakeLists.txt
tests/test_cmake_build/installed_target/CMakeLists.txt
+4
-0
No files found.
.travis.yml
View file @
620a808a
...
...
@@ -147,9 +147,13 @@ install:
-
|
# Install dependencies
if [ -n "$DOCKER" ]; then
if [ -n "$DEBUG" ]; then
PY_DEBUG="python$PY-dbg python$PY-scipy-dbg"
export CMAKE_EXTRA_ARGS="${CMAKE_EXTRA_ARGS} -DPYTHON_EXECUTABLE=/usr/bin/python${PYTHON}dm"
fi
docker exec --tty "$containerid" sh -c "for s in 0 15; do sleep \$s; \
apt-get -qy --no-install-recommends $APT_GET_EXTRA install \
python$PY-dev python$PY-pytest python$PY-scipy \
$PY_DEBUG
python$PY-dev python$PY-pytest python$PY-scipy \
libeigen3-dev cmake make ${COMPILER_PACKAGES} && break; done"
else
pip install numpy scipy pytest
...
...
tests/CMakeLists.txt
View file @
620a808a
...
...
@@ -159,7 +159,7 @@ if(NOT PYBIND11_PYTEST_FOUND)
endif
()
# A single command to compile and run the tests
add_custom_target
(
pytest COMMAND
${
PYTHON_EXECUTABLE
}
-m pytest -rws
${
PYBIND11_PYTEST_FILES
}
add_custom_target
(
pytest COMMAND
${
PYTHON_EXECUTABLE
}
-m pytest -rws
--capture=sys
${
PYBIND11_PYTEST_FILES
}
DEPENDS pybind11_tests WORKING_DIRECTORY
${
testdir
}
)
if
(
PYBIND11_TEST_OVERRIDE
)
...
...
tests/test_cmake_build/installed_target/CMakeLists.txt
View file @
620a808a
...
...
@@ -14,5 +14,9 @@ target_link_libraries(test_cmake_build PRIVATE pybind11::module)
set_target_properties
(
test_cmake_build PROPERTIES PREFIX
"
${
PYTHON_MODULE_PREFIX
}
"
SUFFIX
"
${
PYTHON_MODULE_EXTENSION
}
"
)
# Do not treat includes from IMPORTED target as SYSTEM (Python headers in pybind11::module).
# This may be needed to resolve header conflicts, e.g. between Python release and debug headers.
set_target_properties
(
test_cmake_build PROPERTIES NO_SYSTEM_FROM_IMPORTED ON
)
add_custom_target
(
check
${
CMAKE_COMMAND
}
-E env PYTHONPATH=$<TARGET_FILE_DIR:test_cmake_build>
${
PYTHON_EXECUTABLE
}
${
PROJECT_SOURCE_DIR
}
/../test.py
${
PROJECT_NAME
}
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment