commit: 29855922923b4cef389fe281e6678d00ed8fd04b Author: Michał Górny <mgorny <AT> gentoo <DOT> org> AuthorDate: Mon Jul 22 16:56:47 2024 +0000 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> CommitDate: Mon Jul 22 16:57:11 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=29855922
net-wireless/blueman: Enable tests Closes: https://bugs.gentoo.org/929218 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> net-wireless/blueman/blueman-2.4.2.ebuild | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/net-wireless/blueman/blueman-2.4.2.ebuild b/net-wireless/blueman/blueman-2.4.2.ebuild index d89a6f6583ea..d593d644bf14 100644 --- a/net-wireless/blueman/blueman-2.4.2.ebuild +++ b/net-wireless/blueman/blueman-2.4.2.ebuild @@ -39,6 +39,10 @@ DEPEND=" BDEPEND=" $(python_gen_cond_dep ' dev-python/cython[${PYTHON_USEDEP}] + test? ( + dev-python/python-dbusmock[${PYTHON_USEDEP}] + >=net-misc/networkmanager-0.8[introspection] + ) ') virtual/pkgconfig nls? ( sys-devel/gettext ) @@ -80,6 +84,8 @@ RDEPEND=" ) " +distutils_enable_tests unittest + pkg_pretend() { if use network; then local CONFIG_CHECK=" @@ -123,6 +129,27 @@ python_compile() { default } +python_test() { + local -x PYTHONPATH=module/.libs + + if [[ ! -f /dev/rfkill ]]; then + # Tests attempt to import these modules if present, but they + # require /dev/rfkill. Hide them to make the tests pass. + mv blueman/plugins/mechanism/RfKill.py{,~} || die + mv blueman/plugins/applet/KillSwitch.py{,~} || die + fi + + local failed= + nonfatal eunittest || failed=1 + + if [[ ! -f /dev/rfkill ]]; then + mv blueman/plugins/mechanism/RfKill.py{~,} || die + mv blueman/plugins/applet/KillSwitch.py{~,} || die + fi + + [[ ${failed} ]] && die "Tests failed with ${EPYTHON}" +} + python_install() { default
