diff options
author | Georgy Yakovlev <gyakovlev@gentoo.org> | 2019-01-06 19:43:46 -0800 |
---|---|---|
committer | Georgy Yakovlev <gyakovlev@gentoo.org> | 2019-01-08 15:40:24 -0800 |
commit | df05e92b7444fee1caf052a9ac753b24aa34f070 (patch) | |
tree | 343b327aa364d60744140d319b8b78a92647d481 /eclass | |
parent | cargo.eclass: allow passing additional arguments to cargo (diff) | |
download | gentoo-df05e92b7444fee1caf052a9ac753b24aa34f070.tar.gz gentoo-df05e92b7444fee1caf052a9ac753b24aa34f070.tar.bz2 gentoo-df05e92b7444fee1caf052a9ac753b24aa34f070.zip |
cargo.eclass: add standard src_test
But not set IUSE=test by default
Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/cargo.eclass | 12 |
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 |