summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2017-06-28 07:46:00 +0200
committerMichał Górny <mgorny@gentoo.org>2017-06-28 10:23:06 +0200
commit6065f099995b037bd9bb1a3ad11143400fefa45e (patch)
treeaff0f7582a0ec46f793628b62b54269c29c4e556 /app-shells
parentdev-cpp/catch: Bump to 1.9.6 (diff)
downloadgentoo-6065f099995b037bd9bb1a3ad11143400fefa45e.tar.gz
gentoo-6065f099995b037bd9bb1a3ad11143400fefa45e.tar.bz2
gentoo-6065f099995b037bd9bb1a3ad11143400fefa45e.zip
app-shells/bash-completion: Support running tests (creepy)
Include the dependencies and code needed to run tests. Due to DejaGnu, we need to emulate a virtual terminal to run tests. For this purpose, use dtach since it is the smallest tool that solves the problem that I know of. Restrict the tests since they fail, and the failures are likely false positives.
Diffstat (limited to 'app-shells')
-rw-r--r--app-shells/bash-completion/bash-completion-2.6.ebuild30
1 files changed, 27 insertions, 3 deletions
diff --git a/app-shells/bash-completion/bash-completion-2.6.ebuild b/app-shells/bash-completion/bash-completion-2.6.ebuild
index 0585f5e0e970..99d53dd87c6a 100644
--- a/app-shells/bash-completion/bash-completion-2.6.ebuild
+++ b/app-shells/bash-completion/bash-completion-2.6.ebuild
@@ -14,12 +14,20 @@ SRC_URI="https://github.com/scop/bash-completion/releases/download/${PV}/${P}.ta
LICENSE="GPL-2"
SLOT="0"
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"
-IUSE=""
+IUSE="test"
+# Multiple test failures, need to investigate the exact problem
+RESTRICT="test"
RDEPEND=">=app-shells/bash-4.3_p30-r1
sys-apps/miscfiles
!app-eselect/eselect-bashcomp"
-DEPEND="app-arch/xz-utils"
+DEPEND="app-arch/xz-utils
+ test? (
+ ${RDEPEND}
+ app-misc/dtach
+ dev-util/dejagnu
+ dev-tcltk/tcllib
+ )"
PDEPEND=">=app-shells/gentoo-bashcomp-20140911"
# Remove unwanted completions.
@@ -48,7 +56,23 @@ src_prepare() {
eapply_user
}
-src_test() { :; } # Skip testsuite because of interactive shell wrt #477066
+src_test() {
+ # Tests need an interactive shell, #477066
+ # idea stolen from:
+ # http://pkgs.fedoraproject.org/cgit/rpms/bash-completion.git/tree/bash-completion.spec
+
+ # real-time output of the log ;-)
+ touch "${T}/dtach-test.log" || die
+ tail -f "${T}/dtach-test.log" &
+ local tail_pid=${!}
+
+ nonfatal dtach -N "${T}/dtach.sock" \
+ bash -c 'emake check &> "${T}"/dtach-test.log; echo ${?} > "${T}"/dtach-test.out'
+
+ kill "${tail_pid}"
+ [[ -f ${T}/dtach-test.out ]] || die "Unable to run tests"
+ [[ $(<"${T}"/dtach-test.out) == 0 ]] || die "Tests failed"
+}
src_install() {
# work-around race conditions, bug #526996