return
fi
- if [ "${EBUILD_FORCE_TEST}" == "1" ] ; then
+ if [[ ${EBUILD_FORCE_TEST} == 1 && test =~ $PORTAGE_IUSE ]]; then
# If USE came from ${T}/environment then it might not have USE=test
# like it's supposed to here.
! has test ${USE} && export USE="${USE} test"
not hasattr(self, "_ebuild_force_test_msg_shown"):
self._ebuild_force_test_msg_shown = True
writemsg(_("Forcing test.\n"), noiselevel=-1)
- if "test" in self.features:
+ if "test" in self.features and \
+ ("test" in explicit_iuse or iuse_implicit_match("test")):
if "test" in self.usemask and not ebuild_force_test:
# "test" is in IUSE and USE=test is masked, so execution
# of src_test() probably is not reliable. Therefore,