Gentoo Archives: gentoo-commits

From: Naohiro Aota <naota@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Thu, 30 Jul 2020 07:21:48
Message-Id: 1596093687.5da3d4422152bc5867264ee99c0952b03b6a966f.naota@gentoo
1 commit: 5da3d4422152bc5867264ee99c0952b03b6a966f
2 Author: Naohiro Aota <naota <AT> gentoo <DOT> org>
3 AuthorDate: Sat Feb 15 04:34:08 2020 +0000
4 Commit: Naohiro Aota <naota <AT> gentoo <DOT> org>
5 CommitDate: Thu Jul 30 07:21:27 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5da3d442
7
8 ruby-ng-gnome2.eclass: implement common test code
9
10 Fold common test code from runy-gnome2 ebuild to this eclass.
11
12 To support test under virtx, introduce RUBY_GNOME2_NEED_VIRTX variable.
13
14 Signed-off-by: Naohiro Aota <naota <AT> gentoo.org>
15
16 eclass/ruby-ng-gnome2.eclass | 23 +++++++++++++++++++++++
17 1 file changed, 23 insertions(+)
18
19 diff --git a/eclass/ruby-ng-gnome2.eclass b/eclass/ruby-ng-gnome2.eclass
20 index df14f40d83a..fd9f23492a9 100644
21 --- a/eclass/ruby-ng-gnome2.eclass
22 +++ b/eclass/ruby-ng-gnome2.eclass
23 @@ -24,7 +24,17 @@ RUBY_FAKEGEM_NAME="${RUBY_FAKEGEM_NAME:-${PN#ruby-}}"
24 RUBY_FAKEGEM_TASK_TEST=""
25 RUBY_FAKEGEM_TASK_DOC=""
26
27 +# @ECLASS-VARIABLE: RUBY_GNOME2_NEED_VIRTX
28 +# @PRE_INHERIT
29 +# @DESCRIPTION:
30 +# If set to 'yes', the test is run with virtx. Set before inheriting this
31 +# eclass.
32 +: ${RUBY_GNOME2_NEED_VIRTX:="no"}
33 +
34 inherit ruby-fakegem
35 +if [[ ${RUBY_GNOME2_NEED_VIRTX} == yes ]]; then
36 + inherit virtualx
37 +fi
38
39 IUSE="test"
40 RESTRICT+=" !test? ( test )"
41 @@ -89,3 +99,16 @@ all_ruby_install() {
42
43 all_fakegem_install
44 }
45 +
46 +# @FUNCTION: each_ruby_test
47 +# @DESCRIPTION:
48 +# Run the tests for this package.
49 +each_ruby_test() {
50 + [[ -e test/run-test.rb ]] || return
51 +
52 + if [[ ${RUBY_GNOME2_NEED_VIRTX} == yes ]]; then
53 + virtx ${RUBY} test/run-test.rb
54 + else
55 + ${RUBY} test/run-test.rb || die
56 + fi
57 +}