commit:     020bc5f388efdef50ce2a5d47fce1e2d96df8c2a
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Sep  8 14:25:34 2024 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Sep  8 14:26:38 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=020bc5f3

dev-embedded/nodemcu-uploader: Use unittest to run tests

Closes: https://bugs.gentoo.org/927517
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 .../nodemcu-uploader-1.0.0-r1.ebuild                 | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/dev-embedded/nodemcu-uploader/nodemcu-uploader-1.0.0-r1.ebuild 
b/dev-embedded/nodemcu-uploader/nodemcu-uploader-1.0.0-r1.ebuild
index bf82f1c4fcba..80a603e45d10 100644
--- a/dev-embedded/nodemcu-uploader/nodemcu-uploader-1.0.0-r1.ebuild
+++ b/dev-embedded/nodemcu-uploader/nodemcu-uploader-1.0.0-r1.ebuild
@@ -14,10 +14,17 @@ 
SRC_URI="https://github.com/kmpm/nodemcu-uploader/archive/v${PV}.tar.gz -> ${P}.
 LICENSE="MIT"
 SLOT="0"
 KEYWORDS="~amd64 ~x86"
-
-RDEPEND=">=dev-python/pyserial-3.4[${PYTHON_USEDEP}]"
-
-distutils_enable_tests setup.py
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+       >=dev-python/pyserial-3.4[${PYTHON_USEDEP}]
+"
+BDEPEND="
+       test? (
+               ${RDEPEND}
+       )
+"
 
 src_prepare() {
        # https://bugs.gentoo.org/796422
@@ -25,3 +32,8 @@ src_prepare() {
 
        distutils-r1_src_prepare
 }
+
+python_test() {
+       "${EPYTHON}" -m unittest -v tests.get_tests ||
+               die "Tests failed on ${EPYTHON}"
+}

Reply via email to