mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-26 07:02:11 +00:00
Add pytest.skip() for CUDACC
``` SKIPPED [1] ../../mounted_pybind11/tests/test_type_caster_odr_guard_1.py:46: type_caster_odr_violation_detected_count() == 0: 11.2.0, C++17, CUDACC = 11.7.99 ```
This commit is contained in:
parent
eb65bfb80e
commit
0aa8c94528
@ -82,4 +82,12 @@ TEST_SUBMODULE(type_caster_odr_guard_1, m) {
|
||||
#else
|
||||
false;
|
||||
#endif
|
||||
|
||||
m.attr("CUDACC") =
|
||||
#if defined(__CUDACC_VER_MAJOR__)
|
||||
PYBIND11_TOSTRING(__CUDACC_VER_MAJOR__) "." PYBIND11_TOSTRING(
|
||||
__CUDACC_VER_MINOR__) "." PYBIND11_TOSTRING(__CUDACC_VER_BUILD__);
|
||||
#else
|
||||
py::none();
|
||||
#endif
|
||||
}
|
||||
|
@ -36,10 +36,15 @@ def test_type_caster_odr_violation_detected_counter():
|
||||
num_violations = m.type_caster_odr_violation_detected_count()
|
||||
if num_violations is None:
|
||||
pytest.skip("type_caster_odr_violation_detected_count() is None")
|
||||
elif num_violations == 0 and m.if_defined__NO_INLINE__:
|
||||
if num_violations == 0:
|
||||
if m.if_defined__NO_INLINE__:
|
||||
pytest.skip(
|
||||
"type_caster_odr_violation_detected_count() == 0: %s, %s, __NO_INLINE__"
|
||||
% (pybind11_tests.compiler_info, pybind11_tests.cpp_std)
|
||||
)
|
||||
else:
|
||||
if m.CUDACC is not None:
|
||||
pytest.skip(
|
||||
"type_caster_odr_violation_detected_count() == 0: %s, %s, CUDACC = %s"
|
||||
% (pybind11_tests.compiler_info, pybind11_tests.cpp_std, m.CUDACC)
|
||||
)
|
||||
assert num_violations == 1
|
||||
|
Loading…
Reference in New Issue
Block a user