diff options
author | Naohiro Aota <naota@gentoo.org> | 2020-02-15 13:34:08 +0900 |
---|---|---|
committer | Naohiro Aota <naota@gentoo.org> | 2020-07-30 16:21:27 +0900 |
commit | 5da3d4422152bc5867264ee99c0952b03b6a966f (patch) | |
tree | 5e69b31e38e1ecb47c0fbcb5ae1415336563aaf8 /eclass | |
parent | ruby-ng-gnome2.eclass: add test dependency (diff) | |
download | gentoo-5da3d4422152bc5867264ee99c0952b03b6a966f.tar.gz gentoo-5da3d4422152bc5867264ee99c0952b03b6a966f.tar.bz2 gentoo-5da3d4422152bc5867264ee99c0952b03b6a966f.zip |
ruby-ng-gnome2.eclass: implement common test code
Fold common test code from runy-gnome2 ebuild to this eclass.
To support test under virtx, introduce RUBY_GNOME2_NEED_VIRTX variable.
Signed-off-by: Naohiro Aota <naota@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/ruby-ng-gnome2.eclass | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/eclass/ruby-ng-gnome2.eclass b/eclass/ruby-ng-gnome2.eclass index df14f40d83aa..fd9f23492a95 100644 --- a/eclass/ruby-ng-gnome2.eclass +++ b/eclass/ruby-ng-gnome2.eclass @@ -24,7 +24,17 @@ RUBY_FAKEGEM_NAME="${RUBY_FAKEGEM_NAME:-${PN#ruby-}}" RUBY_FAKEGEM_TASK_TEST="" RUBY_FAKEGEM_TASK_DOC="" +# @ECLASS-VARIABLE: RUBY_GNOME2_NEED_VIRTX +# @PRE_INHERIT +# @DESCRIPTION: +# If set to 'yes', the test is run with virtx. Set before inheriting this +# eclass. +: ${RUBY_GNOME2_NEED_VIRTX:="no"} + inherit ruby-fakegem +if [[ ${RUBY_GNOME2_NEED_VIRTX} == yes ]]; then + inherit virtualx +fi IUSE="test" RESTRICT+=" !test? ( test )" @@ -89,3 +99,16 @@ all_ruby_install() { all_fakegem_install } + +# @FUNCTION: each_ruby_test +# @DESCRIPTION: +# Run the tests for this package. +each_ruby_test() { + [[ -e test/run-test.rb ]] || return + + if [[ ${RUBY_GNOME2_NEED_VIRTX} == yes ]]; then + virtx ${RUBY} test/run-test.rb + else + ${RUBY} test/run-test.rb || die + fi +} |