Gentoo Archives: gentoo-commits

From: "Amadeusz Piotr Żołnowski" <aidecoe@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Wed, 29 Mar 2017 21:46:13
Message-Id: 1490823425.0b404c4125cf464c99bd369bcba1ded30d1eba2d.aidecoe@gentoo
1 commit: 0b404c4125cf464c99bd369bcba1ded30d1eba2d
2 Author: Amadeusz Żołnowski <aidecoe <AT> gentoo <DOT> org>
3 AuthorDate: Tue Mar 28 22:40:24 2017 +0000
4 Commit: Amadeusz Piotr Żołnowski <aidecoe <AT> gentoo <DOT> org>
5 CommitDate: Wed Mar 29 21:37:05 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0b404c41
7
8 rebar.eclass: Disable coverage in test phase
9
10 This is a workaround for failing coverage. Coverage is not relevant in
11 this context, so there's no harm to disable it, although the issue
12 should be fixed.
13
14 eclass/rebar.eclass | 21 ++++++++++++++++++++-
15 1 file changed, 20 insertions(+), 1 deletion(-)
16
17 diff --git a/eclass/rebar.eclass b/eclass/rebar.eclass
18 index 3ffe5630d77..3620153f8c3 100644
19 --- a/eclass/rebar.eclass
20 +++ b/eclass/rebar.eclass
21 @@ -78,6 +78,22 @@ _rebar_find_dep() {
22 echo "${result}"
23 }
24
25 +# @FUNCTION: rebar_disable_coverage
26 +# @USAGE: [<rebar_config>]
27 +# @DESCRIPTION:
28 +# Disable coverage in rebar.config. This is a workaround for failing coverage.
29 +# Coverage is not relevant in this context, so there's no harm to disable it,
30 +# although the issue should be fixed.
31 +rebar_disable_coverage() {
32 + debug-print-function ${FUNCNAME} "${@}"
33 +
34 + local rebar_config="${1:-rebar.config}"
35 +
36 + sed -e 's/{cover_enabled, true}/{cover_enabled, false}/' \
37 + -i "${rebar_config}" \
38 + || die "failed to disable coverage in ${rebar_config}"
39 +}
40 +
41 # @FUNCTION: erebar
42 # @USAGE: <targets>
43 # @DESCRIPTION:
44 @@ -183,7 +199,10 @@ rebar_src_prepare() {
45
46 default
47 rebar_set_vsn
48 - [[ -f rebar.config ]] && rebar_remove_deps
49 + if [[ -f rebar.config ]]; then
50 + rebar_disable_coverage
51 + rebar_remove_deps
52 + fi
53 }
54
55 # @FUNCTION: rebar_src_configure