summaryrefslogtreecommitdiff
path: root/eclass/cargo.eclass
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-01-12 16:58:08 +0000
committerV3n3RiX <venerix@redcorelinux.org>2019-01-12 16:58:08 +0000
commitc8a77dfe4d3d307c1d5dd2650b7297447d8b609d (patch)
tree9ea78393bc3ecd6ab4de449383d4e97e5f3648ae /eclass/cargo.eclass
parent2891d29af8907ce881662f4a02844926d7a293c7 (diff)
gentoo resync : 12.01.2019
Diffstat (limited to 'eclass/cargo.eclass')
-rw-r--r--eclass/cargo.eclass18
1 files changed, 14 insertions, 4 deletions
diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
index 50f7830c51bc..051d5c499a6e 100644
--- a/eclass/cargo.eclass
+++ b/eclass/cargo.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Authors
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @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"
@@ -122,7 +122,7 @@ cargo_src_compile() {
export CARGO_HOME="${ECARGO_HOME}"
- cargo build -j $(makeopts_jobs) $(usex debug "" --release) \
+ cargo build -j $(makeopts_jobs) $(usex debug "" --release) "$@" \
|| die "cargo build failed"
}
@@ -132,11 +132,21 @@ cargo_src_compile() {
cargo_src_install() {
debug-print-function ${FUNCNAME} "$@"
- cargo install -j $(makeopts_jobs) --root="${D}/usr" $(usex debug --debug "") \
+ cargo install -j $(makeopts_jobs) --root="${D}/usr" $(usex debug --debug "") "$@" \
|| die "cargo install failed"
rm -f "${D}/usr/.crates.toml"
[ -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