From b35c0617907ed2c35369aa7da246683011c51caf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Sun, 7 Jun 2015 14:44:00 +0200 Subject: [PATCH] Replace nonfatal example with something correct Replace the nonfatal example from a poor programming practice to a code collecting logs for test failures. Copied from sys-apps/paludis. Fixes: https://bugs.gentoo.org/show_bug.cgi?id=551190 --- ebuild-writing/eapi/text.xml | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/ebuild-writing/eapi/text.xml b/ebuild-writing/eapi/text.xml index 3faab22..8b26382 100644 --- a/ebuild-writing/eapi/text.xml +++ b/ebuild-writing/eapi/text.xml @@ -373,19 +373,29 @@ src_compile() {

Example:

-EAPI=1 +EAPI=2 ... -src_install() { - emake DESTDIR="${D}" install || die "make install failed" - dodoc ChangeLog README +src_test() { + if ! emake check ; then + eerror "Tests failed. Looking for files for you to add to your bug report..." + find "${S}" -type f -name '*.epicfail' -or -name '*.log' | while read a ; do + eerror " ${a}" + done + die "Make check failed" + fi } EAPI=4 ... -src_install() { - emake DESTDIR="${D}" install - nonfatal dodoc ChangeLog README +src_test() { + if ! nonfatal emake check ; then + eerror "Tests failed. Looking for files for you to add to your bug report..." + find "${S}" -type f -name '*.epicfail' -or -name '*.log' | while read a ; do + eerror " ${a}" + done + die "Make check failed" + fi } -- 2.4.2