1 |
commit: df05e92b7444fee1caf052a9ac753b24aa34f070 |
2 |
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Jan 7 03:43:46 2019 +0000 |
4 |
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jan 8 23:40:24 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=df05e92b |
7 |
|
8 |
cargo.eclass: add standard src_test |
9 |
|
10 |
But not set IUSE=test by default |
11 |
|
12 |
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org> |
13 |
|
14 |
eclass/cargo.eclass | 12 +++++++++++- |
15 |
1 file changed, 11 insertions(+), 1 deletion(-) |
16 |
|
17 |
diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass |
18 |
index 06c85ce9de8..051d5c499a6 100644 |
19 |
--- a/eclass/cargo.eclass |
20 |
+++ b/eclass/cargo.eclass |
21 |
@@ -23,7 +23,7 @@ esac |
22 |
|
23 |
inherit multiprocessing |
24 |
|
25 |
-EXPORT_FUNCTIONS src_unpack src_compile src_install |
26 |
+EXPORT_FUNCTIONS src_unpack src_compile src_install src_test |
27 |
|
28 |
IUSE="${IUSE} debug" |
29 |
|
30 |
@@ -139,4 +139,14 @@ cargo_src_install() { |
31 |
[ -d "${S}/man" ] && doman "${S}/man" || return 0 |
32 |
} |
33 |
|
34 |
+# @FUNCTION: cargo_src_test |
35 |
+# @DESCRIPTION: |
36 |
+# Test the package using cargo test |
37 |
+cargo_src_test() { |
38 |
+ debug-print-function ${FUNCNAME} "$@" |
39 |
+ |
40 |
+ cargo test -j $(makeopts_jobs) $(usex debug "" --release) "$@" \ |
41 |
+ || die "cargo test failed" |
42 |
+} |
43 |
+ |
44 |
fi |