commit:     51c86b17c89d06bacda268a75f9a8dfa88f36e7d
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 22 09:44:08 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Nov 22 09:44:08 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=51c86b17

sys-libs/libblockdev: fix tests (to extent possible; they need root still)

Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-libs/libblockdev/libblockdev-2.26.ebuild | 11 ++++++++++-
 sys-libs/libblockdev/libblockdev-9999.ebuild | 11 ++++++++++-
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/sys-libs/libblockdev/libblockdev-2.26.ebuild 
b/sys-libs/libblockdev/libblockdev-2.26.ebuild
index 9dbccbc4377d..0682b4b778eb 100644
--- a/sys-libs/libblockdev/libblockdev-2.26.ebuild
+++ b/sys-libs/libblockdev/libblockdev-2.26.ebuild
@@ -25,7 +25,9 @@ fi
 LICENSE="LGPL-2+"
 SLOT="0"
 IUSE="bcache +cryptsetup device-mapper dmraid escrow gtk-doc introspection lvm 
kbd test +tools vdo"
-RESTRICT="!test? ( test )"
+# Tests require root. In a future release, we may be able to run a smaller
+# subset with new run_tests.py arguments.
+RESTRICT="!test? ( test ) test"
 
 RDEPEND="
        >=dev-libs/glib-2.42.2
@@ -107,6 +109,13 @@ src_configure() {
        econf "${myeconfargs[@]}"
 }
 
+src_test() {
+       # See http://storaged.org/libblockdev/ch03.html
+       # The 'check' target just does Pylint.
+       # ... but it needs root.
+       emake test
+}
+
 src_install() {
        default
        find "${ED}" -type f -name "*.la" -delete || die

diff --git a/sys-libs/libblockdev/libblockdev-9999.ebuild 
b/sys-libs/libblockdev/libblockdev-9999.ebuild
index 9dbccbc4377d..0682b4b778eb 100644
--- a/sys-libs/libblockdev/libblockdev-9999.ebuild
+++ b/sys-libs/libblockdev/libblockdev-9999.ebuild
@@ -25,7 +25,9 @@ fi
 LICENSE="LGPL-2+"
 SLOT="0"
 IUSE="bcache +cryptsetup device-mapper dmraid escrow gtk-doc introspection lvm 
kbd test +tools vdo"
-RESTRICT="!test? ( test )"
+# Tests require root. In a future release, we may be able to run a smaller
+# subset with new run_tests.py arguments.
+RESTRICT="!test? ( test ) test"
 
 RDEPEND="
        >=dev-libs/glib-2.42.2
@@ -107,6 +109,13 @@ src_configure() {
        econf "${myeconfargs[@]}"
 }
 
+src_test() {
+       # See http://storaged.org/libblockdev/ch03.html
+       # The 'check' target just does Pylint.
+       # ... but it needs root.
+       emake test
+}
+
 src_install() {
        default
        find "${ED}" -type f -name "*.la" -delete || die

Reply via email to