pybind11/tests/namespace_visibility_1s.cpp
Ralf W. Grosse-Kunstleve 203cc26f5b
[smart_holder] Add test_namespace_visibility (#4050)
* Add test_namespace_visibility

To probe environment/toolchain/platform-specific behavior under the exact same conditions as normal tests.

(An earlier version of this code was used to inform PR #4043.)

* Disable flake8 in ubench/holder_comparison_*.py, to suppress new & useless diagnostics.

* Disable namespace_visibility_1s.cpp (tosee if that resolves the MSVC and CUDA `test_cross_module_exception_translator` failures).

* Turn off flake8 completely for ubench (the Strip unnecessary `# noqa`s action un-helpfully removed the added noqa).

* Disable test_namespace_visibility completely. Just keep the two .cpp files, only setting the module docstring and doing nothing else.

* Rename test_namespace_visibility.py to test_exc_namespace_visibility.py, so that it is imported by pytest before test_exceptions.py

* Add `set_property(SOURCE namespace_visibility_1s.cpp PROPERTY LANGUAGE CUDA)`

* Add reference to PR #4054

* Complete the documentation (comments in test_exc_namespace_visibility.py).

* Rename namespace_visibility.h to namespace_visibility.inl, as suggested by @charlesbeattie
2022-07-12 18:33:42 -07:00

18 lines
864 B
C++

#include "pybind11/pybind11.h"
#include "namespace_visibility.inl"
// clang-format off
namespace pybind11_ns_vis_uuu PYBIND11_NS_VIS_U { PYBIND11_NS_VIS_FUNC }
namespace pybind11_ns_vis_uuh PYBIND11_NS_VIS_U { PYBIND11_NS_VIS_FUNC }
namespace pybind11_ns_vis_uhu PYBIND11_NS_VIS_H { PYBIND11_NS_VIS_FUNC }
namespace pybind11_ns_vis_uhh PYBIND11_NS_VIS_H { PYBIND11_NS_VIS_FUNC }
namespace pybind11_ns_vis_huu PYBIND11_NS_VIS_U { PYBIND11_NS_VIS_FUNC }
namespace pybind11_ns_vis_huh PYBIND11_NS_VIS_U { PYBIND11_NS_VIS_FUNC }
namespace pybind11_ns_vis_hhu PYBIND11_NS_VIS_H { PYBIND11_NS_VIS_FUNC }
namespace pybind11_ns_vis_hhh PYBIND11_NS_VIS_H { PYBIND11_NS_VIS_FUNC }
// ^ ^
// bit used ............. here
// clang-format on
void namespace_visibility_1s(pybind11::module_ &m) { PYBIND11_NS_VIS_DEFS }