Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-shells/bash-completion/
Date: Wed, 28 Jun 2017 08:23:16
Message-Id: 1498638186.6065f099995b037bd9bb1a3ad11143400fefa45e.mgorny@gentoo
1 commit: 6065f099995b037bd9bb1a3ad11143400fefa45e
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jun 28 05:46:00 2017 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Wed Jun 28 08:23:06 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6065f099
7
8 app-shells/bash-completion: Support running tests (creepy)
9
10 Include the dependencies and code needed to run tests. Due to DejaGnu,
11 we need to emulate a virtual terminal to run tests. For this purpose,
12 use dtach since it is the smallest tool that solves the problem that
13 I know of.
14
15 Restrict the tests since they fail, and the failures are likely false
16 positives.
17
18 .../bash-completion/bash-completion-2.6.ebuild | 30 +++++++++++++++++++---
19 1 file changed, 27 insertions(+), 3 deletions(-)
20
21 diff --git a/app-shells/bash-completion/bash-completion-2.6.ebuild b/app-shells/bash-completion/bash-completion-2.6.ebuild
22 index 0585f5e0e97..99d53dd87c6 100644
23 --- a/app-shells/bash-completion/bash-completion-2.6.ebuild
24 +++ b/app-shells/bash-completion/bash-completion-2.6.ebuild
25 @@ -14,12 +14,20 @@ SRC_URI="https://github.com/scop/bash-completion/releases/download/${PV}/${P}.ta
26 LICENSE="GPL-2"
27 SLOT="0"
28 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris"
29 -IUSE=""
30 +IUSE="test"
31 +# Multiple test failures, need to investigate the exact problem
32 +RESTRICT="test"
33
34 RDEPEND=">=app-shells/bash-4.3_p30-r1
35 sys-apps/miscfiles
36 !app-eselect/eselect-bashcomp"
37 -DEPEND="app-arch/xz-utils"
38 +DEPEND="app-arch/xz-utils
39 + test? (
40 + ${RDEPEND}
41 + app-misc/dtach
42 + dev-util/dejagnu
43 + dev-tcltk/tcllib
44 + )"
45 PDEPEND=">=app-shells/gentoo-bashcomp-20140911"
46
47 # Remove unwanted completions.
48 @@ -48,7 +56,23 @@ src_prepare() {
49 eapply_user
50 }
51
52 -src_test() { :; } # Skip testsuite because of interactive shell wrt #477066
53 +src_test() {
54 + # Tests need an interactive shell, #477066
55 + # idea stolen from:
56 + # http://pkgs.fedoraproject.org/cgit/rpms/bash-completion.git/tree/bash-completion.spec
57 +
58 + # real-time output of the log ;-)
59 + touch "${T}/dtach-test.log" || die
60 + tail -f "${T}/dtach-test.log" &
61 + local tail_pid=${!}
62 +
63 + nonfatal dtach -N "${T}/dtach.sock" \
64 + bash -c 'emake check &> "${T}"/dtach-test.log; echo ${?} > "${T}"/dtach-test.out'
65 +
66 + kill "${tail_pid}"
67 + [[ -f ${T}/dtach-test.out ]] || die "Unable to run tests"
68 + [[ $(<"${T}"/dtach-test.out) == 0 ]] || die "Tests failed"
69 +}
70
71 src_install() {
72 # work-around race conditions, bug #526996