Always run src_test when calling 'ebuild foo test'
authorMarius Mauch <genone@gentoo.org>
Tue, 9 Jan 2007 01:21:19 +0000 (01:21 -0000)
committerMarius Mauch <genone@gentoo.org>
Tue, 9 Jan 2007 01:21:19 +0000 (01:21 -0000)
svn path=/main/trunk/; revision=5487

bin/ebuild
bin/ebuild.sh

index 55bb0fb81d70c969da3f19e68ce232e6f1f6f669..f5c8d1f699d07fc79be0ba1194cf94ca4cfe0d41 100755 (executable)
@@ -126,6 +126,10 @@ def discard_digests(myebuild, mysettings, mydbapi):
 for arg in pargs:
        try:
                tmpsettings = portage.config(clone=portage.settings)
+               if arg == "test" and not "test" in tmpsettings.features:
+                       print "Forcing test."
+                       tmpsettings["EBUILD_FORCE_TEST"] = "1"
+                       tmpsettings.backupenv["EBUILD_FORCE_TEST"] = "1"
                if arg == "digest" and force:
                        discard_digests(ebuild, tmpsettings, portage.portdb)
                a = portage.doebuild(ebuild, arg, portage.root, tmpsettings,
index 1a9381682923aacc4a7fe1a16e506d387e484d5d..5abc44bf9e34b5c012db88a40da9387a8d8dd6c9 100755 (executable)
@@ -1010,6 +1010,7 @@ dyn_compile() {
 }
 
 dyn_test() {
+       [ "${EBUILD_FORCE_TEST}" == "1" ] && rm -f "${PORTAGE_BUILDDIR}/.tested"
        [ "$(type -t pre_src_test)" == "function" ] && qa_call pre_src_test
        if [ "${PORTAGE_BUILDDIR}/.tested" -nt "${WORKDIR}" ]; then
                vecho ">>> It appears that ${PN} has already been tested; skipping."
@@ -1020,7 +1021,7 @@ dyn_test() {
        if [ -d "${S}" ]; then
                cd "${S}"
        fi
-       if ! hasq test $FEATURES; then
+       if ! hasq test $FEATURES && [ "${EBUILD_FORCE_TEST}" != "1" ]; then
                vecho ">>> Test phase [not enabled]: ${CATEGORY}/${PF}"
        elif hasq test $RESTRICT; then
                ewarn "Skipping make test/check due to ebuild restriction."