Add a new FEATURES=test-fail-continue value which causes ebuild execution
authorZac Medico <zmedico@gentoo.org>
Fri, 12 Dec 2008 21:51:45 +0000 (21:51 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 12 Dec 2008 21:51:45 +0000 (21:51 -0000)
to continue after the test phase has failed. Thanks to Diego Pettenò
<flameeyes@g.o> for the suggestion. (trunk r12214)

svn path=/main/branches/2.1.6/; revision=12245

man/make.conf.5
pym/_emerge/__init__.py
pym/portage/__init__.py

index b5c201ec5d977745d759dfeb7325d63145fc0fad..07ecba6f83be628df113be53bea5ef655182b03f 100644 (file)
@@ -334,6 +334,12 @@ the package compiled properly.  See \fItest\fR in \fBebuild\fR(1)
 and \fIsrc_test()\fR in \fBebuild\fR(5). This feature implies the "test"
 \fBUSE\fR flag.
 .TP
+.B test\-fail\-continue
+If "test" is enabled \fBFEATURES\fR and the test phase of an ebuild fails,
+continue to execute the remaining phases as if the failure had not occurred.
+Note that the test phase for a specific package may be disabled by masking
+the "test" \fBUSE\fR flag in \fBpackage.use.mask\fR (see \fBportage\fR(5)).
+.TP
 .B unmerge\-orphans
 If a file is not claimed by another package in the same slot and it is not
 protected by \fICONFIG_PROTECT\fR, unmerge it even if the modification time or
index 418acebb710a9982be307ea97410c9ce451f41d6..aa944d267b078a73b96aaeb9bbfaea2ca19515de 100644 (file)
@@ -2908,6 +2908,10 @@ class EbuildProcess(SpawnProcess):
                        self.returncode = portage._doebuild_exit_status_check_and_log(
                                self.settings, self.phase, self.returncode)
 
+               if self.phase == "test" and self.returncode != os.EX_OK and \
+                       "test-fail-continue" in self.settings.features:
+                       self.returncode = os.EX_OK
+
                portage._post_phase_userpriv_perms(self.settings)
 
 class EbuildPhase(CompositeTask):
index 582b6541731876c10cfccb7b01d637c29896077c..48f0b69e6166f5e3ebbb570d8e4a3031ade0b7bc 100644 (file)
@@ -4493,6 +4493,11 @@ def spawnebuild(mydo, actionmap, mysettings, debug, alwaysdep=0,
                _check_build_log(mysettings)
                if phase_retval == os.EX_OK:
                        phase_retval = _post_src_install_checks(mysettings)
+
+       if mydo == "test" and phase_retval != os.EX_OK and \
+               "test-fail-continue" in mysettings.features:
+               phase_retval = os.EX_OK
+
        return phase_retval
 
 _post_phase_cmds = {