Bug #320755 - Make sure src_test only runs once when ebuild(1)
authorZac Medico <zmedico@gentoo.org>
Sat, 22 May 2010 02:01:44 +0000 (19:01 -0700)
committerZac Medico <zmedico@gentoo.org>
Sat, 22 May 2010 02:01:44 +0000 (19:01 -0700)
is used to explicitly run the test phase along with other
phases.

bin/ebuild.sh

index 43f310cb95d9b8f1d79c869948aa77536ff13568..d7ff593a4a5a215683694717557d57348aa9dda1 100755 (executable)
@@ -980,16 +980,19 @@ dyn_compile() {
 }
 
 dyn_test() {
+
+       if [[ -e $PORTAGE_BUILDDIR/.tested ]] ; then
+               vecho ">>> It appears that ${PN} has already been tested; skipping."
+               vecho ">>> Remove '${PORTAGE_BUILDDIR}/.tested' to force test."
+               return
+       fi
+
        if [ "${EBUILD_FORCE_TEST}" == "1" ] ; then
-               rm -f "${PORTAGE_BUILDDIR}/.tested"
                # If USE came from ${T}/environment then it might not have USE=test
                # like it's supposed to here.
                ! hasq test ${USE} && export USE="${USE} test"
        fi
-       if [[ -e $PORTAGE_BUILDDIR/.tested ]] ; then
-               vecho ">>> It appears that ${PN} has already been tested; skipping."
-               return
-       fi
+
        trap "abort_test" SIGINT SIGQUIT
        if [ -d "${S}" ]; then
                cd "${S}"