Gentoo Archives: gentoo-commits

From: Georgy Yakovlev <gyakovlev@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/rust/
Date: Wed, 07 Oct 2020 06:58:53
Message-Id: 1602053914.9e3b4eb2e403a3ed5aa7ab0a19c05782cd198868.gyakovlev@gentoo
1 commit: 9e3b4eb2e403a3ed5aa7ab0a19c05782cd198868
2 Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
3 AuthorDate: Wed Oct 7 06:05:30 2020 +0000
4 Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
5 CommitDate: Wed Oct 7 06:58:34 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9e3b4eb2
7
8 dev-lang/rust: rework src_test
9
10 Package-Manager: Portage-3.0.8, Repoman-3.0.1
11 Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
12
13 dev-lang/rust/rust-1.46.0.ebuild | 69 ++++++++++++++++++++++++++++++----------
14 1 file changed, 53 insertions(+), 16 deletions(-)
15
16 diff --git a/dev-lang/rust/rust-1.46.0.ebuild b/dev-lang/rust/rust-1.46.0.ebuild
17 index 68cc5bb4cb2..7490fabdab7 100644
18 --- a/dev-lang/rust/rust-1.46.0.ebuild
19 +++ b/dev-lang/rust/rust-1.46.0.ebuild
20 @@ -114,8 +114,7 @@ QA_SONAME="
21 usr/lib.*/${P}/rustlib/.*/lib/lib.*.so.*
22 "
23
24 -# tests need a bit more work, currently they are causing multiple
25 -# re-compilations and somewhat fragile.
26 +# still disabled, almost ready to enable
27 RESTRICT="test"
28
29 PATCHES=(
30 @@ -419,19 +418,57 @@ src_compile() {
31 }
32
33 src_test() {
34 - env $(cat "${S}"/config.env) RUST_BACKTRACE=1\
35 - "${EPYTHON}" ./x.py test -vv --config="${S}"/config.toml -j$(makeopts_jobs) --no-doc --no-fail-fast \
36 - src/test/codegen \
37 - src/test/codegen-units \
38 - src/test/compile-fail \
39 - src/test/incremental \
40 - src/test/mir-opt \
41 - src/test/pretty \
42 - src/test/run-fail \
43 - src/test/run-make \
44 - src/test/run-make-fulldeps \
45 - src/test/ui \
46 - src/test/ui-fulldeps || die
47 + # https://rustc-dev-guide.rust-lang.org/tests/intro.html
48 +
49 + # those are basic and codegen tests.
50 + local tests=(
51 + codegen
52 + codegen-units
53 + compile-fail
54 + incremental
55 + mir-opt
56 + pretty
57 + run-make
58 + )
59 +
60 + # known to fail with system-llvm sometimes
61 + # system-llvm is stable-masked for time-being
62 + # so only test internal one.
63 + use system-llvm || tests+=( assembly )
64 +
65 + # fragile/expensive/less important tests
66 + # or tests that require extra build time
67 + # TODO: instead of skipping, just make some nonfatal.
68 + if [[ ${ERUST_RUN_EXTRA_TESTS:-no} != no ]]; then
69 + tests+=(
70 + rustdoc
71 + rustdoc-js
72 + rustdoc-js-std
73 + rustdoc-ui
74 + run-make-fulldeps
75 + ui
76 + ui-fulldeps
77 + )
78 + fi
79 +
80 + local i failed=()
81 + einfo "rust_src_test: enabled tests ${tests[@]/#/src/test/}"
82 + for i in "${tests[@]}"; do
83 + local t="src/test/${i}"
84 + einfo "rust_src_test: running ${t}"
85 + if ! nonfatal env $(cat "${S}"/config.env) RUST_BACKTRACE=1 \
86 + "${EPYTHON}" ./x.py test -vv --config="${S}"/config.toml \
87 + -j$(makeopts_jobs) --no-doc --no-fail-fast "${t}"; then
88 +
89 + failed+=( "${t}" )
90 + eerror "rust_src_test: ${t} failed"
91 + fi
92 + done
93 +
94 + if [[ ${#failed[@]} -ne 0 ]]; then
95 + eerror "rust_src_test: failure summary: ${failed[@]}"
96 + die "aborting due to test failures"
97 + fi
98 }
99
100 src_install() {
101 @@ -478,7 +515,7 @@ src_install() {
102 rust_target=$(rust_abi $(get_abi_CHOST ${v##*.}))
103 mkdir -p "${ED}/usr/${abi_libdir}/${P}"
104 cp "${ED}/usr/$(get_libdir)/${P}/rustlib/${rust_target}/lib"/*.so \
105 - "${ED}/usr/${abi_libdir}/${P}" || die
106 + "${ED}/usr/${abi_libdir}/${P}" || die
107 done
108
109 # versioned libdir/mandir support