mirror of
https://github.com/pybind/pybind11.git
synced 2025-01-19 09:25:51 +00:00
test_type_caster_odr_guard: pytest.skip(...NVCOMPILER...)
This commit is contained in:
parent
b9e956b002
commit
23cd9128de
@ -89,5 +89,12 @@ TEST_SUBMODULE(type_caster_odr_guard_1, m) {
|
||||
__CUDACC_VER_MINOR__) "." PYBIND11_TOSTRING(__CUDACC_VER_BUILD__);
|
||||
#else
|
||||
py::none();
|
||||
#endif
|
||||
m.attr("NVCOMPILER") =
|
||||
#if defined(__NVCOMPILER_MAJOR__)
|
||||
PYBIND11_TOSTRING(__NVCOMPILER_MAJOR__) "." PYBIND11_TOSTRING(
|
||||
__NVCOMPILER_MINOR__) "." PYBIND11_TOSTRING(__NVCOMPILER_PATCHLEVEL__);
|
||||
#else
|
||||
py::none();
|
||||
#endif
|
||||
}
|
||||
|
@ -32,21 +32,22 @@ def test_type_caster_odr_registry_values():
|
||||
assert "test_type_caster_odr_guard_" in "\n".join(reg_values)
|
||||
|
||||
|
||||
def _count_0_message(tail):
|
||||
return (
|
||||
"type_caster_odr_violation_detected_count() == 0:"
|
||||
f" {pybind11_tests.compiler_info}, {pybind11_tests.cpp_std}, " + tail
|
||||
)
|
||||
|
||||
|
||||
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")
|
||||
if num_violations == 0:
|
||||
if m.if_defined__NO_INLINE__:
|
||||
pytest.skip(
|
||||
f"type_caster_odr_violation_detected_count() == 0:"
|
||||
f" {pybind11_tests.compiler_info}, {pybind11_tests.cpp_std},"
|
||||
" __NO_INLINE__"
|
||||
)
|
||||
pytest.skip(_count_0_message("__NO_INLINE__"))
|
||||
if m.CUDACC is not None:
|
||||
pytest.skip(
|
||||
f"type_caster_odr_violation_detected_count() == 0:"
|
||||
f" {pybind11_tests.compiler_info}, {pybind11_tests.cpp_std},"
|
||||
" CUDACC = {m.CUDACC}"
|
||||
)
|
||||
pytest.skip(_count_0_message(f"CUDACC = {m.CUDACC}"))
|
||||
if m.NVCOMPILER is not None:
|
||||
pytest.skip(_count_0_message(f"NVCOMPILER = {m.NVCOMPILER}"))
|
||||
assert num_violations == 1
|
||||
|
Loading…
Reference in New Issue
Block a user