summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'eclass/cargo.eclass')
-rw-r--r--eclass/cargo.eclass12
1 files changed, 11 insertions, 1 deletions
diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
index 06c85ce9de80..051d5c499a6e 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