summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2023-03-10 18:20:42 +0000
committerSam James <sam@gentoo.org>2023-03-22 03:25:05 +0000
commit3a8d66d43be8dbd63b86c089fc5208f9bb62b27a (patch)
tree1e9cf383101ffa1eefc12be44c0efdf3401b9779 /eclass/ruby-ng.eclass
parentwww-client/chromium: Stabilize 111.0.5563.64 amd64, #902547 (diff)
downloadgentoo-3a8d66d43be8dbd63b86c089fc5208f9bb62b27a.tar.gz
gentoo-3a8d66d43be8dbd63b86c089fc5208f9bb62b27a.tar.bz2
gentoo-3a8d66d43be8dbd63b86c089fc5208f9bb62b27a.zip
ruby-ng.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>
Diffstat (limited to 'eclass/ruby-ng.eclass')
-rw-r--r--eclass/ruby-ng.eclass4
1 files changed, 2 insertions, 2 deletions
diff --git a/eclass/ruby-ng.eclass b/eclass/ruby-ng.eclass
index 67c22d518a31..aa8a15170cf8 100644
--- a/eclass/ruby-ng.eclass
+++ b/eclass/ruby-ng.eclass
@@ -721,7 +721,7 @@ ruby-ng_rspec() {
;;
esac
- ${RUBY} -S rspec-${version} ${rspec_params} ${files} || die "rspec failed"
+ ${RUBY} -S rspec-${version} ${rspec_params} ${files} || die -n "rspec failed"
}
# @FUNCTION: ruby-ng_cucumber
@@ -754,7 +754,7 @@ ruby-ng_cucumber() {
;;
esac
- CUCUMBER_PUBLISH_QUIET=true ${RUBY} -S cucumber ${cucumber_params} "$@" || die "cucumber failed"
+ CUCUMBER_PUBLISH_QUIET=true ${RUBY} -S cucumber ${cucumber_params} "$@" || die -n "cucumber failed"
}
# @FUNCTION: ruby-ng_testrb-2