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
7653a115
Commit
7653a115
authored
Apr 28, 2017
by
Wenzel Jakob
Browse files
pytest target: add USE_TERMINAL flag
The added flag enables non-buffered console output when using Ninja
parent
e6fd2cd5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
tests/CMakeLists.txt
tests/CMakeLists.txt
+7
-1
tests/test_enum.py
tests/test_enum.py
+1
-0
No files found.
tests/CMakeLists.txt
View file @
7653a115
...
@@ -162,9 +162,15 @@ if(NOT PYBIND11_PYTEST_FOUND)
...
@@ -162,9 +162,15 @@ if(NOT PYBIND11_PYTEST_FOUND)
set
(
PYBIND11_PYTEST_FOUND TRUE CACHE INTERNAL
""
)
set
(
PYBIND11_PYTEST_FOUND TRUE CACHE INTERNAL
""
)
endif
()
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
# A single command to compile and run the tests
add_custom_target
(
pytest COMMAND
${
PYTHON_EXECUTABLE
}
-m pytest
${
PYBIND11_PYTEST_FILES
}
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
)
if
(
PYBIND11_TEST_OVERRIDE
)
add_custom_command
(
TARGET pytest POST_BUILD
add_custom_command
(
TARGET pytest POST_BUILD
...
...
tests/test_enum.py
View file @
7653a115
...
@@ -116,6 +116,7 @@ def test_binary_operators():
...
@@ -116,6 +116,7 @@ def test_binary_operators():
assert
state2
==
-
7
assert
state2
==
-
7
assert
int
(
state
^
state2
)
==
-
1
assert
int
(
state
^
state2
)
==
-
1
def
test_enum_to_int
():
def
test_enum_to_int
():
from
pybind11_tests
import
Flags
,
ClassWithUnscopedEnum
from
pybind11_tests
import
Flags
,
ClassWithUnscopedEnum
from
pybind11_tests
import
test_enum_to_int
,
test_enum_to_uint
,
test_enum_to_long_long
from
pybind11_tests
import
test_enum_to_int
,
test_enum_to_uint
,
test_enum_to_long_long
...
...
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