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>
16 lines
505 B
Python
16 lines
505 B
Python
import os
|
|
import infra
|
|
import subprocess
|
|
from tests.package.test_python import TestPythonPackageBase
|
|
|
|
class TestPythonPybind (TestPythonPackageBase):
|
|
__test__ = True
|
|
config = TestPythonPackageBase.config + \
|
|
"""
|
|
BR2_PACKAGE_PYTHON3=y
|
|
BR2_PACKAGE_PYTHON_PYBIND_EXAMPLE=y
|
|
"""
|
|
sample_scripts = ["tests/package/sample_python_pybind.py"]
|
|
# ship examples macro & installs it to host
|
|
br2_external = [infra.filepath("tests/package/br2-external/python-pybind")]
|