summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgy Yakovlev <gyakovlev@gentoo.org>2020-10-06 23:05:30 -0700
committerGeorgy Yakovlev <gyakovlev@gentoo.org>2020-10-06 23:58:34 -0700
commit9e3b4eb2e403a3ed5aa7ab0a19c05782cd198868 (patch)
tree68ed2a8d981fdee6121e84d1d22f94564e27d56b /dev-lang
parentdev-util/meson: s390 stable wrt bug #746581 (diff)
downloadgentoo-9e3b4eb2e403a3ed5aa7ab0a19c05782cd198868.tar.gz
gentoo-9e3b4eb2e403a3ed5aa7ab0a19c05782cd198868.tar.bz2
gentoo-9e3b4eb2e403a3ed5aa7ab0a19c05782cd198868.zip
dev-lang/rust: rework src_test
Package-Manager: Portage-3.0.8, Repoman-3.0.1 Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
Diffstat (limited to 'dev-lang')
-rw-r--r--dev-lang/rust/rust-1.46.0.ebuild69
1 files changed, 53 insertions, 16 deletions
diff --git a/dev-lang/rust/rust-1.46.0.ebuild b/dev-lang/rust/rust-1.46.0.ebuild
index 68cc5bb4cb29..7490fabdab76 100644
--- a/dev-lang/rust/rust-1.46.0.ebuild
+++ b/dev-lang/rust/rust-1.46.0.ebuild
@@ -114,8 +114,7 @@ QA_SONAME="
usr/lib.*/${P}/rustlib/.*/lib/lib.*.so.*
"
-# tests need a bit more work, currently they are causing multiple
-# re-compilations and somewhat fragile.
+# still disabled, almost ready to enable
RESTRICT="test"
PATCHES=(
@@ -419,19 +418,57 @@ src_compile() {
}
src_test() {
- env $(cat "${S}"/config.env) RUST_BACKTRACE=1\
- "${EPYTHON}" ./x.py test -vv --config="${S}"/config.toml -j$(makeopts_jobs) --no-doc --no-fail-fast \
- src/test/codegen \
- src/test/codegen-units \
- src/test/compile-fail \
- src/test/incremental \
- src/test/mir-opt \
- src/test/pretty \
- src/test/run-fail \
- src/test/run-make \
- src/test/run-make-fulldeps \
- src/test/ui \
- src/test/ui-fulldeps || die
+ # https://rustc-dev-guide.rust-lang.org/tests/intro.html
+
+ # those are basic and codegen tests.
+ local tests=(
+ codegen
+ codegen-units
+ compile-fail
+ incremental
+ mir-opt
+ pretty
+ run-make
+ )
+
+ # known to fail with system-llvm sometimes
+ # system-llvm is stable-masked for time-being
+ # so only test internal one.
+ use system-llvm || tests+=( assembly )
+
+ # fragile/expensive/less important tests
+ # or tests that require extra build time
+ # TODO: instead of skipping, just make some nonfatal.
+ if [[ ${ERUST_RUN_EXTRA_TESTS:-no} != no ]]; then
+ tests+=(
+ rustdoc
+ rustdoc-js
+ rustdoc-js-std
+ rustdoc-ui
+ run-make-fulldeps
+ ui
+ ui-fulldeps
+ )
+ fi
+
+ local i failed=()
+ einfo "rust_src_test: enabled tests ${tests[@]/#/src/test/}"
+ for i in "${tests[@]}"; do
+ local t="src/test/${i}"
+ einfo "rust_src_test: running ${t}"
+ if ! nonfatal env $(cat "${S}"/config.env) RUST_BACKTRACE=1 \
+ "${EPYTHON}" ./x.py test -vv --config="${S}"/config.toml \
+ -j$(makeopts_jobs) --no-doc --no-fail-fast "${t}"; then
+
+ failed+=( "${t}" )
+ eerror "rust_src_test: ${t} failed"
+ fi
+ done
+
+ if [[ ${#failed[@]} -ne 0 ]]; then
+ eerror "rust_src_test: failure summary: ${failed[@]}"
+ die "aborting due to test failures"
+ fi
}
src_install() {
@@ -478,7 +515,7 @@ src_install() {
rust_target=$(rust_abi $(get_abi_CHOST ${v##*.}))
mkdir -p "${ED}/usr/${abi_libdir}/${P}"
cp "${ED}/usr/$(get_libdir)/${P}/rustlib/${rust_target}/lib"/*.so \
- "${ED}/usr/${abi_libdir}/${P}" || die
+ "${ED}/usr/${abi_libdir}/${P}" || die
done
# versioned libdir/mandir support