support/testing: add test for python-pybind

The way that python-pybind can be used is fairly complicated, so a
runtime test for it is convenient. In addition, this test validates that
the headers actually work at runtime.

Signed-off-by: Guillaume W. Bres <guillaume.bressaix@gmail.com>
[Arnout:
 - Retain python3 only.
 - python-pybind is a target package, not host.
 - Select python-pybind instead of depend.
 - Simplify python-pybind-example package.
 - Check in python-pybind-example build if pybind11.get_include()
   produces output.
 - Don't use python3 -m pybind11 --includes: it includes the main python
   includes, which are for the host, not for the target.
 - Use TestPythonPackageBase instead of open-coding something imported
   with host python.
]
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
This commit is contained in:
Guillaume W. Bres
2022-01-04 13:39:01 +01:00
committed by Arnout Vandecappelle (Essensium/Mind)
parent a19b822239
commit 87f2b7004e
9 changed files with 88 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
#!/usr/bin/env python
import example
print(example.add(1, 2))
print(example.says)