mirror of
https://github.com/pybind/pybind11.git
synced 2025-01-19 01:15:52 +00:00
pytest target: add USE_TERMINAL flag
The added flag enables non-buffered console output when using Ninja
This commit is contained in:
parent
e6fd2cd5ab
commit
7653a115bd
@ -162,9 +162,15 @@ if(NOT PYBIND11_PYTEST_FOUND)
|
||||
set(PYBIND11_PYTEST_FOUND TRUE CACHE INTERNAL "")
|
||||
endif()
|
||||
|
||||
if(CMAKE_VERSION VERSION_LESS 3.2)
|
||||
set(PYBIND11_USES_TERMINAL "")
|
||||
else()
|
||||
set(PYBIND11_USES_TERMINAL "USES_TERMINAL")
|
||||
endif()
|
||||
|
||||
# A single command to compile and run the tests
|
||||
add_custom_target(pytest COMMAND ${PYTHON_EXECUTABLE} -m pytest ${PYBIND11_PYTEST_FILES}
|
||||
DEPENDS pybind11_tests WORKING_DIRECTORY ${testdir})
|
||||
DEPENDS pybind11_tests WORKING_DIRECTORY ${testdir} ${PYBIND11_USES_TERMINAL})
|
||||
|
||||
if(PYBIND11_TEST_OVERRIDE)
|
||||
add_custom_command(TARGET pytest POST_BUILD
|
||||
|
@ -116,6 +116,7 @@ def test_binary_operators():
|
||||
assert state2 == -7
|
||||
assert int(state ^ state2) == -1
|
||||
|
||||
|
||||
def test_enum_to_int():
|
||||
from pybind11_tests import Flags, ClassWithUnscopedEnum
|
||||
from pybind11_tests import test_enum_to_int, test_enum_to_uint, test_enum_to_long_long
|
||||
|
Loading…
Reference in New Issue
Block a user