summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2023-03-18 05:41:53 +0000
committerSam James <sam@gentoo.org>2023-03-22 03:25:07 +0000
commitd070090b50b7aa34bd9c16af895fb50e911cd50d (patch)
tree32e17cb53203cb9bdf09f1a91ca2be9ec3e9a71e
parentruby-ng.eclass: use eqawarn for test dependency warning (diff)
downloadgentoo-d070090b50b7aa34bd9c16af895fb50e911cd50d.tar.gz
gentoo-d070090b50b7aa34bd9c16af895fb50e911cd50d.tar.bz2
gentoo-d070090b50b7aa34bd9c16af895fb50e911cd50d.zip
ruby-fakegem.eclass: allow non-fatal use of test functions
die -n will make die become non-fatal if run under 'nonfatal', this is useful if e.g. need to do cleanup. For example, in an ebuild, I need to setup a database, run tests, then always cleanup, which looks like: ``` db_setup nonfatal each_fakegem_test || tests_failed=1 db_cleanup if [[ ${tests_failed} == 1 ]] ; then die "Tests failed! Please see ..." fi ``` Just like we do with e.g. virtualx. This also brings us into line with the Python eclasses. Signed-off-by: Sam James <sam@gentoo.org>
-rw-r--r--eclass/ruby-fakegem.eclass4
1 files changed, 2 insertions, 2 deletions
diff --git a/eclass/ruby-fakegem.eclass b/eclass/ruby-fakegem.eclass
index 8cf5dd70f864..9ef5e1f098d1 100644
--- a/eclass/ruby-fakegem.eclass
+++ b/eclass/ruby-fakegem.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: ruby-fakegem.eclass
@@ -552,7 +552,7 @@ each_fakegem_test() {
case ${RUBY_FAKEGEM_RECIPE_TEST} in
rake)
- MT_NO_PLUGINS=true ${RUBY} --disable=did_you_mean -S rake ${RUBY_FAKEGEM_TASK_TEST} || die "tests failed"
+ MT_NO_PLUGINS=true ${RUBY} --disable=did_you_mean -S rake ${RUBY_FAKEGEM_TASK_TEST} || die -n "tests failed"
;;
rspec)
RSPEC_VERSION=2 ruby-ng_rspec