[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gentoo-dev
Subject:    [gentoo-dev] [PATCH 2/2] cargo.eclass: add standard src_test
From:       Georgy Yakovlev <gyakovlev () gentoo ! org>
Date:       2019-01-07 20:33:51
Message-ID: 20190107203351.5406-2-gyakovlev () gentoo ! org
[Download RAW message or body]

But not set IUSE=test by default

Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
---
 eclass/cargo.eclass | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
index 06c85ce9de8..051d5c499a6 100644
--- a/eclass/cargo.eclass
+++ b/eclass/cargo.eclass
@@ -23,7 +23,7 @@ esac
 
 inherit multiprocessing
 
-EXPORT_FUNCTIONS src_unpack src_compile src_install
+EXPORT_FUNCTIONS src_unpack src_compile src_install src_test
 
 IUSE="${IUSE} debug"
 
@@ -139,4 +139,14 @@ cargo_src_install() {
 	[ -d "${S}/man" ] && doman "${S}/man" || return 0
 }
 
+# @FUNCTION: cargo_src_test
+# @DESCRIPTION:
+# Test the package using cargo test
+cargo_src_test() {
+	debug-print-function ${FUNCNAME} "$@"
+
+	cargo test -j $(makeopts_jobs) $(usex debug "" --release) "$@" \
+		|| die "cargo test failed"
+}
+
 fi
-- 
2.20.1


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic