Make sure USE=test is properly enabled when the test phase is forced via the ebuild...
authorZac Medico <zmedico@gentoo.org>
Thu, 10 May 2007 05:35:04 +0000 (05:35 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 10 May 2007 05:35:04 +0000 (05:35 -0000)
svn path=/main/branches/2.1.2/; revision=6514

bin/ebuild.sh

index bacb21b2895ea228b2256426916b563f13c6568d..1f4877761741b65f289aa831e3da13915dd9dd63 100755 (executable)
@@ -1003,7 +1003,12 @@ dyn_compile() {
 }
 
 dyn_test() {
-       [ "${EBUILD_FORCE_TEST}" == "1" ] && rm -f "${PORTAGE_BUILDDIR}/.tested"
+       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
        [ "$(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."