This has come up very recently on the -dev mailing list, but it is something the Java team has had to deal with for a while now. For Java packages, the vast majority of packages use junit for unit testing, so at the very least, unit testing always need to pull in junit. TO address this in Java packages, I've added the following method to java-utils-2.eclass: java-pkg_ensure-test() { if hasq test ${FEATURES} && ! hasq -test ${FEATURES} && ! use test; then eerror "You specified FEATURES=test, but USE=test is needed" eerror "to pull in the additional dependencies for testing" die "Need USE=test enabled" fi } Certainly, this is not something that is Java specific, so probably could go somewhere like in eutils perhaps? Also, it might be useful to have a usefeature, or something like that, to query enabled features so you don't have to check FEATURES directly.
Would be nice to have for the new postgresql-ebuild.
this isnt something to file a bug about, hash it out on the gentoo-dev mailing list
Ok, to make it clearer: There ist a new ebuild for postgresql available (in the postgresql-overlay) which could benefit from both ideas mentioned here.
I think it would be better if FEATURES=test enabled USE=test automatically, but also make sure it's not recorded into /var/db/pkg/.../USE or that it's filtered out from --newuse because rebuilding everything just because I've stopped testing makes no sense.
like i said, this is not for bugzilla discussion take it up on the gentoo-dev mailing list
Reopen for correct resolution.
This has been fixed in recent portage-2.1.2 revisions.